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

Issue 1245933002: document.querySelector[All]() should check selector context (Closed)

Created:
5 years, 5 months ago by kochi
Modified:
5 years, 3 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, hayato, rwlbuis, sof
Target Ref:
refs/remotes/origin/master
Project:
blink
Visibility:
Public.

Description

document.querySelector[All]() should check selector context Blink failed to check whether the left-most matched selector ends up in Document TreeScope. The check was only enabled for querySelector*() is called on a regular element, not on document. This issue can be exposed by passing "::shadow" or "/deep/" which pierces shadow boundary and the selector can incorrectly match inside shadow. BUG=511486 TEST=fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201461

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : rebase #

Patch Set 4 : . #

Patch Set 5 : always use scope.context #

Patch Set 6 : . #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -8 lines) Patch
M LayoutTests/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep.html View 1 chunk +6 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt View 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/css/SelectorChecker.cpp View 1 2 3 4 5 2 chunks +3 lines, -5 lines 0 comments Download
M Source/core/dom/SelectorQuery.cpp View 1 2 3 4 1 chunk +2 lines, -3 lines 1 comment Download

Messages

Total messages: 18 (7 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245933002/1
5 years, 5 months ago (2015-07-21 09:38:54 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/71050)
5 years, 5 months ago (2015-07-21 11:09:06 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245933002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245933002/80001
5 years, 3 months ago (2015-08-28 10:12:11 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245933002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245933002/100001
5 years, 3 months ago (2015-08-28 10:16:15 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/97093)
5 years, 3 months ago (2015-08-28 11:38:54 UTC) #10
kochi
Elliott, could you review this?
5 years, 3 months ago (2015-08-28 23:36:44 UTC) #12
esprehn
lgtm, but is scopeContainsLastMatchedElement really needed at all? https://codereview.chromium.org/1245933002/diff/100001/Source/core/dom/SelectorQuery.cpp File Source/core/dom/SelectorQuery.cpp (right): https://codereview.chromium.org/1245933002/diff/100001/Source/core/dom/SelectorQuery.cpp#newcode126 Source/core/dom/SelectorQuery.cpp:126: selectorCheckingContext.scopeContainsLastMatchedElement ...
5 years, 3 months ago (2015-08-29 23:55:30 UTC) #13
kochi
Thanks for the review. On 2015/08/29 23:55:30, esprehn wrote: > lgtm, but is scopeContainsLastMatchedElement really ...
5 years, 3 months ago (2015-08-31 03:31:48 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245933002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245933002/100001
5 years, 3 months ago (2015-08-31 03:32:02 UTC) #16
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://src.chromium.org/viewvc/blink?view=rev&revision=201461
5 years, 3 months ago (2015-08-31 04:42:25 UTC) #17
kochi
5 years, 3 months ago (2015-09-01 02:20:08 UTC) #18
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/1329523002/ by kochi@chromium.org.

The reason for reverting is: This seems to have caused a significant perf
regression.  Reverting.

BUG=526742.

Powered by Google App Engine
This is Rietveld 408576698