|
|
Chromium Code Reviews
DescriptionSimplify some arguments inside SelectorQuery.
We can hoist some code and remove some arguments since we always pass the same
thing.
BUG=703900
Review-Url: https://codereview.chromium.org/2767113003
Cr-Commit-Position: refs/heads/master@{#459011}
Committed: https://chromium.googlesource.com/chromium/src/+/26d67176f9cf8b10fd2a378cb83492e432af23ba
Patch Set 1 #
Total comments: 7
Messages
Total messages: 19 (9 generated)
The CQ bit was checked by esprehn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Simplify some arguments inside SelectorQuery. BUG= ========== to ========== Simplify some arguments inside SelectorQuery. We can hoist some code and remove some arguments since we always pass the same thing. BUG=703900 ==========
esprehn@chromium.org changed reviewers: + rune@opera.com, sashab@chromium.org
https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (left): https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/SelectorQuery.cpp:238: // this method finds that the selectors won't match any element. This comment was ancient, from when we used to return the traverse roots and some bools. The code doesn't work this way at all anymore so I removed it.
https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (left): https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/SelectorQuery.cpp:238: // this method finds that the selectors won't match any element. On 2017/03/23 at 01:09:33, esprehn wrote: > This comment was ancient, from when we used to return the traverse roots and some bools. The code doesn't work this way at all anymore so I removed it. Wanna add an updated comment to explain how it works now? :)
:) https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (left): https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/SelectorQuery.cpp:238: // this method finds that the selectors won't match any element. On 2017/03/23 at 05:40:21, sashab wrote: > On 2017/03/23 at 01:09:33, esprehn wrote: > > This comment was ancient, from when we used to return the traverse roots and some bools. The code doesn't work this way at all anymore so I removed it. > > Wanna add an updated comment to explain how it works now? :) I'd prefer to do that in a separate patch.
lgtm https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/SelectorQuery.cpp:260: SelectorQueryTrait::appendElement(output, *element); I don't really understand this part of the change, and why its equivalent to the existing call to executeForTraverseRoot, but I'm assuming you do :)
https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/SelectorQuery.cpp:260: SelectorQueryTrait::appendElement(output, *element); On 2017/03/23 at 06:26:32, sashab wrote: > I don't really understand this part of the change, and why its equivalent to the existing call to executeForTraverseRoot, but I'm assuming you do :) The code used to pass MatchedTraverseRoot as the enum value, which then went down this branch: if (!traverseRoot) return; if (matchTraverseRoot) { if (selectorMatches(selector, toElement(*traverseRoot), rootNode)) SelectorQueryTrait::appendElement(output, toElement(*traverseRoot)); return; } I inlined that code here.
The CQ bit was checked by esprehn@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 1, "attempt_start_ts": 1490250816385020, "parent_rev":
"1ccd33f53b1c52f9afc2df087a0f608c13bc6bb5", "commit_rev":
"26d67176f9cf8b10fd2a378cb83492e432af23ba"}
Message was sent while issue was closed.
Description was changed from ========== Simplify some arguments inside SelectorQuery. We can hoist some code and remove some arguments since we always pass the same thing. BUG=703900 ========== to ========== Simplify some arguments inside SelectorQuery. We can hoist some code and remove some arguments since we always pass the same thing. BUG=703900 Review-Url: https://codereview.chromium.org/2767113003 Cr-Commit-Position: refs/heads/master@{#459011} Committed: https://chromium.googlesource.com/chromium/src/+/26d67176f9cf8b10fd2a378cb834... ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/26d67176f9cf8b10fd2a378cb834...
Message was sent while issue was closed.
https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/SelectorQuery.cpp:260: SelectorQueryTrait::appendElement(output, *element); On 2017/03/23 at 06:31:58, esprehn wrote: > On 2017/03/23 at 06:26:32, sashab wrote: > > I don't really understand this part of the change, and why its equivalent to the existing call to executeForTraverseRoot, but I'm assuming you do :) > > The code used to pass MatchedTraverseRoot as the enum value, which then went down this branch: > > if (!traverseRoot) > return; > if (matchTraverseRoot) { > if (selectorMatches(selector, toElement(*traverseRoot), rootNode)) > SelectorQueryTrait::appendElement(output, toElement(*traverseRoot)); > return; > } > > I inlined that code here. Can you remove it from the function then? Do other callsites still need it?
Message was sent while issue was closed.
https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/2767113003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/dom/SelectorQuery.cpp:260: SelectorQueryTrait::appendElement(output, *element); On 2017/03/23 at 23:19:05, sashab wrote: > ... > > Can you remove it from the function then? Do other callsites still need it? I did remove it from that function. There's a another function that's similarly named: executeForTraverseRoots <-- plural with the "s" that still uses it though. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
