Skip to content

REGRESSION(298142@main): Web content may be temporarily offset during Safari View Controller presentation#49081

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
aprotyas:eng/297076
Aug 8, 2025
Merged

REGRESSION(298142@main): Web content may be temporarily offset during Safari View Controller presentation#49081
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
aprotyas:eng/297076

Conversation

@aprotyas
Copy link
Member

@aprotyas aprotyas commented Aug 7, 2025

30fd586

REGRESSION(298142@main): Web content may be temporarily offset during Safari View Controller presentation
https://bugs.webkit.org/show_bug.cgi?id=297076
rdar://157669095

Reviewed by Wenson Hsieh.

After 298142@main, we notice that the initial web content presented when
an SFSafariViewController sheet is brought up can be temporarily offset.
Logging suggests this can happen when we're in the middle of a live
resize, so _shouldDeferGeometryUpdates is respected and overridden
layout parameter updates are not dispatched on the first layer tree
transaction after obscured insets are set on the web view.

To work around this issue, we introduce a small escape hatch, where even
if _shouldDeferGeometryUpdates holds, we update the layout size if (a)
the web view lives in a Safari view service and (b) the window scene is
not being interactively resized.

We add a couple of API tests as coverage for 298142@main, just to verify
that these geometry updates can be made during animated/live resizes
without hanging the UI process.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _didCommitLayerTree:]):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
(TEST(AnimatedResize, ChangingWebViewGeometryDuringLiveResizeDoesNotHang)):
(TEST(AnimatedResize, ChangingWebViewGeometryDuringAnimatedResizeDoesNotHang)):

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

dcff8d1

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
🧪 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
⏳ 🧪 vision-wk2 🧪 mac-intel-wk2 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🛠 tv 🛠 mac-safer-cpp
🛠 tv-sim
🛠 watch
🛠 watch-sim

@aprotyas aprotyas requested a review from cdumez as a code owner August 7, 2025 21:06
@aprotyas aprotyas self-assigned this Aug 7, 2025
@aprotyas aprotyas added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Aug 7, 2025
@aprotyas
Copy link
Member Author

aprotyas commented Aug 7, 2025

Thank you for the review! iOS API bot is green

@aprotyas aprotyas added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Aug 8, 2025
… Safari View Controller presentation

https://bugs.webkit.org/show_bug.cgi?id=297076
rdar://157669095

Reviewed by Wenson Hsieh.

After 298142@main, we notice that the initial web content presented when
an SFSafariViewController sheet is brought up can be temporarily offset.
Logging suggests this can happen when we're in the middle of a live
resize, so _shouldDeferGeometryUpdates is respected and overridden
layout parameter updates are not dispatched on the first layer tree
transaction after obscured insets are set on the web view.

To work around this issue, we introduce a small escape hatch, where even
if _shouldDeferGeometryUpdates holds, we update the layout size if (a)
the web view lives in a Safari view service and (b) the window scene is
not being interactively resized.

We add a couple of API tests as coverage for 298142@main, just to verify
that these geometry updates can be made during animated/live resizes
without hanging the UI process.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _didCommitLayerTree:]):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
(TEST(AnimatedResize, ChangingWebViewGeometryDuringLiveResizeDoesNotHang)):
(TEST(AnimatedResize, ChangingWebViewGeometryDuringAnimatedResizeDoesNotHang)):

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

Committed 298370@main (30fd586): https://commits.webkit.org/298370@main

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

@webkit-commit-queue webkit-commit-queue merged commit 30fd586 into WebKit:main Aug 8, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Aug 8, 2025
@aprotyas aprotyas deleted the eng/297076 branch August 8, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants