aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStephen Blott2016-03-28 05:51:46 +0100
committerStephen Blott2016-03-28 05:51:46 +0100
commit2a62e4811fc2360257dd99066b4caa3e95025cbf (patch)
tree1a9a59629600a849aa096d19e7db3681828dcd1d /lib
parent3539ad89382c02bf2f89d890b86e49409059391f (diff)
parent00c9e9e1a0c26fc8ece99318bf5eec85a090ecc2 (diff)
downloadvimium-2a62e4811fc2360257dd99066b4caa3e95025cbf.tar.bz2
Merge pull request #2048 from smblott-github/global-link-hints
Global link hints
Diffstat (limited to 'lib')
-rw-r--r--lib/dom_utils.coffee19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index 39e1fecd..014a1f50 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -316,25 +316,6 @@ DomUtils =
else
sel.focusNode
- # Get the text content of an element (and its descendents), but omit the text content of previously-visited
- # nodes. See #1514.
- # NOTE(smblott). This is currently O(N^2) (when called on N elements). An alternative would be to mark
- # each node visited, and then clear the marks when we're done.
- textContent: do ->
- visitedNodes = null
- reset: -> visitedNodes = []
- get: (element) ->
- nodes = document.createTreeWalker element, NodeFilter.SHOW_TEXT
- texts =
- while node = nodes.nextNode()
- continue unless node.nodeType == 3
- continue if node in visitedNodes
- text = node.data.trim()
- continue unless 0 < text.length
- visitedNodes.push node
- text
- texts.join " "
-
# Get the element in the DOM hierachy that contains `element`.
# If the element is rendered in a shadow DOM via a <content> element, the <content> element will be
# returned, so the shadow DOM is traversed rather than passed over.