     # To work around this, when told to select specific nodes, we have to
     # do various other things. See bellow.
 
-    if USE_THEAD_TBODY_WORKAROUND and node.nodeType is Node.ELEMENT_NODE and
-        node.tagName.toLowerCase() in ["thead", "tbody"] and node.hasChildNodes()
+    if node.nodeType is Node.ELEMENT_NODE and node.hasChildNodes() and
+        ((USE_THEAD_TBODY_WORKAROUND and node.tagName.toLowerCase() in ["thead", "tbody"]) or
+        (USE_OL_WORKAROUND and node.tagName.toLowerCase() is "ol"))
       # This is a thead or a tbody, and selection those is problematic,
       # because if the WebKit bug.
       # (Sometimes it selects nothing, sometimes it selects the whole table.)

        content: cont
        length: cont.length
        node : node

    # Step two: cover all children.
    # Q: should we check children even if the goven node had no rendered content?
    # I seem to remember that the answer is yes, but I don't remember why.
    if node.hasChildNodes()
      for child in node.childNodes
        @collectPathsForNode child        
    null

  getBody: -> (@rootWin.document.getElementsByTagName "body")[0]


  USE_THEAD_TBODY_WORKAROUND = true
  USE_TABLE_TEXT_WORKAROUND = true
  USE_OL_WORKAROUND = true
  CONTEXT_LEN = 32

  @instances: []
