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

Issue 2786493003: Inline SelectorQuery::executeForTraverseRoots into findTraverseRootsAndExecute. (Closed)

Created:
3 years, 8 months ago by esprehn
Modified:
3 years, 8 months ago
Reviewers:
meade_UTC10, dglazkov, 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

Inline SelectorQuery::executeForTraverseRoots into findTraverseRootsAndExecute. This function is just a glorified if statement over the enum value we pass into it. Inline the two loops into the call sites. We can also remove the check against SelectorQueryTrait::shouldOnlyMatchFirstElement inside the loops since the outer check ensures it's always false. This lets us remove the MatchTraverseRootState enum. It does make the findTraverseRootsAndExecute function bigger, but it removes a bunch of checks in the process. Future patches will simplify further and hopefully shrink the function. BUG=703900 Review-Url: https://codereview.chromium.org/2786493003 Cr-Commit-Position: refs/heads/master@{#460448} Committed: https://chromium.googlesource.com/chromium/src/+/7283eda4c582d4aa64838377970466ae6a4d2f2e

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -56 lines) Patch
M third_party/WebKit/Source/core/dom/SelectorQuery.h View 1 chunk +0 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/dom/SelectorQuery.cpp View 2 chunks +14 lines, -45 lines 1 comment Download

Messages

Total messages: 21 (17 generated)
esprehn
https://codereview.chromium.org/2786493003/diff/1/third_party/WebKit/Source/core/dom/SelectorQuery.cpp File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/2786493003/diff/1/third_party/WebKit/Source/core/dom/SelectorQuery.cpp#newcode291 third_party/WebKit/Source/core/dom/SelectorQuery.cpp:291: break; This was just executing the code below if ...
3 years, 8 months ago (2017-03-29 05:00:43 UTC) #15
rune
That looked over-engineered. lgtm
3 years, 8 months ago (2017-03-29 09:38:46 UTC) #16
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/2786493003/1
3 years, 8 months ago (2017-03-29 17:45:37 UTC) #18
commit-bot: I haz the power
3 years, 8 months ago (2017-03-29 17:51:37 UTC) #21
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/7283eda4c582d4aa648383779704...

Powered by Google App Engine
This is Rietveld 408576698