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

Issue 2139843002: Allow [id=X] selectors to use the querySelector ID fast path. (Closed)

Created:
4 years, 5 months ago by esprehn
Modified:
4 years, 5 months ago
Reviewers:
meade_UTC10, sashab, rune, ojan
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow [id=X] selectors to use the querySelector ID fast path. This removes 300ms of input latency when clicking the input boxes in the Mint transaction table on a Reks chromebook and 800ms when clicking anything on Zillow on a Reks. On a 2013 MacPro this saves 30-100ms when clicking on those websites. querySelector(All) supports a fast path which transforms calls with selectors like "#foo" and ".foo #bar" into a getElementById call followed by a matches() call against the element and the selector. This patch allows using that getElementById path when writing selectors like "[id=foo]" or ".foo [id=foo]". Selectors of this type are used by the YUI framework and pages like Zillow and Mint often execute a thousand calls to one of these selectors per click event. BUG=627242 Committed: https://crrev.com/696789dfa7c62bef99966bbe2e0a41109e636a84 Cr-Commit-Position: refs/heads/master@{#404933}

Patch Set 1 #

Patch Set 2 : fix assert. #

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

Messages

Total messages: 30 (19 generated)
esprehn
4 years, 5 months ago (2016-07-12 01:26:45 UTC) #13
sashab
This is awesome!!! LGTM https://codereview.chromium.org/2139843002/diff/20001/third_party/WebKit/Source/core/dom/SelectorQuery.cpp File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/2139843002/diff/20001/third_party/WebKit/Source/core/dom/SelectorQuery.cpp#newcode460 third_party/WebKit/Source/core/dom/SelectorQuery.cpp:460: return selector; Would it be ...
4 years, 5 months ago (2016-07-12 01:37:03 UTC) #14
esprehn
https://codereview.chromium.org/2139843002/diff/20001/third_party/WebKit/Source/core/dom/SelectorQuery.cpp File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/2139843002/diff/20001/third_party/WebKit/Source/core/dom/SelectorQuery.cpp#newcode460 third_party/WebKit/Source/core/dom/SelectorQuery.cpp:460: return selector; On 2016/07/12 at 01:37:03, sashab wrote: > ...
4 years, 5 months ago (2016-07-12 01:39:16 UTC) #15
sashab
On 2016/07/12 at 01:39:16, esprehn wrote: > https://codereview.chromium.org/2139843002/diff/20001/third_party/WebKit/Source/core/dom/SelectorQuery.cpp > File third_party/WebKit/Source/core/dom/SelectorQuery.cpp (right): > > https://codereview.chromium.org/2139843002/diff/20001/third_party/WebKit/Source/core/dom/SelectorQuery.cpp#newcode460 ...
4 years, 5 months ago (2016-07-12 01:41:00 UTC) #17
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/2139843002/20001
4 years, 5 months ago (2016-07-12 03:24:26 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/260630)
4 years, 5 months ago (2016-07-12 06:22:27 UTC) #21
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/2139843002/20001
4 years, 5 months ago (2016-07-12 17:04:59 UTC) #23
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/2139843002/20001
4 years, 5 months ago (2016-07-12 19:10:21 UTC) #26
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 5 months ago (2016-07-13 02:52:38 UTC) #27
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 02:53:09 UTC) #28
commit-bot: I haz the power
4 years, 5 months ago (2016-07-13 02:55:35 UTC) #30
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/696789dfa7c62bef99966bbe2e0a41109e636a84
Cr-Commit-Position: refs/heads/master@{#404933}

Powered by Google App Engine
This is Rietveld 408576698