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

Issue 2875673006: Allow using SelectorQuery fast paths in quirks mode and disconnected subtrees. (Closed)

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

Allow using SelectorQuery fast paths in quirks mode and disconnected subtrees. Previously there was a single global switch in the form of SelectorQuery::CanUseFastQuery which controlled if we use any fast path at all in querySelector. It was trying to enforce the rules for the original id fast path though, and meant we were disabling all the other fast paths (class, tagName) in quirks documents even though there's no need to do that. It also meant we wouldn't use the id fast path inside disconnected ShadowRoots. This patch removes CanUseFastQuery() and replaces it with specific checks for the id fast path, and stores the now static checks for the other fast paths in a member variable use_slow_scan_. This means shadowRoot or element.querySelector("#a") for an element in a ShadowRoot is now O(1) even when the ShadowRoot is not connected to the document. It also means we'll use the class and id fast paths in quirks mode and also disconnected subtrees. BUG=703900 Review-Url: https://codereview.chromium.org/2875673006 Cr-Commit-Position: refs/heads/master@{#471384} Committed: https://chromium.googlesource.com/chromium/src/+/ad2bef1e6dd219c8b8e1fbe58b86a896550634c9

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -64 lines) Patch
M third_party/WebKit/Source/core/dom/SelectorQuery.h View 2 chunks +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/SelectorQuery.cpp View 7 chunks +20 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp View 4 chunks +62 lines, -43 lines 0 comments Download

Messages

Total messages: 12 (8 generated)
esprehn
3 years, 7 months ago (2017-05-11 22:26:18 UTC) #3
meade_UTC10
lgtm
3 years, 7 months ago (2017-05-12 04:22:56 UTC) #7
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/2875673006/1
3 years, 7 months ago (2017-05-12 18:35:06 UTC) #9
commit-bot: I haz the power
3 years, 7 months ago (2017-05-12 18:45:25 UTC) #12
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/ad2bef1e6dd219c8b8e1fbe58b86...

Powered by Google App Engine
This is Rietveld 408576698