[csswg-drafts] Are the rules for interactions of transforms and backgrounds on the root element what we want? (#6683)

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

== Are the rules for interactions of transforms and backgrounds on the root element what we want? ==
In https://github.com/web-platform-tests/wpt/pull/30946 I just wrote some tests for backgrounds on the root element when the root element has a transform.  Both interoperability and conformance to the current specification are poor.  I think it's perhaps worth considering whether the specification says what we want it to say.

In particular, [the transforms spec says](https://www.w3.org/TR/css-transforms-1/#transform-rendering):

> Fixed backgrounds on the root element are affected by any transform specified for that element. For all other elements that are effected by a transform (i.e. have a transform applied to them, or to any of their ancestor elements), a value of fixed for the background-attachment property is treated as if it had a value of scroll. The computed value of background-attachment is not affected.

(Note there's some prose in the previous normative paragraph, prior to the example, about background-attachment fixed backgrounds, but that's actually more recent text that was added in #2185 as part of exporting a formal definition of containing block for all descendants, so it can be ignored here since it's not relevant to the transform property itself, thanks to the text I quoted above.)

Then, in general, the [backgrounds spec describes](https://www.w3.org/TR/css-backgrounds-3/#root-background) the background propagation of the root element to the canvas, and the background positioning area being determined by the root element's padding box.  While it's not completely clear whether this is affected by transforms or not, I think the implication of the current spec is that it is not affected by transforms, although I think it's possible to argue the opposite.

Thus my reading of the current specs is that transforms on the root should affect the root's background only when background-attachment is fixed.

However, what my tests found is that:
 * Chromium does the exact opposite of the current spec (honors transforms only when background-attachment is scroll)
 * Gecko never honors the transform
 * WebKit always honors the transform

The particular conclusion about what the spec currently says doesn't particularly make sense to me, and I wonder if it's something we should reconsider given the lack of interop and lack of conformance to the current spec.

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


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

Received on Friday, 24 September 2021 14:52:09 UTC