New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CustomStateSet and :state() selector #20012
Conversation
6f53614
to
6c736b2
Compare
|
EWS run on previous version of this PR (hash 6c736b2)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add a special case at: https://searchfox.org/wubkat/rev/023c54054092dc68c5df3b230ed3137cbd753b16/Source/WebCore/css/parser/CSSSelectorParser.cpp#743-763
Otherwise, :state with no argument won't be rejected.
|
There should be the but title right above it.
Please insert a line break after 100 characters or so. |
6c736b2
to
7465195
Compare
|
EWS run on previous version of this PR (hash 7465195)
|
LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-state.html
Outdated
Show resolved
Hide resolved
|
We should add a test for invalidating |
7465195
to
c0b9fb8
Compare
|
EWS run on previous version of this PR (hash c0b9fb8)
|
c0b9fb8
to
59572bc
Compare
|
EWS run on previous version of this PR (hash 59572bc)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do a WPT resync of custom-elements/ and custom-state-pseudo-class separately ? I think it'll make it easier for you to export, and it's easier to review generally since it's clear which ones are new tests.
59572bc
to
b91a03b
Compare
|
EWS run on previous version of this PR (hash b91a03b)
|
b91a03b
to
b7014c8
Compare
|
EWS run on previous version of this PR (hash b7014c8)
|
b7014c8
to
150ba3f
Compare
|
EWS run on previous version of this PR (hash 150ba3f)
|
150ba3f
to
ad2d21b
Compare
19ba7cc
to
5ca372f
Compare
|
EWS run on previous version of this PR (hash 5ca372f)
|
...ests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class.html
Outdated
Show resolved
Hide resolved
5ca372f
to
05af113
Compare
|
EWS run on previous version of this PR (hash 05af113)
|
05af113
to
4c409a8
Compare
|
EWS run on previous version of this PR (hash 4c409a8)
|
4c409a8
to
e495b9d
Compare
|
EWS run on current version of this PR (hash e495b9d)
|
https://bugs.webkit.org/show_bug.cgi?id=215911 Reviewed by Tim Nguyen. This adds the CustomStateSet idl definitions, and the `states` getter in the ElementInternals IDL. The gatter laziliy initialises a CustomStateSet object in ElementRareData which behaves like a setlike<DOMString>. This also adds the `:state()` pseudo selector, which can take an ident and matches when the ident matches one of the given states in the CustomStateSet for the element. Any states set by CustomStateSet need to invalidate styles for the element, so the `:state()` pseudo can match. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/state-in-has-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/state-in-has.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-state-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states.html: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class.html: * LayoutTests/imported/w3c/web-platform-tests/custom-state-pseudo-class/custom-state-set-strong-ref.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-state-pseudo-class/idlharness.window-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-state-pseudo-class/state-css-selector-shadow-dom.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-state-pseudo-class/state-css-selector-shadow-dom.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-state-pseudo-class/state-css-selector.tentative-expected.txt: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/CMakeLists.txt: * Source/WebCore/DerivedSources-input.xcfilelist: * Source/WebCore/DerivedSources-output.xcfilelist: * Source/WebCore/DerivedSources.make: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: * Source/WebCore/css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * Source/WebCore/css/CSSSelector.h: * Source/WebCore/css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in: * Source/WebCore/css/parser/CSSParserContext.cpp: (WebCore::add): * Source/WebCore/css/parser/CSSParserContext.h: * Source/WebCore/css/parser/CSSSelectorParser.cpp: (WebCore::isOnlyPseudoClassFunction): (WebCore::CSSSelectorParser::consumePseudo): * Source/WebCore/css/parser/CSSSelectorParserContext.cpp: (WebCore::CSSSelectorParserContext::CSSSelectorParserContext): (WebCore::add): * Source/WebCore/css/parser/CSSSelectorParserContext.h: * Source/WebCore/cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): * Source/WebCore/dom/CustomStateSet.cpp: Added. (WebCore::CustomStateSet::addToSetLike): (WebCore::CustomStateSet::removeFromSetLike): (WebCore::CustomStateSet::clearFromSetLike): (WebCore::CustomStateSet::has): * Source/WebCore/dom/CustomStateSet.h: Added. * Source/WebCore/dom/CustomStateSet.idl: Added. * Source/WebCore/dom/Element.cpp: (WebCore::Element::hasCustomState const): (WebCore::Element::ensureCustomStateSet): * Source/WebCore/dom/Element.h: * Source/WebCore/dom/ElementInternals.cpp: (WebCore::ElementInternals::states): * Source/WebCore/dom/ElementInternals.h: * Source/WebCore/dom/ElementInternals.idl: * Source/WebCore/dom/ElementRareData.cpp: * Source/WebCore/dom/ElementRareData.h: (WebCore::ElementRareData::customStateSet): (WebCore::ElementRareData::setCustomStateSet): (WebCore::ElementRareData::useTypes const): * Source/WebCore/dom/NodeRareData.h: Canonical link: https://commits.webkit.org/271600@main
e495b9d
to
59cb7cb
Compare
|
Committed 271600@main (59cb7cb): https://commits.webkit.org/271600@main Reviewed commits have been landed. Closing PR #20012 and removing active labels. |
59cb7cb
e495b9d
π§ͺ wpe-wk2π§ͺ ios-wk2π§ͺ api-macπ§ͺ ios-wk2-wptπ§ͺ mac-wk1π π§ͺ jscπ§ͺ api-iosπ§ͺ mac-wk2π§ͺ gtk-wk2π π§ͺ jsc-arm64π tvπ§ͺ mac-wk2-stressπ watch-sim