DescriptionRemove isTreeScopeRoot and just rely on isDescendantOf instead.
Today the SelectorQuery code does:
isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)
after getting an element from the rootNode's treeScope id map as a way to
check if the element is inside the rootNode, but if isTreeScopeRoot was
true then isDescendantOf must also be true, so all this was doing was saving
a function call and a few branches for the elements with the matching id. This
doesn't seem worth the added complexity, so lets just rely on isDescendantOf.
This also lets us remove isTreeScopeRoot function, which is semantically
equivalent to Node::isTreeScope() anyway.
BUG=703900
Review-Url: https://codereview.chromium.org/2768263006
Cr-Commit-Position: refs/heads/master@{#459734}
Committed: https://chromium.googlesource.com/chromium/src/+/7166178c862576e32636718ec0ec5ab29eb9a453
Patch Set 1 #
Messages
Total messages: 15 (10 generated)
|