-
Notifications
You must be signed in to change notification settings - Fork 711
[css-scoping] [selectors] <compound-selector-list> should somehow affect :is() / :where() parsing #5093
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
Comments
Maybe |
This may also be an issue for pseudo-elements, so |
Also, should I think probably yes (but matches nothing). |
https://bugs.webkit.org/show_bug.cgi?id=232434 Reviewed by Dean Jackson. LayoutTests/imported/w3c: * web-platform-tests/css/css-scoping/slotted-parsing-expected.txt: Source/WebCore: Any subselectors that are not legal in the context will be removed by the forgiving parsing. This matches the behavior in other engines and the discussion in w3c/csswg-drafts#5093. The validity check is moved from the compound selector level to the simple selector level. This way if we are inside forgiving selector list parsing, it can recover and continue. * css/parser/CSSSelectorParser.cpp: (WebCore::isLogicalCombinationPseudoClass): (WebCore::isPseudoClassValidAfterPseudoElement): (WebCore::isSimpleSelectorValidAfterPseudoElement): :is(), :where(), and so on are always legal but their content is necessarily not. (WebCore::CSSSelectorParser::consumeCompoundSelector): Set the preceding pseudo-element as parser state. (WebCore::CSSSelectorParser::consumeSimpleSelector): Check if the pseudo-class or pseudo-element is valid immediately after consuming it. (WebCore::CSSSelectorParser::consumePseudo): Disallow nesting in all cases. (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::DisallowPseudoElementsScope): Deleted. (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::~DisallowPseudoElementsScope): Deleted. Just use SetForScope. * css/parser/CSSSelectorParser.h: Canonical link: https://commits.webkit.org/243697@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232434 Reviewed by Dean Jackson. LayoutTests/imported/w3c: * web-platform-tests/css/css-scoping/slotted-parsing-expected.txt: Source/WebCore: Any subselectors that are not legal in the context will be removed by the forgiving parsing. This matches the behavior in other engines and the discussion in w3c/csswg-drafts#5093. The validity check is moved from the compound selector level to the simple selector level. This way if we are inside forgiving selector list parsing, it can recover and continue. * css/parser/CSSSelectorParser.cpp: (WebCore::isLogicalCombinationPseudoClass): (WebCore::isPseudoClassValidAfterPseudoElement): (WebCore::isSimpleSelectorValidAfterPseudoElement): :is(), :where(), and so on are always legal but their content is necessarily not. (WebCore::CSSSelectorParser::consumeCompoundSelector): Set the preceding pseudo-element as parser state. (WebCore::CSSSelectorParser::consumeSimpleSelector): Check if the pseudo-class or pseudo-element is valid immediately after consuming it. (WebCore::CSSSelectorParser::consumePseudo): Disallow nesting in all cases. (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::DisallowPseudoElementsScope): Deleted. (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::~DisallowPseudoElementsScope): Deleted. Just use SetForScope. * css/parser/CSSSelectorParser.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@285054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@fantasai checked in an edit to fix this:
Just need CSSWG thumbs-up for the edit. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> TabAtkins: Summary is after some discussion across a few related issues, basic idea is logical combo pseudos that combine things together passes down any restrictions the outer pseudo is in<fantasai> :is(), :where(), and :not() are the set in question <dael> TabAtkins: You can use is in a compund context, but it has to be compound too. That way you can't smuggle in a more complicated selector <dael> TabAtkins: Have spec text. Need approval <TabAtkins> also :nth-child() i think <dael> astearns: Text is in last comment. seems good to me <dael> astearns: Other opinions? <dael> astearns: Prop: Accept this restriction and the edit that defines it <dael> fantasai: Kind of more of an expansion. Previously only allowed some things and adds :is and :where <dael> TabAtkins: Lot of places where they were allowed but could contain whatever. But doesn't matter <dael> astearns: Prop: Accept the edit <dael> astearns: Obj? <dael> RESOLVED: Accept the edit |
…here() Based on spec discussion: w3c/csswg-drafts#5093
…here() Based on spec discussion: w3c/csswg-drafts#5093
https://drafts.csswg.org/css-scoping/#host-selector takes a
<compound-selector-list>
(that is, doesn't accept combinators). This is good, as otherwise it'd break the shadow tree encapsulation.However strictly per the syntax technically something like
:host(:is(div div))
should parse. I think this is a spec bug.The text was updated successfully, but these errors were encountered: