Bug 1632885 [wpt PR 23234] - Account for root element paint offset when painting...
commit73d60ed1cdff98ce31504f34abe78c893b6ad0e4
authorPhilip Rogers <pdr@chromium.org>
Tue, 28 Apr 2020 11:43:50 +0000 (28 11:43 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 30 Apr 2020 19:04:04 +0000 (30 19:04 +0000)
tree392f4c6dc4a8f5c56dba8806219ca82a45f6733a
parentb93d04ab23814084711c473aeb556b143a741256
Bug 1632885 [wpt PR 23234] - Account for root element paint offset when painting backgrounds, a=testonly

Automatic update from web-platform-tests
Account for root element paint offset when painting backgrounds

The root background is painted from the coordinate space of the root
element, but expands to fill the viewport. The difference between these
spaces needs to be used as an offset when painting the background.

For the non-transform case, this patch removes the paint offset
adjustment made to the entire paint rect in ViewPainter, and only
applies the paint offset for positioning the background in
BackgroundImageGeometry::ComputePositioningArea. This way, painting
starts from the origin, without paint offset.

For the transform case, paint properties will apply the paint offset,
and the entire paint rect needs to be adjusted to remove the paint
offset. This patch specifies the transform state of the view and root
element, and uses GeometryMapper to map the background paint rect into
the coordinate space of the root element.

A TODO has been added to more clearly specify the non-transform
and transform cases.

Bug: 1071957
Change-Id: Iedc1834ef9c400340b668b3eec73a0f3f4506194
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2161350
Auto-Submit: Philip Rogers <pdr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762543}

--

wpt-commits: f8bd87deb2c2a0ea974adb6c64ef013a60188193
wpt-pr: 23234
testing/web-platform/tests/css/css-backgrounds/background-margin-iframe-root-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-backgrounds/background-margin-iframe-root.html [new file with mode: 0644]
testing/web-platform/tests/css/css-backgrounds/background-margin-root-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-backgrounds/background-margin-root.html [new file with mode: 0644]
testing/web-platform/tests/css/css-backgrounds/background-margin-transformed-root-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-backgrounds/background-margin-transformed-root.html [new file with mode: 0644]