WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
321908
REGRESSION(
309315@main
): [WPE][GTK] position:fixed layers are unnecessarily repainted by scrolling
https://bugs.webkit.org/show_bug.cgi?id=321908
Summary
REGRESSION(309315@main): [WPE][GTK] position:fixed layers are unnecessarily r...
Fujii Hironori
Reported
2026-08-16 23:31:40 PDT
REGRESSION(
309315@main
): [WPE][GTK] position:fixed layers are unnecessarily repainted by scrolling 1. Start GTK MiniBrowser 2. Open WebInspector 3. Enable show compositing border by clicking the button in Element tab 4. Load the content 5. Scroll the page by mouse wheel Actual: the repainting counter of the float layer is rapidly increasing while scrolling. Expected: the repainting counter of the float layer is not increasing while scrolling. Reverting
309315@main
fixed this problem.
Attachments
test content
(250 bytes, text/html)
2026-08-16 23:32 PDT
,
Fujii Hironori
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2026-08-16 23:32:33 PDT
Created
attachment 481072
[details]
test content
Fujii Hironori
Comment 2
2026-08-18 23:48:06 PDT
After
309315@main
, in LocalFrameView::updateLayoutViewport, the following condition becomes true. Then, layout is triggered.
https://github.com/WebKit/WebKit/blob/9c27c4ccf517794644bc3e08facc1e95a14f4e75/Source/WebCore/page/LocalFrameView.cpp#L2017
> if (newLayoutViewportOrigin != m_layoutViewportOrigin) { > setBaseLayoutViewportOrigin(newLayoutViewportOrigin);
I added the debug logging. diff --git a/Source/WebCore/page/LocalFrameView.cpp b/Source/WebCore/page/LocalFrameView.cpp index 08785a978430..ca2382d69f75 100644 --- a/Source/WebCore/page/LocalFrameView.cpp +++ b/Source/WebCore/page/LocalFrameView.cpp @@ -2014,6 +2014,7 @@ void LocalFrameView::updateLayoutViewport() } LayoutPoint newLayoutViewportOrigin = computeLayoutViewportOrigin(visualViewportRect(), minStableLayoutViewportOrigin(), maxStableLayoutViewportOrigin(), layoutViewport, scrollBehaviorForFixedElements()); + WTF_ALWAYS_LOG(__FUNCTION__ << ":" << __LINE__ << " " << this << " cond:" << (newLayoutViewportOrigin != m_layoutViewportOrigin) << " newLayoutViewportOrigin:" << newLayoutViewportOrigin << " m_layoutViewportOrigin:" << m_layoutViewportOrigin); if (newLayoutViewportOrigin != m_layoutViewportOrigin) { setBaseLayoutViewportOrigin(newLayoutViewportOrigin); LOG_WITH_STREAM(Scrolling, stream << "layoutViewport changed to " << layoutViewportRect()); Then, I got the following log:
> updateLayoutViewport:2017 0x7fd6f8000000 cond:0 newLayoutViewportOrigin:(0.00,274.00) m_layoutViewportOrigin:(0.00,274.00) > updateLayoutViewport:2017 0x7fd6f8000000 cond:1 newLayoutViewportOrigin:(0.00,293.00) m_layoutViewportOrigin:(0.00,292.97) > updateLayoutViewport:2017 0x7fd6f8000000 cond:1 newLayoutViewportOrigin:(0.00,293.00) m_layoutViewportOrigin:(0.00,292.97) > updateLayoutViewport:2017 0x7fd6f8000000 cond:0 newLayoutViewportOrigin:(0.00,293.00) m_layoutViewportOrigin:(0.00,293.00) > updateLayoutViewport:2017 0x7fd6f8000000 cond:1 newLayoutViewportOrigin:(0.00,322.00) m_layoutViewportOrigin:(0.00,321.61) > updateLayoutViewport:2017 0x7fd6f8000000 cond:1 newLayoutViewportOrigin:(0.00,322.00) m_layoutViewportOrigin:(0.00,321.61) > updateLayoutViewport:2017 0x7fd6f8000000 cond:0 newLayoutViewportOrigin:(0.00,322.00) m_layoutViewportOrigin:(0.00,322.00) > updateLayoutViewport:2017 0x7fd6f8000000 cond:1 newLayoutViewportOrigin:(0.00,349.00) m_layoutViewportOrigin:(0.00,348.70)
The fractional parts are different. m_layoutViewportOrigin of LocalFrameView is LayoutPoint type. newLayoutViewportOrigin comes from m_scrollPosition of ScrollView which is IntPoint type.
Fujii Hironori
Comment 3
2026-08-18 23:54:14 PDT
There are several ways to work around. This is one of them. diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp index 257b00d4f287..5739400272af 100644 --- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp +++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp @@ -873,6 +873,9 @@ void AsyncScrollingCoordinator::reconcileScrollingState(LocalFrameView& frameVie if (layoutViewportOriginOrOverrideRect) { WTF::switchOn(*layoutViewportOriginOrOverrideRect, [&frameView](FloatPoint origin) { +#if USE(COORDINATED_GRAPHICS) + origin = roundedIntPoint(origin); +#endif frameView.setBaseLayoutViewportOrigin(LayoutPoint(origin), LocalFrameView::TriggerLayoutOrNot::No); }, [&layoutViewportRect](FloatRect overrideRect) { layoutViewportRect = overrideRect;
Fujii Hironori
Comment 4
2026-08-19 19:41:14 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/71996
EWS
Comment 5
2026-08-31 04:09:58 PDT
Committed
320147@main
(13cc83ffe56b): <
https://commits.webkit.org/320147@main
> Reviewed commits have been landed. Closing PR #71996 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug