Title: [271551] trunk/Source/WebCore
- Revision
- 271551
- Author
- [email protected]
- Date
- 2021-01-15 19:44:38 -0800 (Fri, 15 Jan 2021)
Log Message
Scroll position is lost when homing out and resuming Safari on iOS
https://bugs.webkit.org/show_bug.cgi?id=220676
Reviewed by Tim Horton.
When homing out on iOS, UIKit snapshotting causes multiple web view resizes, which runs
the dynamicViewportSizeUpdate() logic. This can trigger programmatic scrolls via
FrameView::setContentsSize(), which get stored in the scrolling state tree. When
that tree is committed on resume, we then erroneously apply the programmatic
scrolls.
Fix by ignoring requested scroll positions updates when snapshotting, as we do when
we're in the page cache.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (271550 => 271551)
--- trunk/Source/WebCore/ChangeLog 2021-01-16 03:38:30 UTC (rev 271550)
+++ trunk/Source/WebCore/ChangeLog 2021-01-16 03:44:38 UTC (rev 271551)
@@ -1,3 +1,22 @@
+2021-01-15 Simon Fraser <[email protected]>
+
+ Scroll position is lost when homing out and resuming Safari on iOS
+ https://bugs.webkit.org/show_bug.cgi?id=220676
+
+ Reviewed by Tim Horton.
+
+ When homing out on iOS, UIKit snapshotting causes multiple web view resizes, which runs
+ the dynamicViewportSizeUpdate() logic. This can trigger programmatic scrolls via
+ FrameView::setContentsSize(), which get stored in the scrolling state tree. When
+ that tree is committed on resume, we then erroneously apply the programmatic
+ scrolls.
+
+ Fix by ignoring requested scroll positions updates when snapshotting, as we do when
+ we're in the page cache.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
+
2021-01-15 Peng Liu <[email protected]>
(REGRESSION) Playback pauses upon entering PiP via media controls on trailers.apple.com
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (271550 => 271551)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2021-01-16 03:38:30 UTC (rev 271550)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2021-01-16 03:44:38 UTC (rev 271551)
@@ -268,6 +268,7 @@
setScrollingNodeScrollableAreaGeometry(scrollingNodeID, scrollableArea);
bool inBackForwardCache = frameView->frame().document()->backForwardCacheState() != Document::NotInBackForwardCache;
+ bool isSnapshotting = m_page->isTakingSnapshotsForApplicationSuspension();
bool inProgrammaticScroll = scrollableArea.currentScrollType() == ScrollType::Programmatic;
if (inProgrammaticScroll || inBackForwardCache)
applyScrollUpdate(scrollingNodeID, scrollPosition, { }, ScrollType::Programmatic, ScrollingLayerPositionAction::Set);
@@ -276,7 +277,7 @@
// If this frame view's document is being put into the back/forward cache, we don't want to update our
// main frame scroll position. Just let the FrameView think that we did.
- if (inBackForwardCache)
+ if (inBackForwardCache || isSnapshotting)
return true;
auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(scrollingNodeID));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes