Re: [csswg-drafts] [css-values] Add a way to set longhands to the corresponding expansion of a shorthand value (#8055)

The CSS Working Group just discussed `[css-values] Add a way to set longhands to the corresponding expansion of a shorthand value`, and agreed to the following:

* `RESOLVED: Start drafting a solution in css-values-5`

<details><summary>The full IRC log of that discussion</summary>
&lt;oriol> https://docs.google.com/presentation/d/1HJoIC-RFcPjFjSzjYOW440bqESXGs2CqVbwTxzRqX-0/edit?slide=id.p1#slide=id.p1<br>
&lt;emilio> oriol: [presents slides, similar as the issue]<br>
&lt;emilio> q+<br>
&lt;astearns> Zakim, open queue<br>
&lt;Zakim> ok, astearns, the speaker queue is open<br>
&lt;astearns> q+ emilio<br>
&lt;emilio> (FWIW the servo representation of this is basically identical: https://searchfox.org/firefox-main/rev/150ca809c7243bd6e994f28cc4a3750430783364/servo/components/style/properties/mod.rs#1400)<br>
&lt;lea> q?<br>
&lt;flackr> q+<br>
&lt;astearns> q+<br>
&lt;emilio> astearns: what's the other issue?<br>
&lt;emilio> oriol: #11055<br>
&lt;emilio> emilio: Q: should this have the same "unparsed value" semantics as variables? I.e. should `margin-top: from-shorthand(margin: garbage);` be invalid at parse time?<br>
&lt;astearns> ack emilio<br>
&lt;lea> +1, love this<br>
&lt;emilio> emilio: generally supportive<br>
&lt;emilio> ... would this be only valid as a whole declaration value?<br>
&lt;emilio> ... also, does this have the same semantics as var()? I.e. IACVT?<br>
&lt;emilio> ... also, any example for the "shorthand with bigger value space than longhands"?<br>
&lt;emilio> oriol: re the later, -webkit-background-clip: text vs background-clip used to be an issue<br>
&lt;emilio> ... re. whole value, yes, can't mix it around<br>
&lt;astearns> ack flackr<br>
&lt;emilio> ... re. var(), no strong opinion<br>
&lt;emilio> flackr: does this need to be writing-mode aware? e.g. if you try to set a logical value from a longhand or so?<br>
&lt;emilio> oriol: currently the margin longhands only expands to the physical ones<br>
&lt;emilio> ... so it kind of avoids this problem<br>
&lt;emilio> ... don't want to introduce lots of complexity with this<br>
&lt;emilio> ... in the issue kbabbitt was asking whether from-shorthand() should track exactly the value that was set to the shorthand even if parts of it are irrelevant. I'm fine not tracking the value exactly<br>
&lt;emilio> ... whatever is easier is fine with me<br>
&lt;emilio> q+<br>
&lt;emilio> ... not trying to make things very complex<br>
&lt;emilio> flackr: let me give a specific example<br>
&lt;emilio> ... if you try to set `margin-top: from-shorthand(margin-block: ...)`, is that invalid?<br>
&lt;emilio> oriol: it would be cause `margin-top` is not a longhand of `margin-block`<br>
&lt;emilio> flackr: thanks I think that answers my question, so it'd be syntactically invalid<br>
&lt;astearns> ack dbaron<br>
&lt;emilio> dbaron: generally supportive of this, a bunch of details that need to be taken care of, gonna ask about them<br>
&lt;emilio> ... some of them need to happen at specified-value time<br>
&lt;emilio> ... i.e. when you look at the specified value to margin-left the only way to represent that is using this thing<br>
&lt;emilio> ... so we have to generate it at specified-value time in a bunch of cases<br>
&lt;emilio> ... one comment is that we need to be very clear about what those cases are<br>
&lt;emilio> ... we've had this happen in other cases like the initial keyword<br>
&lt;emilio> ... in which different impls you could generate the initial value even if not strictly necessary<br>
&lt;emilio> ... I tend to think we should tend to minimize them<br>
&lt;emilio> ... but I feel less strongly about that<br>
&lt;emilio> ... also we need to be clear about when this is processed<br>
&lt;emilio> ... i.e. do we need this two phase thing where we could process some at specified value time, and others at computed-value time<br>
&lt;emilio> ... I _think_ we should deal with this as specified-value time<br>
&lt;emilio> ... when possible<br>
&lt;emilio> ... but also not feeling super-strongly<br>
&lt;emilio> oriol: Re. the first we should probably restrict it to the cases where browsers right now have to serialize to the empty string<br>
&lt;emilio> ... re. the second I don't feel strongly either way<br>
&lt;emilio> astearns: I don't think merely specifying that you use this new thing where we are serializing to empty string is likely to be sufficient<br>
&lt;emilio> ... there might be different cases where browsers do different things<br>
&lt;emilio> ... and specify exactly what happens<br>
&lt;emilio> ... so that we can get those corner cases down<br>
&lt;emilio> ... the other things that in this discussion is that I think this always goes away at specified-value time<br>
&lt;emilio> dbaron: yeah it does always go away at computed-value time<br>
&lt;astearns> s/specified-value time/computed-value time/<br>
&lt;emilio> ... but when you write something like `margin-left: from-shorthand(margin: 1px)` we could simplify to 1px<br>
&lt;emilio> astearns: the other thing is author using it not as intended<br>
&lt;emilio> ... I think people could misuse it<br>
&lt;astearns> q?<br>
&lt;astearns> ack astearns<br>
&lt;emilio> ... though I like the round-tripping<br>
&lt;emilio> oriol: in some cases it could stay in the computed value, so re. background-clip: text it should serialize in the computed value<br>
&lt;emilio> ... re the second one if it's useful why not, even if it's a bit hacky<br>
&lt;emilio> astearns: I don't have any specific ideas off hand<br>
&lt;astearns> ack emilio<br>
&lt;emilio> ... just thinking we should not add something that we didn't intend<br>
&lt;fantasai> scribe+<br>
&lt;fantasai> emilio: I don't think we should take `background-clip: text` as a precedent. Assume it goes away at specified value time.<br>
&lt;fantasai> emilio: The fact that it wasn't representable in `background-clip` was an obvious mistake.<br>
&lt;fantasai> emilio: The other thing, at least in Gecko, when this happens as a result of variables, you need to avoid reparsing the shorthand over and over<br>
&lt;fantasai> emilio: They all get processed at variable substitution time.<br>
&lt;fantasai> emilio: I think it's less of a concern for the cases dbaron was mentioning.<br>
&lt;fantasai> emilio: For simplicity's sake, if trying to keep this minimal, ...<br>
&lt;fantasai> emilio: Taking to extreme, restrict only cases where there are variables inside, so only existing unparsed values.<br>
&lt;fantasai> emilio: I would lean towards processing this at the same stage<br>
&lt;fantasai> emilio: I cannot think of many use cases for doing this intentionally as an author, other than variable substitution.<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> scribe+<br>
&lt;emilio> fantasai: q from our team is what real world problems does this solve?<br>
&lt;emilio> ... are people actually running into this problem<br>
&lt;emilio> astearns: there are bugs filed on this on browsers<br>
&lt;emilio> oriol: yeah andruud's issue came from a crbug from a developer<br>
&lt;emilio> ... so probably not the most frequent issue, but annoying for authors<br>
&lt;lea> I'd argue that any use case involving CSSStyleDeclaration is affected by this<br>
&lt;emilio> fantasai: will take that back to the team, thanks<br>
&lt;emilio> astearns: should we resolve on working on this?<br>
&lt;emilio> +1<br>
&lt;emilio> PROPOSED: Start drafting a solution in css-values-5<br>
&lt;emilio> RESOLVED: Start drafting a solution in css-values-5<br>
</details>


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


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

Received on Wednesday, 18 February 2026 17:28:52 UTC