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

Issue 1587643004: Restrict use of pseudo elements within compound. (Closed)

Created:
4 years, 11 months ago by rune
Modified:
4 years, 11 months ago
Reviewers:
Timothy Loh
CC:
chromium-reviews, blink-reviews-css, dglazkov+blink, apavlov+blink_chromium.org, darktears, blink-reviews, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@valid-selectors
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Restrict use of pseudo elements within compound. Start dropping selectors whose compound have pseudo elements followed by other simple selectors with the exception of simple selectors which are actually allowed to follow certain pseudo elements. The exceptions are: - User action pseudo classes and their negations for custom pseudo elements. Matching other simple selectors on custom elements worked before, but that revealed the inner structure of the UA shadow DOM for form elements, which I believe was not intentional. According to the latest ED of Selectors Level 4, user action pseudo classes are allowed after pseudo elements in general, but we don't support that, so the selector should be dropped. Gecko also drops those selectors. - A restricted set of pseudo classes, in addition to the user action pseudo classes, which apply to custom scrollbar pseudo elements. The new restrictions do not yet apply to UA stylesheets as we rely on invalid selectors in the UA stylesheet for media controls. Fixed a couple of range-based iterations in the unit test. This CL does not address the fact that pseudo elements, in most cases, only may be present in rightmost compound selectors. That will be fixed in another CL. R=timloh@chromium.org BUG=489481, 577404 Committed: https://crrev.com/d525c3859d9fe0624112f3c1c753ee2207bee121 Cr-Commit-Position: refs/heads/master@{#369760}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebased #

Patch Set 3 : Added more :not() tests #

Patch Set 4 : Workaround for invalid selectors in UA style. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -17 lines) Patch
M third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-css-text.html View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-css-text-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserSelector.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp View 1 2 3 1 chunk +87 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp View 1 2 3 4 chunks +66 lines, -15 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
rune
4 years, 11 months ago (2016-01-14 11:34:05 UTC) #1
Timothy Loh
lgtm https://codereview.chromium.org/1587643004/diff/1/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp File third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp (right): https://codereview.chromium.org/1587643004/diff/1/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp#newcode187 third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp:187: }; Can we also add some tests with ...
4 years, 11 months ago (2016-01-15 04:22:57 UTC) #2
rune
On 2016/01/15 04:22:57, Timothy Loh wrote: > lgtm > > https://codereview.chromium.org/1587643004/diff/1/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp > File third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp > ...
4 years, 11 months ago (2016-01-15 15:14:05 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1587643004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1587643004/60001
4 years, 11 months ago (2016-01-15 15:14:50 UTC) #6
rune
@timloh: I had to drop the restrictions for UA stylesheets since the UA stylesheet for ...
4 years, 11 months ago (2016-01-15 15:30:19 UTC) #8
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 11 months ago (2016-01-15 16:23:21 UTC) #10
commit-bot: I haz the power
4 years, 11 months ago (2016-01-15 16:24:22 UTC) #12
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d525c3859d9fe0624112f3c1c753ee2207bee121
Cr-Commit-Position: refs/heads/master@{#369760}

Powered by Google App Engine
This is Rietveld 408576698