 
                 ###
 
-                List of used element methods defined in JQuery but not in JQuery Lite
+                List of used element methods available in JQuery but not in JQuery Lite
                 in other words if you want to remove dependency on JQuery the following methods are to be implemented:
+
                 element.height()
                 element.outerHeight(true)
                 element.height(value) = only for Top/Bottom padding elements
                 element.scrollTop()
                 element.scrollTop(value)
-                element.position()
+                element.offset()
 
                 ###
 
                 viewport = controller[0] || angular.element(window)
                 canvas = controller[1] || element.parent()
+                if canvas[0] == viewport[0]
+                  # if canvas and the viewport are the same create a new div to service as canvas
+                  contents = canvas.contents()
+                  canvas = angular.element('<div/>')
+                  viewport.append canvas
+                  canvas.append contents
+
+
 
                 topPadding = angular.element('<div/>')
                 element.before topPadding

                    console.log "clipped off bottom #{overage} bottom padding #{bottomHeight}"

                shouldLoadTop = ->
                  result = first > 1 &&
                    buffer[0].element.offset().top - canvas.offset().top > viewport.scrollTop() - bufferPadding()
                  console.log 'load top ' + result
                  result

                clipTop = ->
                  # clip off the invisible items form the top

                  #(buffer.length == 0 || scope.defaultText(buffer[buffer.length-1]).toLowerCase() <= globals.selectedText.toLowerCase()) ||
                  # and we have enough for the scrollbar to show up
                  item = buffer[buffer.length-1]
                  if item
                    !eof && item.element.offset().top - canvas.offset().top + item.element.outerHeight(true) <
                      viewport.scrollTop() + viewport.height() + bufferPadding()
                  else
                    true

                clipBottom = ->
                    # clip off the invisible items form the bottom
