Skip to content

Conversation

mattwoodrow
Copy link
Contributor

@mattwoodrow mattwoodrow commented Sep 26, 2025

3c71d5e

Viewport clipping layers are incorrectly positioned when the element is captured in a view transition.
https://bugs.webkit.org/show_bug.cgi?id=299578
rdar://154886047

Reviewed by Wenson Hsieh.

Viewport clipping layers should only be added for layers that have the
RenderView as their composited ancestor.

Once they get captured in a view transition, their GraphicsLayers will get
reparented as replaced contents into the pseudo element's layers (which is
guaranteed to be composited) so they no longer meet this criteria. As such,
their computed position can be incorrect (not accounting for ancestor offsets)
and they clip incorrectly.

* LayoutTests/platform/ios-18/TestExpectations:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-sequoia/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::viewportConstrainedSublayers const):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::setCapturedInViewTransition):

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

decabbe

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ❌ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 🧪 win-tests ❌ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ❌ 🧪 api-wpe ❌ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ❌ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@mattwoodrow mattwoodrow self-assigned this Sep 26, 2025
@mattwoodrow mattwoodrow added the Compositing Bugs related to layerization for transforms, video, scrolling etc label Sep 26, 2025
@mattwoodrow mattwoodrow requested a review from whsieh September 26, 2025 01:57
Copy link
Member

@whsieh whsieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice — thank you for investigating this!

@mattwoodrow mattwoodrow added the merge-queue Applied to send a pull request to merge-queue label Sep 26, 2025
…is captured in a view transition.

https://bugs.webkit.org/show_bug.cgi?id=299578
rdar://154886047

Reviewed by Wenson Hsieh.

Viewport clipping layers should only be added for layers that have the
RenderView as their composited ancestor.

Once they get captured in a view transition, their GraphicsLayers will get
reparented as replaced contents into the pseudo element's layers (which is
guaranteed to be composited) so they no longer meet this criteria. As such,
their computed position can be incorrect (not accounting for ancestor offsets)
and they clip incorrectly.

* LayoutTests/platform/ios-18/TestExpectations:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-sequoia/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::viewportConstrainedSublayers const):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::setCapturedInViewTransition):

Canonical link: https://commits.webkit.org/300561@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/vt-captured-element-with-viewport-clipping branch from decabbe to 3c71d5e Compare September 26, 2025 07:19
@webkit-commit-queue
Copy link
Collaborator

Committed 300561@main (3c71d5e): https://commits.webkit.org/300561@main

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

@webkit-commit-queue webkit-commit-queue merged commit 3c71d5e into WebKit:main Sep 26, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compositing Bugs related to layerization for transforms, video, scrolling etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants