     string = Trix.UTF16String.box(node.textContent)
     string.offsetFromUCS2Offset(offset)
 
-  emptyTextNodeFilter = (node) ->
+  acceptSignificantNodes = (node) ->
+    if rejectEmptyTextNodes(node) is NodeFilter.FILTER_ACCEPT
+      rejectFigureContents(node)
+    else
+      NodeFilter.FILTER_REJECT
+
+  rejectEmptyTextNodes = (node) ->
     if nodeIsEmptyTextNode(node)
       NodeFilter.FILTER_REJECT
     else
       NodeFilter.FILTER_ACCEPT
 
-  skipFigureContentsFilter = (node) ->
+  rejectFigureContents = (node) ->
     if tagName(node.parentNode) is "figure"
       NodeFilter.FILTER_REJECT
     else

      container = figure.parentNode
      offset = findChildIndexOfNode(figure)

    walker = walkTree(@element, usingFilter: skipFigureContentsFilter)

    while walker.nextNode()
      node = walker.currentNode

  findNodeAndOffsetFromLocation: (location) ->
    offset = 0

    for currentNode in @getSignificantNodesForIndex(location.index)
      length = nodeLength(currentNode)

      if location.offset <= offset + length
