 class window.DomTextMapper
 
-  USE_TH_TBODY_WORKAROUND = true
+  USE_THEAD_TBODY_WORKAROUND = true
+  USE_TABLE_TEXT_WORKAROUND = true
+  CONTEXT_LEN = 32
 
   constructor: ->
     @setRealRoot()

      @collectPathsForNode node

#      console.log "Done. Updating mappings..."
      parentPath = @parentPath path
      parentPathInfo = @allPaths[parentPath]
      parentMappings = @mappings[parentPath]
      oldIndex = @mappings[path].start - parentMappings.start

      @collectStrings node, path, parentPathInfo.content, parentMappings.start, oldIndex
#      console.log "Data update took " + (@timestamp() - startTime) + " ms."

    else

    # create our range, and select it
    range = @rootWin.document.createRange()

    # There is some weird, bogus behaviour in Chrome,
    # triggered by whitespaces between the table tag and it's children.
    # See the select-tbody and the select-the-parent-when-selecting problems
    # described here:
    #    https://github.com/hypothesis/h/issues/280
    # And the WebKit bug report here:
    #    https://bugs.webkit.org/show_bug.cgi?id=110595
    # 
    # 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()
      # This is a thead or a tbody, and selection those is problematic,
      # because if the WebKit bug.
