- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Mon, 25 Feb 2019 21:29:44 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `Error recovery for :is() and :not()`, and agreed to the following: * `RESOLVED: Drop individual invalid selectors from selector lists in *all* selector functions that take such lists, *except* for :not().` <details><summary>The full IRC log of that discussion</summary> <presenter> Topic: Error recovery for :is() and :not()<br> <astearns> github: https://github.com/w3c/csswg-drafts/issues/3264<br> <presenter> ewilligers: We resolved we'd like to have error-recovery for :is() and :where(), but unsure about :not().<br> <presenter> ewilligers: I have use-cases showing that :not() is used frequently, so we probably don't want to change the meaning.<br> <presenter> ewilligers: Do we want :nth-child() or :nth-last-child() have error-recovery?<br> <presenter> fantasai: nth-child should probably have the same error-recovery as :is()<br> <florian> fantasai: I think it would make more sense with compound, not complex selectors<br> <presenter> fantasai: The big question for nth-child was compound vs complex selectors.<br> <florian> fantasai: people want that<br> <presenter> fantasai: If that makes it easier, would be good. Things like zebra-striping non-hidden rows.<br> <presenter> ewilligers: I think webkit already shipped complex selectors in nth-child<br> <fantasai> s/good/good to get it implemented faster/<br> <fantasai> s/rows/rows is a major use case that's not currently solved otherwise/<br> <presenter> dydz: I'm looking in the WK code<br> <presenter> fantasai: Emilio asked why we need selectors in :nth-child()<br> <presenter> fantasai: Say we have a list of items, I want to color their backgrounds alternating<br> <presenter> fantasai: But some of them are hidden; they're display:none<br> <presenter> fantasai: Counting is based on sibling list. If you hide 3rd one, 2nd and 4th will both have the same color<br> <presenter> fantasai: So want to count after filtering<br> <presenter> emilio: Whew, that's gonna be slow. We have a lot of caching already to make :nth-of-type() fast.<br> <presenter> ewilligers: I confirmed that Safari supports :nth-child(even of div+div)<br> <presenter> fantasai: My main concern is if other impls are more likely to implement without complex selectors, getting even compound-selector interop would still be great.<br> <presenter> emilio: I think impl-wise, not supporting complex selectors is easier.<br> <presenter> TabAtkins: Unless we recursively pass down the compound-only restriction into :is()/etc, you're at full power anyway.<br> <presenter> fantasai: Maybe that's reasonable to have that sort of restriction.<br> <tantek> agreed. reasonable restriction<br> <presenter> emilio: Did we decide on how the new error recovery behavior serializes.<br> <fantasai> fantasai: We'll just say Safari supports L5 of selectors, and L4 doesn't accept combinators<br> <presenter> emilio: Did we decide about serialization of invalid selectors in :is()?<br> <presenter> TabAtkins: I didn't think we were doing anything in particular?<br> <presenter> ewilligers: I thought we'd just drop them.<br> <presenter> emilio: What if they're all invalid?<br> <presenter> ewilligers: You just get :is(). A little weird with :nth-child(even of), tho.<br> <presenter> ewilligers: What about parsing of weird stuff? Extra close brackets, what happens?<br> <presenter> TabAtkins: Syntax already handles brackets correctly. We just split the tokens on top-level commas, then interpret each chunk as a selector.<br> <presenter> fantasai: So back to the issue: :is() and :not() take a list of selectors<br> <presenter> fantasai: Currently any invalid selector invalidates the entire selector list.<br> <presenter> fantasai: Because we now have these functional notations that creates some scoping, within :is() we can just ignore in the invalid selector, but still process the rest.<br> <presenter> fantasai: So we're gonna resolve that within :is(), we ignore invalid selectors.<br> <presenter> ewilligers: And :where(), :nth-child(), :has(), etc.<br> <presenter> fantasai: But not in :not() - the whole thing will invalidate if any are any invalid.<br> <presenter> gregwhitworth: I think it's weird to have :not() work different. I get the %s making it hard tho.<br> <presenter> AmeliaBR: I do use :not() as an @supports for new selectors...<br> <fantasai> AmeliaBR: e.g. :not(:valid) means you support :valid, and this selector selects things that are not valid<br> <presenter> TabAtkins: I was going over the boolean logic for :not() invalidating just parts too this morning, and was getting really confused...<br> <presenter> RESOLVED: Drop individual invalid selectors from selector lists in *all* selector functions that take such lists, *except* for :not().<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3264#issuecomment-467190906 using your GitHub account
Received on Monday, 25 February 2019 21:29:45 UTC