Re: [csswg-drafts] [css-conditional] testing support of properties and values with partial implementations (#3559)

The CSS Working Group just discussed `[css-conditional] testing support of properties and values with partial implementations`, and agreed to the following:

* `RESOLVED: adopt keyword based feature queries, with names to be bikeshedded later, with the expectation that we will use them rarely and test and message their addition carefully`
* `RESOLVED: Add a keyword for alignment on blocks, with the specific name TBD`

<details><summary>The full IRC log of that discussion</summary>
&lt;flackr> dbaron: one of the design goals of @supports is we don't want to require impls to maintain large sets of data about what is supported that's separate from the code which supports the thing<br>
&lt;flackr> dbaron: in the past doing this tends to result in them getting out of sync<br>
&lt;flackr> dbaron: so we originally defined it in terms of property syntax being accepted, and is in sync with a certain definition of whether features are supported<br>
&lt;Rossen_> q?<br>
&lt;flackr> dbaron: @supports has not been very effective for certain types of interactions, e.g. a propery that was once only supported on flexbox being supported elsewhere<br>
&lt;flackr> dbaron: people have wanted a syntax for these sorts of interactions in a general way. There's no proposal for a general syntax that satisfies the original design constraint<br>
&lt;flackr> dbaron: The proposal I put in the issue, is that we don't try to solve this generally, but add a solution that we use in rare cases where we feel it's important with one-off keywords<br>
&lt;flackr> dbaron: I propose calling this a feature function where we add a keyword for a particular interaction<br>
&lt;flackr> dbaron: The idea is we'll use this rarely, e.g. 1 per year is okay, 1 per month is probably too much<br>
&lt;florian> q+<br>
&lt;emilio> q+<br>
&lt;flackr> dbaron: I'd like feedback on the general idea, we can bikeshed names<br>
&lt;Rossen_> ack florian<br>
&lt;oriol> q+<br>
&lt;flackr> florian: one of the other reasons for original design constraint is not just that they might eventually get out of sync but could initially be out of sync if the detection is done independently<br>
&lt;flackr> florian: you might do one and forget to do the other<br>
&lt;flackr> florian: this problem remains with the alternate proposal, as you might forget to add the detector<br>
&lt;flackr> dbaron: I agree this is a concern, this is part of the reason we want to do it rarely and have process / tests to make sure we don't forget<br>
&lt;Rossen_> ack emilio<br>
&lt;flackr> emilio: I agree with the concern, but having an escape hatch for this makes sense.<br>
&lt;rachelandrew> q+<br>
&lt;flackr> emilio: the thing florian mentioned has also happened in reverse accidentally, e.g. shipping &amp; selector before nesting support??<br>
&lt;flackr> emilio: having this general one-off escape hatch makes sense<br>
&lt;Rossen_> ack oriol<br>
&lt;flackr> oriol: i'm not a big fan, these features when they're used will assumed to be false initially and become true and authors will stop checking them. But it's something we'll add to the platform and will need to keep these checks even though they're sort of obsolete after a while<br>
&lt;flackr> oriol: this is an ongoing cost needing to keep around<br>
&lt;Rossen_> ack rachelandrew<br>
&lt;bkardell_> q+<br>
&lt;flackr> rachelandrew: I quite like this. In an ideal world we'd have a more general thing, but this doesn't come up often. This feels like a pragmatic solution to an edge case that comes up once in a while.<br>
&lt;flackr> rachelandrew: this gets developers what they need / are asking for.<br>
&lt;flackr> rachelandrew: it's also easy to explain to devs<br>
&lt;bramus> +1 to what rachelandrew said there.<br>
&lt;flackr> bkardell_: it feels pragmatic and easy enough to explain if it's like what dbaron said where we have maybe 1/year. I feel like this is the max. If more, this feels like it's not a good solution and we need to find the more general way<br>
&lt;flackr> bkardell_: i'd really like to find the general solution as this is only a part of the issue<br>
&lt;SebastianZ> q+<br>
&lt;flackr> bkardell_: people want to detect all manner of things<br>
&lt;Rossen_> ack bkardell_<br>
&lt;flackr> bkardell_: e.g. you should be able to do custom media queries<br>
&lt;florian> q+<br>
&lt;Rossen_> ack SebastianZ<br>
&lt;flackr> SebastianZ: when we introduce such keywords we should also make clear these features need to ship together with the keywords, clearly stated in the spec<br>
&lt;Rossen_> ack florian<br>
&lt;noamr> q+<br>
&lt;flackr> florian: I think it's interesting bkardell_ mentioned media queries, this might be the generic solution to not solve it directly, but detect the behavior of the feature<br>
&lt;flackr> florian: we could make all sorts of changes that might need to be tested, and could be exposed through a JS media query<br>
&lt;flackr> florian: there might be a commonly used library which exposes a set of features needed<br>
&lt;bkardell_> q+<br>
&lt;flackr> florian: I am concerned about the ability to become out of sync and start of sync, not objecting though<br>
&lt;iank_> fwiw libraries already use JS tests then add classes on html element to say if a particular feature "works"<br>
&lt;bkardell_> if some of those are _very_ common then a solution like this could still work - so I don't think they are mutually exclusive where we know there is a specific/popular one like this necessarily<br>
&lt;flackr> noamr: custom media queries doesn't add much relative to performing the test and putting a class or data attribute on the root element<br>
&lt;Rossen_> ack noamr<br>
&lt;flackr> noamr: in general if your test is some JS which deals with the document, maybe the whole feature belongs in userspace<br>
&lt;flackr> noamr: the user defines it in their own way and doesn't seem to be a web platform feature<br>
&lt;Rossen_> ack bkardell_<br>
&lt;flackr> bkardell_: I don't think they're mutually exclusive ideas<br>
&lt;flackr> bkardell_: I think we should add a mechanism where people can do this in author space and we can decide to add the occasional extremely common one<br>
&lt;Rossen_> ack dbaron<br>
&lt;flackr> dbaron: responding to using data from what authors are doing, we would be doing the addition too late and it would be out of sync. I see this for cases where we know ahead of time that it's going to be a big deal<br>
&lt;florian> +1 to dbaron<br>
&lt;bkardell_> ok<br>
&lt;flackr> Rossen_: i'm hearing general support with some concerns with how many we'll have, any other comments/concerns?<br>
&lt;chrishtr> q+<br>
&lt;flackr> fantasai: a common pattern is property X adds to display type Y, we should have a consistent pattern for representing these cases to avoid each being slightly diff when introduced<br>
&lt;Rossen_> ack chrishtr<br>
&lt;flackr> chrishtr: The proposed resoltion is dbaron's latest comment, right?<br>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/3559#issuecomment-1868169502<br>
&lt;flackr> chrishtr: adding a custom keyword specific to quirk? assuming so, do we know of any case we can put in the spec as a first example?<br>
&lt;flackr> dbaron: I think the first example would be support for alignment property on blocks, as this is a thing we're talking about doing soon that has this concern<br>
&lt;dholbert> q+<br>
&lt;flackr> chrishtr: how about we add this to the resolution with candidate wording?<br>
&lt;SebastianZ> q+<br>
&lt;flackr> fantasai: I think we should have 2 resoluitons, one for keyword based resoluiton and one for align on block<br>
&lt;flackr> fantasai: for align on blocks, i want to make sure we have a consistent pattern<br>
&lt;chrishtr> @supports (align-content-block-flow)<br>
&lt;flackr> dbaron: I'd like to make these two resolutions and have further discussion to bikeshed the names<br>
&lt;Rossen_> ack dholbert<br>
&lt;fantasai> align-content-on-block<br>
&lt;flackr> dholbert: one q, this proposal lets authors opt in to using css alignment on blocks, but i don't know if it fixes some site that sets * { align-content: center; } and that suddenly starts applying to everything<br>
&lt;flackr> dholbert: do we have a similar proposal to address this?<br>
&lt;flackr> dholbert: it seems like we may need both in order for these sorts of changes to be shippable<br>
&lt;iank_> fwiw we've blocked rolling out align-content:center due to some compat issues with large existing sites.<br>
&lt;flackr> dbaron: I agree it doesn't address this problem, we need to find out whether this will be a problem<br>
&lt;Rossen_> ack SebastianZ<br>
&lt;flackr> SebastianZ: I also had a proposal for custom support queries. I'll create a separate issue for this for discussion. I don't want to derail though<br>
&lt;flackr> Rossen_: dbaron can you summarize resolution?<br>
&lt;flackr> Proposed resoluiton: To adopt keyword based feature queries with names to be bikeshedded later.<br>
&lt;flackr> Rossen_: one of the main concerns was how we keep this to a small number, do we want to capture this in the resolution?<br>
&lt;flackr> iank_: FWIW, it'll be clear when this adds value vs not. These will only have value for a couple of years. What most devs use is modernizr library which have queries for e.g. old grid vs new grid<br>
&lt;flackr> iank_: i suspect we can address this on a case by case basis<br>
&lt;flackr> iank_: currently for us we blocked align on blocks due to breaking some sites<br>
&lt;dbaron> s/align/align-content/<br>
&lt;flackr> iank_: i'm okay with general idea. we'll hear from web devs when this will make their lives easier but we shouldn't add this for every sub feature we roll out<br>
&lt;flackr> Rossen_: I propose let's keep a low number and see if we can agree on this<br>
&lt;flackr> florian: I think there's enough people concerned that we won't be tempted to do this too oftenn<br>
&lt;flackr> Rossen_: is 2 the right number?<br>
&lt;dbaron> Proposed resolution: adopt keyword based feature queries, with names to be bikeshedded later, with the expectation that we will use them rarely and test and message their addition carefully<br>
&lt;flackr> RESOLVED: adopt keyword based feature queries, with names to be bikeshedded later, with the expectation that we will use them rarely and test and message their addition carefully<br>
&lt;dbaron> (I think Rossen maybe wanted &lt;2/year in the resolution?)<br>
&lt;flackr> s/with the expectation that we will use them rarely/less than 2 per year<br>
&lt;flackr> RESOLVED: Add a keyword for alignment on blocks, with the specific name TBD<br>
&lt;flackr> Rossen_: SebastianZ please go ahead and open the issue you mentioned and we can open an issue for names<br>
&lt;flackr> dbaron: separate issue?<br>
&lt;flackr> Rossen_: if it's going to turn into a thing it will be helpful<br>
&lt;flackr> dbaron: sure<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3559#issuecomment-1885332213 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 10 January 2024 17:45:58 UTC