Re: [csswg-drafts] [css-ui] Clarify scope of implementation-defined behavior for native appearance (and primitive appearance) (#9919)

> I think @fantasai mentioned that width and height are always defined to be the used value in CSSOM, which is what makes it special in this case.

The resolution is about the [computed value](https://drafts.csswg.org/css-cascade-3/#computed), not about the used value, nor about the result of the [getComputedStyle()](https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle) method, which, confusingly, [doesn't always return computed values](https://drafts.csswg.org/cssom/#resolved-values).

Conceptually, the same arguments could apply to the used value as well, but the discussion didn't explore that too much, and there was a sense that this may be more challenging from an implementation point of view, so that is currently left undefined.

> It would be misleading if the size wasn't reflected in this case in the computed style

```html
<style>span { width: 3px; }</style>
<span id=test>supercallifragilisticexpialidocious</span>
<script>console.log(getComputedStyle(test).width);</script>
```
This will yield "3px", even thought the span is bigger then 3px, because `width` and `height` don't apply to non-replaced inlines. Same thing here.

> it's not unreasonable for system frameworks to force a different layout and reflect that in the computed style?

The idea is that it's not always doable when you're choosing to have a non-css based appearance, so we should not try to reflect the value even if we could do it some of the time. Let's say that the border property has been set to `3px solid black`, but your widget looks like this: 
![aqua](https://github.com/w3c/csswg-drafts/assets/113268/848d4a94-755c-4d91-82f0-8923479c1fab)
Or maybe it has a border that looks like that:
![candycane](https://github.com/w3c/csswg-drafts/assets/113268/f782db5d-972c-4e3d-a898-d92d03f27007)
There's no value you can put in the `border` property that will do this. So you leave the property's value be `3px solid black`, you ignore it, and you paint the lovely eye candy. If instead if your native appearance happens to have a 5px solid purple border, you don't pipe that back into the property just because this one could be represented in CSS. If you're doing something custom that's different from what the author asked, you're doing something different, and it's not reflected back.




-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9919#issuecomment-1956091926 using your GitHub account


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

Received on Wednesday, 21 February 2024 08:07:05 UTC