Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[view-transitions] Mispositioned snapshots on https://codepen.io/bramus/full/mdowgYX #28808

Merged
merged 1 commit into from
May 23, 2024

Conversation

mattwoodrow
Copy link
Contributor

@mattwoodrow mattwoodrow commented May 20, 2024

159906e

[view-transitions] Mispositioned snapshots on https://codepen.io/bramus/full/mdowgYX
https://bugs.webkit.org/show_bug.cgi?id=272185
rdar://125931829

Reviewed by Simon Fraser.

We were previously unconditionally substracting the scroll position from the transform when positioning the snapshots.
This is incorrect in some cases, like when the element is fixed positioned.

This makes use of the existing TransformState/mapLocalToContainer code to correctly account for position:fixed when accumulating
transforms through ancestors.

It also adds support for flattening the 'tracked' transform when crossing 3d rendering context boundaries, by setting the 3rd row
and column of the TransformationMatrix to 0.

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-flat-transform-ancestor-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-flat-transform-ancestor-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-flat-transform-ancestor.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-preserve-3d-ancestor-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-preserve-3d-ancestor-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-preserve-3d-ancestor.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-transform-position-fixed-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-transform-position-fixed-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-transform-position-fixed.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/root-scrollbar-with-fixed-background-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/root-scrollbar-with-fixed-background-ref.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/root-scrollbar-with-fixed-background.html:
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::copyElementBaseProperties):
* Source/WebCore/platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::translateMappedCoordinates):
(WebCore::TransformState::flattenWithTransform):
* Source/WebCore/platform/graphics/transforms/TransformState.h:
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::flatten):
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.h:
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::localToAbsoluteTransform const):
* Source/WebCore/rendering/RenderObject.h:

Canonical link: https://commits.webkit.org/279186@main

13f3033

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2 βœ… πŸ§ͺ wincairo-tests
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
  πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  wpe-cairo
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ›  gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2   πŸ§ͺ gtk-wk2
  πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress   πŸ§ͺ api-gtk
loading-orange πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@mattwoodrow mattwoodrow self-assigned this May 20, 2024
@mattwoodrow mattwoodrow added the Layout and Rendering For bugs with layout and rendering of Web pages. label May 20, 2024
@mattwoodrow mattwoodrow requested a review from smfr May 21, 2024 00:01
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@mattwoodrow mattwoodrow removed the merging-blocked Applied to prevent a change from being merged label May 22, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 22, 2024
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label May 22, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 22, 2024
@mattwoodrow mattwoodrow removed the merging-blocked Applied to prevent a change from being merged label May 23, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 23, 2024
@mattwoodrow mattwoodrow removed the merging-blocked Applied to prevent a change from being merged label May 23, 2024
@mattwoodrow mattwoodrow added the merge-queue Applied to send a pull request to merge-queue label May 23, 2024
…us/full/mdowgYX

https://bugs.webkit.org/show_bug.cgi?id=272185
rdar://125931829

Reviewed by Simon Fraser.

We were previously unconditionally substracting the scroll position from the transform when positioning the snapshots.
This is incorrect in some cases, like when the element is fixed positioned.

This makes use of the existing TransformState/mapLocalToContainer code to correctly account for position:fixed when accumulating
transforms through ancestors.

It also adds support for flattening the 'tracked' transform when crossing 3d rendering context boundaries, by setting the 3rd row
and column of the TransformationMatrix to 0.

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-flat-transform-ancestor-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-flat-transform-ancestor-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-flat-transform-ancestor.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-preserve-3d-ancestor-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-preserve-3d-ancestor-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-preserve-3d-ancestor.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-transform-position-fixed-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-transform-position-fixed-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-transform-position-fixed.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/root-scrollbar-with-fixed-background-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/root-scrollbar-with-fixed-background-ref.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/root-scrollbar-with-fixed-background.html:
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::copyElementBaseProperties):
* Source/WebCore/platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::translateMappedCoordinates):
(WebCore::TransformState::flattenWithTransform):
* Source/WebCore/platform/graphics/transforms/TransformState.h:
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::flatten):
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.h:
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::localToAbsoluteTransform const):
* Source/WebCore/rendering/RenderObject.h:

Canonical link: https://commits.webkit.org/279186@main
@webkit-commit-queue
Copy link
Collaborator

Committed 279186@main (159906e): https://commits.webkit.org/279186@main

Reviewed commits have been landed. Closing PR #28808 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 159906e into WebKit:main May 23, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
6 participants