- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 05 Apr 2023 16:55:31 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `[css-conditional-5][css-nesting-1] Feature detection for nesting`. <details><summary>The full IRC log of that discussion</summary> <fantasai> astearns: Something shipped in Chrome that's not quite what we want, but not clear on what we want<br> <fantasai> ... we should have had a good story before shipping anything<br> <fantasai> TabAtkins: I agree that this being parsable before shipping was ready was a mistake, but I don't think we can fix retroactively<br> <fantasai> ... don't think we should expose whether nesting is possible or not<br> <fantasai> astearns: we shouldn't have feature detection?<br> <fantasai> TabAtkins: we shouldn't add anything except selector detection, it'll just misfire on some versions of Chrome/Safari<br> <fantasai> plinss: wasn't there discussion of using & in other places?<br> <matthieudubet> q+<br> <fantasai> TabAtkins: allowing it elsewhere, yes, but concurrent with Nesting being supported<br> <fantasai> plinss: is that guaranteed?<br> <fantasai> TabAtkins: In practice yes<br> <fantasai> plinss: but it's usable in another feature that's not dependent on Nesting<br> <fantasai> TabAtkins: only @scope, but it's also nesting rules ...<br> <emeyer> fantasai: That’s different from the nesting feature because @scope can only contain nesting rules<br> <fantasai> TabAtkins: don't think ti's a problem in practice<br> <astearns> ack matthieudubet<br> <fantasai> matthieudubet: for feature detection, should we try to give the proper result with a selector<br> <fantasai> s/selector/relative selector/<br> <fantasai> matthieudubet: should @supports be aware of the nesting stack?<br> <plinss> q+<br> <fantasai> matthieudubet: and always return true/false regardless of nesting stack?<br> <fantasai> TabAtkins: the latter. @supports shouldn't be aware of where it is in the stylesheet<br> <TabAtkins> .foo { @supports selector(&) {...}}<br> <fantasai> TabAtkins: that should not give different results at the top level vs nested<br> <fremy> .foo { @supports selector(+a) {...}}<br> <fantasai> matthieudubet: & is allowed both places, but relative selectors are allowed or not depending on whether nested<br> <fantasai> TabAtkins: I would prefer we don't make @supports context-sensitive<br> <fantasai> TabAtkins: right now we don't carry context into the querying APIs, and you can't express that in JS<br> <fantasai> ... so as much as possible I'd like to keep those consistent<br> <fantasai> matthieudubet: Right now for Safari, it does take context into account<br> <fantasai> ... so if the selector is not supported *there* it'll return false<br> <TabAtkins> CSS.supports()<br> <fantasai> TabAtkins: what about CSS.supports()?<br> <fantasai> TabAtkins: the JS API can't know the context<br> <fantasai> matthieudubet: That's what we do for the at-rules. For JS API, we do the same, so when you write a relative one will always say false<br> <fantasai> ... because not in a nested context<br> <fantasai> TabAtkins: that interpretation is novel, and not expressed in the spec right now<br> <fantasai> ... if we want to do that, can you raise an issue?<br> <fantasai> ... new issue, please; this is unrelated to the current issue<br> <fantasai> astearns: It's better to have specific issues on narrow problems<br> <astearns> ack plinss<br> <fantasai> ... so agree we should have a separate issue on whether relative selectors inside @supports are context-sensitive<br> <fantasai> plinss: Important that nesting be readily detectable at the top level<br> <fantasai> ... I have concerns about feature detection of one feature being dependent on another feature<br> <fantasai> ... just because we implemented & and nesting together is cute, but not something to rely on<br> <emilio> But agreed nesting should def. be detectable in top-level and CSS.supports<br> <fantasai> fremy: If you want o feature-detect @scope, how do you do it?<br> <fantasai> plinss: how do I detect & for @scope?<br> <fantasai> TabAtkins: at-supports API doesn't yet allow querying that sort of thing<br> <fantasai> plinss: we need reliable support detection for nesting, that works reliably for @import supports().<br> <fantasai> ... so & detection is not good enough<br> <fantasai> TabAtkins: currently can only express as selector(&), if you want something more specific need a new thing<br> <fantasai> plinss: that needs to ship with Nesting<br> <fantasai> astearns: any suggestion of what this might look like?<br> <fantasai> plinss: @nest?<br> <fantasai> fremy: how about we check whether & is a valid property? That would be checking for nesting<br> <fantasai> ... e.g. @supports (&) { ... }<br> <heycam> @supports rule(p { & { } })<br> <fremy> @supports (&{})<br> <bradk> @supports (nesting) { … }<br> <fantasai> TabAtkins: that's not valid property<br> <fantasai> TabAtkins: maybe not that bad given how messy the shipping has been with this feature, but in general want to avoid special casing<br> <fantasai> plinss: We might want a general feature() function for things that are hard to feature-detect<br> <emeyer> fantasai: I think Francois’s suggestion does fit the current syntax<br> <emeyer> …That said, if we do allow that, we’ll be allowing any kind of selector-based rule that can be nested to be in there<br> <emeyer> …Might be more parsing than we want, but not inconsistent<br> <fantasai> TabAtkins: Depends if you think of it as () parses a declaration or if () parses "stuff that could go in a declaration block"<br> <fantasai> plinss: Would be a problem if we allow selectors, since range of selectors is open-ended<br> <fantasai> ... what if we add a div property<br> <fantasai> fremy: same problem we have today already<br> <fantasai> fremy: To me, I think it's a nice extension, doesn't require a big change<br> <fantasai> ... not saying we have to do it, it's just an idea<br> <fantasai> TabAtkins: can we do the rest of the design work in the thread? we have 9 min on the most important isseu<br> <fantasai> astearns: Sounds to me that for this issue, we're going to retain the bare & supports strategy in the spec, but might also add something that is a little more complex or specific?<br> <fantasai> TabAtkins: think so<br> <fantasai> astearns: so leave discussion here, don't need a resolution since selector(&) aready works<br> <fantasai> ... but will leave this issue open for further discussion of supports functionality<br> <fantasai> plinss: I believe it's very important that we have a stable and reliable mechanism before we ship anything, can we agree on that<br> <fantasai> TabAtkins: I think it's a good idea, I'm not going to commit to it<br> <fantasai> plinss: I think shipping this whithout reliable feature detection is a huge mistake<br> <fantasai> +!<br> <fantasai> +1<br> <fantasai> astearns: agree with plinss<br> <emeyer> +1<br> <bradk> Me too<br> <fantasai> astearns: I think we should have another breakout on Nesting next week<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8399#issuecomment-1497825549 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 5 April 2023 16:55:33 UTC