Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Issue 2768263006: Remove isTreeScopeRoot. (Closed)

Created:
3 years, 9 months ago by esprehn
Modified:
3 years, 9 months ago
Reviewers:
sashab, hayato, rune
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -13 lines) Patch
M third_party/WebKit/Source/core/dom/Node.h View 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/dom/SelectorQuery.cpp View 3 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 15 (10 generated)
esprehn
3 years, 9 months ago (2017-03-25 00:54:43 UTC) #5
sashab
Cool idea, LGTM. BTW you should send these style reviews to meade@, instead of me, ...
3 years, 9 months ago (2017-03-27 05:11:25 UTC) #9
hayato
LGTM It looks Node::isDescendantOf(other) does the similar check, other.isTreeScope(), we do not need to check ...
3 years, 9 months ago (2017-03-27 06:46:20 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2768263006/1
3 years, 9 months ago (2017-03-27 08:13:31 UTC) #12
commit-bot: I haz the power
3 years, 9 months ago (2017-03-27 09:40:09 UTC) #15
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/7166178c862576e32636718ec0ec...

Powered by Google App Engine
This is Rietveld 408576698