       container = figure.parentNode
       offset = findChildIndexOfNode(figure)
 
-    walker = walkTree(@element, usingFilter: skipFigureContentsFilter)
+    walker = walkTree(@element, usingFilter: rejectFigureContents)
 
     while walker.nextNode()
       node = walker.currentNode

    string = Trix.UTF16String.box(node.textContent)
    string.offsetFromUCS2Offset(offset)

  emptyTextNodeFilter = (node) ->
    if nodeIsEmptyTextNode(node)
      NodeFilter.FILTER_REJECT
    else
      NodeFilter.FILTER_ACCEPT

  skipFigureContentsFilter = (node) ->
    if tagName(node.parentNode) is "figure"
      NodeFilter.FILTER_REJECT
    else

  findNodeAndOffsetFromLocation: (location) ->
    offset = 0

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

      if location.offset <= offset + length
