Title: [276426] trunk/Source/WebCore
- Revision
- 276426
- Author
- [email protected]
- Date
- 2021-04-22 00:50:02 -0700 (Thu, 22 Apr 2021)
Log Message
REGRESSION(r275790) [GTK][WPE] Scrolling rendering fails after the second page
https://bugs.webkit.org/show_bug.cgi?id=224824
Patch by Alejandro G. Castro <[email protected]> on 2021-04-22
Reviewed by Simon Fraser.
We are making the implementation more similar to the Apple
scrolling coordinator. Now we reimplement willStartRenderingUpdate
to be able to synchronize the state there. That way we can avoid
the timer and just schedule a rendering update when we want to
commit the tree state.
Test: Fixes the timeout of the overflow-scrollable-after-back.html,
added in the regression.
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::ScrollingCoordinatorNicosia):
(WebCore::ScrollingCoordinatorNicosia::pageDestroyed):
(WebCore::ScrollingCoordinatorNicosia::commitTreeStateIfNeeded):
(WebCore::ScrollingCoordinatorNicosia::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorNicosia::willStartRenderingUpdate):
(WebCore::ScrollingCoordinatorNicosia::commitTreeState): Deleted.
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (276425 => 276426)
--- trunk/Source/WebCore/ChangeLog 2021-04-22 07:40:36 UTC (rev 276425)
+++ trunk/Source/WebCore/ChangeLog 2021-04-22 07:50:02 UTC (rev 276426)
@@ -1,3 +1,28 @@
+2021-04-22 Alejandro G. Castro <[email protected]>
+
+ REGRESSION(r275790) [GTK][WPE] Scrolling rendering fails after the second page
+ https://bugs.webkit.org/show_bug.cgi?id=224824
+
+ Reviewed by Simon Fraser.
+
+ We are making the implementation more similar to the Apple
+ scrolling coordinator. Now we reimplement willStartRenderingUpdate
+ to be able to synchronize the state there. That way we can avoid
+ the timer and just schedule a rendering update when we want to
+ commit the tree state.
+
+ Test: Fixes the timeout of the overflow-scrollable-after-back.html,
+ added in the regression.
+
+ * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
+ (WebCore::ScrollingCoordinatorNicosia::ScrollingCoordinatorNicosia):
+ (WebCore::ScrollingCoordinatorNicosia::pageDestroyed):
+ (WebCore::ScrollingCoordinatorNicosia::commitTreeStateIfNeeded):
+ (WebCore::ScrollingCoordinatorNicosia::scheduleTreeStateCommit):
+ (WebCore::ScrollingCoordinatorNicosia::willStartRenderingUpdate):
+ (WebCore::ScrollingCoordinatorNicosia::commitTreeState): Deleted.
+ * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h:
+
2021-04-22 Kimmo Kinnunen <[email protected]>
GraphicsContextGLOpenGLCocoa should check that ANGLE is loaded in WK1 releaseCurrentContext
Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp (276425 => 276426)
--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp 2021-04-22 07:40:36 UTC (rev 276425)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp 2021-04-22 07:50:02 UTC (rev 276426)
@@ -42,7 +42,6 @@
ScrollingCoordinatorNicosia::ScrollingCoordinatorNicosia(Page* page)
: AsyncScrollingCoordinator(page)
- , m_scrollingStateTreeCommitterTimer(RunLoop::main(), this, &ScrollingCoordinatorNicosia::commitTreeState)
{
setScrollingTree(ScrollingTreeNicosia::create(*this));
}
@@ -56,8 +55,6 @@
{
AsyncScrollingCoordinator::pageDestroyed();
- m_scrollingStateTreeCommitterTimer.stop();
-
// Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects.
RefPtr<ThreadedScrollingTree> scrollingTree = static_pointer_cast<ThreadedScrollingTree>(releaseScrollingTree());
ScrollingThread::dispatch([scrollingTree] { scrollingTree->invalidate(); });
@@ -65,8 +62,13 @@
void ScrollingCoordinatorNicosia::commitTreeStateIfNeeded()
{
- commitTreeState();
- m_scrollingStateTreeCommitterTimer.stop();
+ willCommitTree();
+
+ if (!scrollingStateTree()->hasChangedProperties())
+ return;
+
+ auto stateTree = scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation);
+ scrollingTree()->commitTreeState(WTFMove(stateTree));
}
bool ScrollingCoordinatorNicosia::handleWheelEventForScrolling(const PlatformWheelEvent& wheelEvent, ScrollingNodeID targetNode, Optional<WheelScrollGestureState> gestureState)
@@ -89,20 +91,15 @@
void ScrollingCoordinatorNicosia::scheduleTreeStateCommit()
{
- // FIXME: This should probably just call scheduleRenderingUpdate().
- if (!m_scrollingStateTreeCommitterTimer.isActive())
- m_scrollingStateTreeCommitterTimer.startOneShot(0_s);
+ scheduleRenderingUpdate();
}
-void ScrollingCoordinatorNicosia::commitTreeState()
+void ScrollingCoordinatorNicosia::willStartRenderingUpdate()
{
- willCommitTree();
-
- if (!scrollingStateTree()->hasChangedProperties())
- return;
-
- auto stateTree = scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation);
- scrollingTree()->commitTreeState(WTFMove(stateTree));
+ RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree());
+ threadedScrollingTree->willStartRenderingUpdate();
+ commitTreeStateIfNeeded();
+ synchronizeStateFromScrollingTree();
}
} // namespace WebCore
Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.h (276425 => 276426)
--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.h 2021-04-22 07:40:36 UTC (rev 276425)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.h 2021-04-22 07:50:02 UTC (rev 276426)
@@ -50,9 +50,7 @@
private:
void scheduleTreeStateCommit() override;
- void commitTreeState();
-
- RunLoop::Timer<ScrollingCoordinatorNicosia> m_scrollingStateTreeCommitterTimer;
+ void willStartRenderingUpdate() final;
};
} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes