contain 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?
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
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 content and 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 the same computed value.
containhas 2 shortcut values,strictandcontent:But do they compute to themselves, or do they compute to the expanded list of values?
So Chromium expands the shortcuts in the computed value, and when serializing it uses the shortest serialization principle
And in Firefox the specified value computes as-is, so
contentandlayout paintare 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 ascontain: layout paint;" could be understood to mean that they have the same computed value.