Open Bug 1724471 Opened 4 years ago Updated 4 years ago

Transform on root element doesn't affect its background image

Categories

(Core :: Web Painting, task, P3)

task

Tracking

()

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR:

  1. Load attached testcase.

EXPECTED RESULTS:
The background image (in this case a gradient) should be rotated like the text is.

ACTUAL RESULTS:
The background image is not rotated.

I think this is responsible for these three WPT failures:
https://wpt.fyi/results/css/css-transforms/transform-root-bg-001.html
https://wpt.fyi/results/css/css-transforms/transform-root-bg-002.html
https://wpt.fyi/results/css/css-transforms/transform-root-bg-003.html

and it's also partly responsible for these failures:
https://wpt.fyi/results/css/css-transforms/transform-translate-background-001.html
https://wpt.fyi/results/css/css-transforms/transform-translate-background-002.html
(These two also have bug 1724459 to blame which I think is a distinct issue)

These tests are all included in the compat2021 test set here:
https://github.com/Ecosystem-Infra/wpt-results-analysis/blob/master/compat-2021/css-transforms-tests.txt

Attached file testcase 1

This seems expected given background-image is propagated to the viewport, but transform isn't?

Flags: needinfo?(dholbert)

Ah, so this is this note in https://drafts.csswg.org/css-transforms/#transform-rendering:

Note: If the root element is transformed, the transformation applies to the entire canvas, including any background specified for the root element. Since the background painting area for the root element is the entire canvas, which is infinite, the transformation might cause parts of the background that were originally off-screen to appear. For example, if the root element’s background were repeating dots, and a transformation of scale(0.5) were specified on the root element, the dots would shrink to half their size, but there will be four times as many, so they still cover the whole viewport.

Seems pretty weird to me to "propagate" transform to the canvas as well, tbh.

(It sounds like comment 3 answered your question in comment 2? Canceling ni on that assumption.)

Flags: needinfo?(dholbert)

This same issue is also responsible for these WPT test-failures (also in the compat2021 test set):
https://wpt.fyi/results/css/css-transforms/transform-background-007.html
https://wpt.fyi/results/css/css-transforms/transform-background-008.html

Severity: -- → S3
Priority: -- → P3

Looks like there's an open spec issue on this (which is on the agenda for tomorrow's CSSWG meeting, though the agenda is packed so we may not get to it tomorrow): https://github.com/w3c/csswg-drafts/issues/6683

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: