[csswg-drafts] [css-contain] Computed value of shortcut values (#5511)

Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-contain] Computed value of shortcut values ==
[`contain`](https://drafts.csswg.org/css-contain/#contain-property) has 2 shortcut values, `strict` and `content`:

> **strict**: This value turns on all forms of containment except style containment for the element. In other words, it behaves the same as `contain: size layout paint;`. 
> **content**: This value turns on all forms of containment except size containment and style containment for the element. In other words, it behaves the same as `contain: layout paint;`.

But do they compute to themselves, or do they compute to the expanded list of values?

```js
document.documentElement.style.contain = "content";
getComputedStyle(document.documentElement).contain;
// "content" in both Chromium and Firefox

document.documentElement.style.contain = "layout paint";
getComputedStyle(document.documentElement).contain;
// "content" in Chromium, "layout paint" in Firefox
```

So Chromium expands the shortcuts in the computed value, and when serializing it uses the [shortest serialization principle](https://drafts.csswg.org/cssom/#serializing-css-values)

> If component values can be omitted or replaced with a shorter representation without changing the meaning of the value, omit/replace them.

And in Firefox the specified value computes as-is, so `strict` and `size layout paint` are considered to be different values that just happen to produce the same behavior.

Who is correct? Firefox obeys "Computed value: specified keyword(s)", but "[`contain: content`] behaves the same as `contain: layout paint;`" could be understood to mean that they have to same computed value.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5511 using your GitHub account


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

Received on Monday, 14 September 2020 18:13:44 UTC