Skip to content

Commit 846fd71

Browse files
browser(webkit): fix scrolling in mobile viewports (#5497)
1 parent 9b73edf commit 846fd71

File tree

2 files changed

+52
-7
lines changed

2 files changed

+52
-7
lines changed

browser_patches/webkit/BUILD_NUMBER

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1435
2-
Changed: lushnikov@chromium.org Tue Feb 16 10:30:00 MST 2021
1+
1436
2+
Changed: einbinder@chromium.org Thu 18 Feb 2021 09:40:46 AM PST

browser_patches/webkit/patches/bootstrap.diff

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17928,7 +17928,7 @@ index 0000000000000000000000000000000000000000..9b413bb8150a1633d29b6e2606127c9c
1792817928
+
1792917929
+#endif // ENABLE(DRAG_SUPPORT)
1793017930
diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
17931-
index fa17db677ffdf0d4d8c2ff254da528ecb7b96b93..6005c0f309ecbb63580dbf5d4300e7cdc4d623a1 100644
17931+
index fa17db677ffdf0d4d8c2ff254da528ecb7b96b93..3b95a644266ce46be3b773658d39441ee737e172 100644
1793217932
--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
1793317933
+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
1793417934
@@ -36,7 +36,9 @@
@@ -17941,15 +17941,32 @@ index fa17db677ffdf0d4d8c2ff254da528ecb7b96b93..6005c0f309ecbb63580dbf5d4300e7cd
1794117941
#include <WebCore/Page.h>
1794217942
#include <WebCore/PageOverlayController.h>
1794317943
#include <WebCore/Settings.h>
17944-
@@ -252,6 +254,7 @@ void DrawingAreaCoordinatedGraphics::updatePreferences(const WebPreferencesStore
17944+
@@ -122,6 +124,16 @@ void DrawingAreaCoordinatedGraphics::scroll(const IntRect& scrollRect, const Int
17945+
ASSERT(m_scrollRect.isEmpty());
17946+
ASSERT(m_scrollOffset.isEmpty());
17947+
ASSERT(m_dirtyRegion.isEmpty());
17948+
+// Playwright begin
17949+
+#if !PLATFORM(WIN)
17950+
+ if (m_webPage.mainFrameView() && m_webPage.mainFrameView()->useFixedLayout()) {
17951+
+ IntRect visibleRect = IntRect(m_layerTreeHost->viewportController().visibleContentsRect());
17952+
+ visibleRect.move(-scrollDelta.width(), -scrollDelta.height());
17953+
+ m_layerTreeHost->scrollNonCompositedContents(visibleRect);
17954+
+ return;
17955+
+ }
17956+
+#endif
17957+
+// Playwright end
17958+
m_layerTreeHost->scrollNonCompositedContents(scrollRect);
17959+
return;
17960+
}
17961+
@@ -252,6 +264,7 @@ void DrawingAreaCoordinatedGraphics::updatePreferences(const WebPreferencesStore
1794517962
settings.setAcceleratedCompositingEnabled(false);
1794617963
}
1794717964
#endif
1794817965
+
1794917966
settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()));
1795017967
// Fixed position elements need to be composited and create stacking contexts
1795117968
// in order to be scrolled by the ScrollingCoordinator.
17952-
@@ -621,6 +624,11 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay
17969+
@@ -621,6 +634,11 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay
1795317970
m_scrollOffset = IntSize();
1795417971
m_displayTimer.stop();
1795517972
m_isWaitingForDidUpdate = false;
@@ -17961,7 +17978,7 @@ index fa17db677ffdf0d4d8c2ff254da528ecb7b96b93..6005c0f309ecbb63580dbf5d4300e7cd
1796117978
}
1796217979

1796317980
void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode()
17964-
@@ -670,6 +678,11 @@ void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode()
17981+
@@ -670,6 +688,11 @@ void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode()
1796517982
// UI process, we still need to let it know about the new contents, so send an Update message.
1796617983
send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
1796717984
}
@@ -17974,7 +17991,7 @@ index fa17db677ffdf0d4d8c2ff254da528ecb7b96b93..6005c0f309ecbb63580dbf5d4300e7cd
1797417991

1797517992
void DrawingAreaCoordinatedGraphics::scheduleDisplay()
1797617993
diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
17977-
index 407f4f3fb1fc69a6be366a4a5fb37b3dd4bb2252..decc71e149c6881f41279dec7df3a94cf2d8c513 100644
17994+
index 407f4f3fb1fc69a6be366a4a5fb37b3dd4bb2252..ee32e49c7bee97bf4269df1d8e7599edf4a7f1ff 100644
1797817995
--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
1797917996
+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
1798017997
@@ -166,8 +166,16 @@ void LayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer)
@@ -17994,6 +18011,34 @@ index 407f4f3fb1fc69a6be366a4a5fb37b3dd4bb2252..decc71e149c6881f41279dec7df3a94c
1799418011

1799518012
m_viewportController.didScroll(rect.location());
1799618013
if (m_isDiscardable)
18014+
@@ -286,6 +294,10 @@ void LayerTreeHost::didChangeViewport()
18015+
18016+
if (!view->useFixedLayout())
18017+
view->notifyScrollPositionChanged(m_lastScrollPosition);
18018+
+// Playwright begin
18019+
+ else
18020+
+ m_viewportController.didScroll(m_lastScrollPosition);
18021+
+// Playwright end
18022+
}
18023+
18024+
if (m_lastPageScaleFactor != pageScale) {
18025+
diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
18026+
index 6727d16c8c0b86c15ff31af038aa9d7588527545..b9b3c242375c7a8849d973298d680acffbbdd024 100644
18027+
--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
18028+
+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
18029+
@@ -97,7 +97,11 @@ public:
18030+
RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID);
18031+
18032+
WebCore::PlatformDisplayID displayID() const { return m_displayID; }
18033+
-
18034+
+// Playwright begin
18035+
+#if USE(COORDINATED_GRAPHICS)
18036+
+ const SimpleViewportController& viewportController() const { return m_viewportController; }
18037+
+#endif
18038+
+// Playwright end
18039+
private:
18040+
#if USE(COORDINATED_GRAPHICS)
18041+
void layerFlushTimerFired();
1799718042
diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp
1799818043
index 8444a454c603c671a6813a445550b40761e7fd84..c5cc0d6092c500f0f0bf63700ada1e86bb93346b 100644
1799918044
--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp

0 commit comments

Comments
 (0)