Re: [csswg-drafts] [css-zoom?] Zoom and inheritance. (#9397)

The CSS Working Group just discussed `[css-zoom?] Zoom and inheritance. `, and agreed to the following:

* `RESOLVED: font-size is not special wrt zoom`
* `RESOLVED: All computed absolute lengths are zoomed when inheriting`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> emilio: This one is tricky<br>
&lt;fantasai> emilio: mostly due to the way zoom implemented, inheritance behaves really oddly<br>
&lt;fantasai> emilio: webkit and blink have a special case, if you apply zoom to an element<br>
&lt;fantasai> emilio: they zoom inherited font-size but not any other inherited property<br>
&lt;fantasai> emilio: seems the consensus is either zoom all the inherited lengths or we don't zoom any of them<br>
&lt;fantasai> emilio: I think it's clear that ideal behavior is zooming all inherited lengths<br>
&lt;fantasai> emilio: but I am worried, especially about perf cost, when you have lots of tiny elements with zoom<br>
&lt;fantasai> emilio: which I have seen in the wild while working on this<br>
&lt;Rossen_> q?<br>
&lt;fantasai> fantasai: [example of p { font-size: 10px; zoom: 2; } ]<br>
&lt;Rossen_> ack fantasai<br>
&lt;fantasai> fantasai: if inheriting unzoomed font-size, as soon as I put a SPAN in the paragraph, it will have 10px font-size<br>
&lt;fantasai> emilio: that works due to UA magic<br>
&lt;fantasai> emilio: what you inherit is 20px<br>
&lt;fantasai> emilio: if you have a span inside that has zoom as well<br>
&lt;fantasai> emilio: that will get font-size of 20px, instead of 40px as you expect<br>
&lt;fantasai> emilio: right now WebKit and Blink will zoom font-size correctly, but not e.g. line-height<br>
&lt;fantasai> emilio: that's messed up<br>
&lt;chrishtr> q+<br>
&lt;fantasai> emilio: so it's edge-casy but... on the other hand it's unfortunate that it doesn't work<br>
&lt;fantasai> emilio: I'd rather remove the font-size special case<br>
&lt;fantasai> emilio: no property does magic inherited value<br>
&lt;fantasai> emilio: I'd be fine with zooming every inherited length, just concerned about performance<br>
&lt;fantasai> Rossen_: Not understanding perf issue, let's make sure we have at least the right user-expected behavior before considering potential perf<br>
&lt;fantasai> Rossen_: prefer to measure and then discuss<br>
&lt;fantasai> Rossen_: I am unclear with your proposal what would happen to 'em' resolution<br>
&lt;fantasai> emilio: it has no effect from existing behavior<br>
&lt;fantasai> Rossen_: so if I have a 1em height, it'll be 40px or 20px or 10px?<br>
&lt;fantasai> emilio: it would be whatever the font-size is<br>
&lt;fantasai> Rossen_: what do we want to have, from user PoV<br>
&lt;fantasai> emilio: relative lengths reflect final zoomed font-size<br>
&lt;fantasai> Rossen_: I didn't want to make font-size exceptional here<br>
&lt;fantasai> emilio: that's my proposal<br>
&lt;Rossen_> ack chrishtr<br>
&lt;fantasai> chrishtr: I feel like from the user point of view, making it apply to all inherited lengths makes sense<br>
&lt;fantasai> chrishtr: so I do think I would recommend resolving to do all inherited value<br>
&lt;fantasai> chrishtr: if during implementation we come up with an unaviodable perf problem, can discuss again<br>
&lt;fantasai> emilio: I'm ok with that<br>
&lt;fantasai> emilio: can we resolve in any case, don't make font-size special<br>
&lt;fantasai> RESOLVED: font-size is not special wrt zoom<br>
&lt;fantasai> emilio: other issue with chrishtr's proposal to zoom all computed values is<br>
&lt;fantasai> emilio: you need to figure out what to do with all those, whether it's fine if those px values came from relative lengths<br>
&lt;fantasai> emilio: assuming fine, then seems fine<br>
&lt;dholbert> fantasai (IRC): relative lengths are all absolutized before they're inherited<br>
&lt;dholbert> fantasai (IRC): if your font size changes and you wanted ems, then you wanted ems and they'll get converted to absolute size<br>
&lt;dholbert> emilio (IRC): I think it's ok<br>
&lt;dholbert> ScribeNick: dholbert<br>
&lt;Rossen_> ack fantasai<br>
&lt;fantasai> PROPOSED: All computed lengths are zoomed when inheriting<br>
&lt;dholbert> fantasai (IRC): more precisely, when you absolutize a length to make a computed value, you apply a zoom. You have to undo that for getComputedStyle<br>
&lt;dholbert> fantasai (IRC): this is needed for animation to work<br>
&lt;dholbert> emilio (IRC): that's how impls work now<br>
&lt;dholbert> emilio (IRC): tricky thing is when you're inheriting into a thing with a different zoom<br>
&lt;dholbert> emilio (IRC): then you apply the zoom of the thing you're inheriting to on top, and that's this resolution<br>
&lt;dholbert> fantasai (IRC): that seems like the right thing to do<br>
&lt;dholbert> emilio (IRC): i agree from a user perspective. skeptical that we can make it fast but happy to try<br>
&lt;dholbert> chrishtr (IRC): proposed resln is all computed lengths, but we should exclude percentages<br>
&lt;vmpstr> q+<br>
&lt;dholbert> emilio (IRC): all computed absolute lengths, let's say<br>
&lt;Rossen_> ack vmpstr<br>
&lt;dholbert> vmpstr (IRC): concretely, if I have width:100px and zoom:2 and a child that inherits that width, it would inherit 200px?<br>
&lt;dholbert> emilio (IRC): that already happens<br>
&lt;dholbert> emilio (IRC): the issue is when zoom is specified on the child. then what's the width of the child<br>
&lt;dholbert> emilio (IRC): with this resolution, it would be 200<br>
&lt;chrishtr> thanks!<br>
&lt;dholbert> RESOLVED: All computed absolute lengths are zoomed when inheriting<br>
&lt;chrishtr> I don't see the resolution recorded in the issue yet?<br>
</details>


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


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

Received on Wednesday, 29 November 2023 17:42:28 UTC