WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
309478
[GTK][WPE][Coordinated Graphics] the page is flickering while transition to the previous page
https://bugs.webkit.org/show_bug.cgi?id=309478
Summary
[GTK][WPE][Coordinated Graphics] the page is flickering while transition to t...
Fujii Hironori
Reported
2026-03-08 22:55:27 PDT
[GTK][WPE][Coordinated Graphics] the page is flickering while transition to the previous page 1. python -m http.server -d . 2. ./Tools/Scripts/run-minibrowser --wpe --release
http://localhost:8000/LayoutTests/svg/as-image
3. Scroll down to the bottom of the page 4. Click the last item 'view-in-inner-svg.html' 5. Go back I observe 3 issues. While transition to the previous page, the page flickering The bottom of the previous page aren't painted A dark scroll bar is painted
Attachments
test case
(441 bytes, text/html)
2026-03-09 17:27 PDT
,
Fujii Hironori
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2026-03-09 17:27:14 PDT
Created
attachment 478608
[details]
test case 1. Load the test content 2. Click step 1 3. Click step 2 4. Back There is no tiles. You can see the compsiting borders with --features=+CompositingBordersVisible .
Fujii Hironori
Comment 2
2026-03-10 00:53:55 PDT
Tiles are missing because the coverage area are miscomputed by computeCoverAndKeepRect(). The layer position was inconsistent between CoordinatedPlatformLayer and GraphicsLayerCoordinate. After the history back, CoordinatedPlatformLayer::setTopLeftPositionForScrolling() was called, but GraphicsLayerCoordinated::syncPosition() wasn't called yet.
Fujii Hironori
Comment 3
2026-03-17 00:26:58 PDT
I checked Mac port. GraphicsLayerCA::setPosition was called from HistoryController::restoreScrollPositionAndViewState with the following callstack. Thus, the coverage area is correct. 1 0x119ac85d7 WebCore::GraphicsLayerCA::setPosition(WebCore::FloatPoint const&) 2 0x11a9192ef WebCore::AsyncScrollingCoordinator::reconcileScrollingState(WebCore::LocalFrameView&, WebCore::FloatPoint const&, mpark::variant<std::__1::optional<WebCore::FloatPoint>, std::__1::optional<WebCore::FloatRect>> const&, WebCore::ScrollType, WebCore::ViewportRectStability, WebCore::ScrollingLayerPositionAction) (.cold.2) 3 0x1198a804c WebCore::AsyncScrollingCoordinator::reconcileScrollingState(WebCore::LocalFrameView&, WebCore::FloatPoint const&, mpark::variant<std::__1::optional<WebCore::FloatPoint>, std::__1::optional<WebCore::FloatRect>> const&, WebCore::ScrollType, WebCore::ViewportRectStability, WebCore::ScrollingLayerPositionAction) 4 0x11a91766f WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(WebCore::ProcessQualified<WTF::ObjectIdentifierGeneric<WebCore::ScrollingNodeIDType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>>, WebCore::FloatPoint, std::__1::optional<WebCore::FloatPoint>, WebCore::ScrollingLayerPositionAction, WebCore::ScrollType, WebCore::ViewportRectStability) 5 0x1198a768e WebCore::AsyncScrollingCoordinator::applyScrollPositionUpdate(WebCore::ScrollUpdate&&, WebCore::ScrollType, WebCore::ViewportRectStability) 6 0x1198a7b0b WebCore::AsyncScrollingCoordinator::applyScrollUpdate(WebCore::ScrollUpdate&&, WebCore::ScrollType, WebCore::ViewportRectStability) 7 0x1198a6b9c WebCore::AsyncScrollingCoordinator::requestScrollToPosition(WebCore::ScrollableArea&, WebCore::IntPoint const&, WebCore::ScrollPositionChangeOptions const&) 8 0x11a8dd304 WebCore::LocalFrameView::requestScrollToPosition(WebCore::IntPoint const&, WebCore::ScrollPositionChangeOptions const&) (.cold.1) 9 0x119815340 WebCore::LocalFrameView::requestScrollToPosition(WebCore::IntPoint const&, WebCore::ScrollPositionChangeOptions const&) 10 0x119914f5e WebCore::ScrollView::setScrollPosition(WebCore::IntPoint const&, WebCore::ScrollPositionChangeOptions const&) 11 0x11a8d1e62 WebCore::LocalFrameView::setScrollOffsetWithOptions(WebCore::IntPoint const&, WebCore::ScrollPositionChangeOptions const&) 12 0x119805990 WebCore::LocalFrameView::setScrollPosition(WebCore::IntPoint const&, WebCore::ScrollPositionChangeOptions const&) 13 0x11983954a WebCore::Page::setPageScaleFactor(float, WebCore::IntPoint const&, bool) 14 0x11972c817 WebCore::HistoryController::restoreScrollPositionAndViewState() 15 0x11971330c WebCore::FrameLoader::checkLoadCompleteForThisFrame(WebCore::LoadWillContinueInAnotherProcess) 16 0x119708dc8 WebCore::FrameLoader::checkLoadComplete(WebCore::LoadWillContinueInAnotherProcess) 17 0x119708a48 WebCore::FrameLoader::checkCompleted() 18 0x11a859f48 WebCore::FrameLoader::commitProvisionalLoad() 19 0x11a85aa16 WebCore::FrameLoader::loadProvisionalItemFromCachedPage() 20 0x1197114f1 WebCore::FrameLoader::continueLoadAfterNavigationPolicy(WebCore::ResourceRequest const&, WebCore::FormSubmission const*, WebCore::NavigationPolicyDecision, WebCore::AllowNavigationToInvalidURL) 21 0x11972ae52 WTF::Detail::CallableWrapper<WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::RefPtr<WebCore::FormSubmission const, WTF::RawPtrTraits<WebCore::FormSubmission const>, WTF::DefaultRefDerefTraits<WebCore::FormSubmission const>>&&, WebCore::AllowNavigationToInvalidURL, WTF::CompletionHandler<void ()>&&)::$_1, void, WebCore::ResourceRequest&&, WTF::WeakPtr<WebCore::FormSubmission const, WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits<WTF::DefaultWeakPtrImpl>>&&, WebCore::NavigationPolicyDecision>::call(WebCore::ResourceRequest&&, WTF::WeakPtr<WebCore::FormSubmission const, WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits<WTF::DefaultWeakPtrImpl>>&&, WebCore::NavigationPolicyDecision) 22 0x11a876778 WTF::Detail::CallableWrapper<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest&&, WebCore::ResourceResponse const&, WebCore::DocumentLoader*, WTF::RefPtr<WebCore::FormSubmission const, WTF::RawPtrTraits<WebCore::FormSubmission const>, WTF::DefaultRefDerefTraits<WebCore::FormSubmission const>>&&, WTF::CompletionHandler<void (WebCore::ResourceRequest&&, WTF::WeakPtr<WebCore::FormSubmission const, WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits<WTF::DefaultWeakPtrImpl>>&&, WebCore::NavigationPolicyDecision)>&&, WebCore::PolicyDecisionMode, std::__1::optional<WebCore::NavigationNavigationType>)::$_1, void, WebCore::PolicyAction>::call(WebCore::PolicyAction) (.cold.5) 23 0x119745968 WTF::Detail::CallableWrapper<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest&&, WebCore::ResourceResponse const&, WebCore::DocumentLoader*, WTF::RefPtr<WebCore::FormSubmission const, WTF::RawPtrTraits<WebCore::FormSubmission const>, WTF::DefaultRefDerefTraits<WebCore::FormSubmission const>>&&, WTF::CompletionHandler<void (WebCore::ResourceRequest&&, WTF::WeakPtr<WebCore::FormSubmission const, WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits<WTF::DefaultWeakPtrImpl>>&&, WebCore::NavigationPolicyDecision)>&&, WebCore::PolicyDecisionMode, std::__1::optional<WebCore::NavigationNavigationType>)::$_1, void, WebCore::PolicyAction>::call(WebCore::PolicyAction) 24 0x10bcbb355 WebKit::WebFrame::didReceivePolicyDecision(unsigned long long, WebKit::PolicyDecision&&) 25 0x10b8553b3 decltype(auto) std::__1::apply[abi:sn200100]<WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WebCore::ResourceResponse const&, WebCore::FormState*, WTF::String const&, std::__1::optional<WTF::ObjectIdentifierGeneric<WebCore::NavigationIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>>, std::__1::optional<WebCore::HitTestResult>&&, bool, WebCore::NavigationUpgradeToHTTPSBehavior, WTF::OptionSet<WebCore::SandboxFlag, (WTF::ConcurrencyTag)0>, WebCore::PolicyDecisionMode, WTF::CompletionHandler<void (WebCore::PolicyAction)>&&)::$_1, std::__1::tuple<WebKit::PolicyDecision>>(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WebCore::ResourceResponse const&, WebCore::FormState*, WTF::String const&, std::__1::optional<WTF::ObjectIdentifierGeneric<WebCore::NavigationIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>>, std::__1::optional<WebCore::HitTestResult>&&, bool, WebCore::NavigationUpgradeToHTTPSBehavior, WTF::OptionSet<WebCore::SandboxFlag, (WTF::ConcurrencyTag)0>, WebCore::PolicyDecisionMode, WTF::CompletionHandler<void (WebCore::PolicyAction)>&&)::$_1&&, std::__1::tuple<WebKit::PolicyDecision>&&) 26 0x10b855297 WTF::Detail::CallableWrapper<WTF::CompletionHandler<void (IPC::Connection*, IPC::Decoder*)> IPC::Connection::makeAsyncReplyCompletionHandler<Messages::WebPageProxy::DecidePolicyForNavigationActionAsync, WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WebCore::ResourceResponse const&, WebCore::FormState*, WTF::String const&, std::__1::optional<WTF::ObjectIdentifierGeneric<WebCore::NavigationIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>>, std::__1::optional<WebCore::HitTestResult>&&, bool, WebCore::NavigationUpgradeToHTTPSBehavior, WTF::OptionSet<WebCore::SandboxFlag, (WTF::ConcurrencyTag)0>, WebCore::PolicyDecisionMode, WTF::CompletionHandler<void (WebCore::PolicyAction)>&&)::$_1>(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WebCore::ResourceResponse const&, WebCore::FormState*, WTF::String const&, std::__1::optional<WTF::ObjectIdentifierGeneric<WebCore::NavigationIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>>, std::__1::optional<WebCore::HitTestResult>&&, bool, WebCore::NavigationUpgradeToHTTPSBehavior, WTF::OptionSet<WebCore::SandboxFlag, (WTF::ConcurrencyTag)0>, WebCore::PolicyDecisionMode, WTF::CompletionHandler<void (WebCore::PolicyAction)>&&)::$_1&&, WTF::ThreadLikeAssertion)::'lambda'(IPC::Connection*, IPC::Decoder*), void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*) 27 0x10b9b6314 IPC::Connection::dispatchMessage(IPC::Decoder&) 28 0x10b9b6472 IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) 29 0x10b9b65bd IPC::Connection::dispatchOneIncomingMessage() 30 0x10e661ce2 WTF::RunLoop::performWork() 31 0x10e662c42 WTF::RunLoop::performWork(void*)
Fujii Hironori
Comment 4
2026-03-17 00:33:41 PDT
On the other hand, in GTK port, AsyncScrollingCoordinator::requestScrollToPosition returns early because scrollingNodeID is null. RenderLayerBacking is not created yet.
Fujii Hironori
Comment 5
2026-03-17 00:34:33 PDT
In Mac port, RenderLayerBacking was created in the following backtrace. 1 0x5ad4e34b2 WebCore::RenderLayer::ensureBacking() 2 0x5ad5041a4 WebCore::RenderLayerCompositor::updateBacking(WebCore::RenderLayer&, WebCore::RenderLayerCompositor::RequiresCompositingData&, WebCore::RenderLayerCompositor::BackingSharingState*, WebCore::RenderLayerCompositor::BackingRequired) 3 0x5ad500a18 WebCore::RenderLayerCompositor::computeCompositingRequirements(WebCore::RenderLayer*, WebCore::RenderLayer&, WebCore::LayerOverlapMap&, WebCore::RenderLayerCompositor::CompositingState&, WebCore::RenderLayerCompositor::BackingSharingState&) 4 0x5ad4feba2 WebCore::RenderLayerCompositor::updateCompositingLayers(WebCore::CompositingUpdateType, WebCore::RenderLayer*) 5 0x5acfb25e1 WebCore::LocalFrameViewLayoutContext::updateCompositingLayersAfterLayoutIfNeeded() 6 0x5aca183d0 WebCore::Document::updateLayout(WTF::OptionSet<WebCore::LayoutOptions, (WTF::ConcurrencyTag)0>, WebCore::Element const*) 7 0x5acfce021 WebCore::Page::setPageScaleFactor(float, WebCore::IntPoint const&, bool) 8 0x5adffaee2 WebCore::HistoryController::restoreScrollPositionAndViewState() (...)
Fujii Hironori
Comment 6
2026-03-17 00:41:21 PDT
In GTK port, Page::setPageScaleFactor doesn't call Document::updateLayoutIgnorePendingStylesheets because the scroll potion is already restored there.
https://github.com/WebKit/WebKit/blob/a15c64e664f4593adff3723715831074870388d7/Source/WebCore/page/Page.cpp#L1644-L1645
The scroll position was restored by scrollToFocusedElementImmediatelyIfNeeded called by HistoryController::restoreScrollPositionAndViewState.
https://github.com/WebKit/WebKit/blob/a15c64e664f4593adff3723715831074870388d7/Source/WebCore/loader/HistoryController.cpp#L180
Fujii Hironori
Comment 7
2026-03-17 00:51:34 PDT
In Mac port, LocalFrameView::scrollToFocusedElementImmediatelyIfNeeded did nothing because m_shouldScrollToFocusedElement was false. LocalFrameView::scheduleScrollToFocusedElement wasn't called. In CachedPage::restore, focusedDocument->focusedElement() returned null. element->updateFocusAppearance() was not called. In GTK port, focusedDocument->focusedElement() returned an element. This patch works around the missing tile problem and all 3 problems in
comment#0
. diff --git a/Source/WebCore/history/CachedPage.cpp b/Source/WebCore/history/CachedPage.cpp index 45e27e1bbdca..884de6a3aa69 100644 --- a/Source/WebCore/history/CachedPage.cpp +++ b/Source/WebCore/history/CachedPage.cpp @@ -138,7 +138,7 @@ void CachedPage::restore(Page& page) return; RefPtr focusedDocument = focusedOrMainFrame->document(); - if (RefPtr element = focusedDocument->focusedElement()) { + if (RefPtr element = focusedDocument->focusedElement(); 0) { #if PLATFORM(IOS_FAMILY) // We don't want focused nodes changing scroll position when restoring from the cache // as it can cause ugly jumps before we manage to restore the cached position.
Fujii Hironori
Comment 8
2026-03-17 05:22:22 PDT
In Mac port, the focused element was cleared by clicking "step 2" with the following backtrace. 1 0x1cddf4836 WebCore::Document::setFocusedElement(WebCore::Element*, WebCore::FocusOptions const&, WebCore::BroadcastFocusedElement) 2 0x1cddf5137 WebCore::Document::setFocusedElement(WebCore::Element*, WebCore::BroadcastFocusedElement) 3 0x1ce04b596 WebCore::FocusController::setFocusedElement(WebCore::Element*, WebCore::Frame*, WebCore::FocusOptions const&, WebCore::BroadcastFocusedElement) 4 0x1ce04aa21 WebCore::EventHandler::dispatchMouseEvent(WTF::AtomString const&, WebCore::Node*, int, WebCore::PlatformMouseEvent const&, WebCore::EventHandler::FireMouseOverOut) 5 0x1ccf60d99 WebCore::EventHandler::handleMousePressEvent(WebCore::PlatformMouseEvent const&) 6 0x1bc52b12a WebKit::WebFrame::handleMouseEvent(WebKit::WebMouseEvent const&) 7 0x1bc53b36c WebKit::WebPage::mouseEvent(WTF::ObjectIdentifierGeneric<WebCore::FrameIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>, WebKit::WebMouseEvent const&, std::__1::optional<WTF::Vector<WebKit::SandboxExtensionHandle, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>>&&) 8 0x1bc73fdf3 WebKit::WebPage::didReceiveMessage(IPC::Connection&, IPC::Decoder&) (.cold.29) 9 0x1bbdcf6d9 WebKit::WebPage::didReceiveMessage(IPC::Connection&, IPC::Decoder&) 10 0x1bc66d434 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) 11 0x1bc0c7628 WebKit::AuxiliaryProcess::dispatchMessage(IPC::Connection&, IPC::Decoder&) 12 0x1bc6f527a WebKit::AuxiliaryProcess::didReceiveMessage(IPC::Connection&, IPC::Decoder&) 13 0x1bc6692d5 IPC::Connection::dispatchMessage(IPC::Decoder&) 14 0x1bc669472 IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) 15 0x1bc6695bd IPC::Connection::dispatchOneIncomingMessage() 16 0x1c1df6ce2 WTF::RunLoop::performWork() 17 0x1c1df7c42 WTF::RunLoop::performWork(void*) 18 0x7ff8152f358d __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 19 0x7ff8152f352f __CFRunLoopDoSource0 20 0x7ff8152f32ea __CFRunLoopDoSources0 21 0x7ff8152f2000 __CFRunLoopRun 22 0x7ff8153a48f0 _CFRunLoopRunSpecificWithOptions 23 0x7ff81700aea7 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 24 0x7ff816584e9b -[NSRunLoop(NSRunLoop) run] 25 0x7ff814f2d4d1 _xpc_objc_main 26 0x7ff814f3be4a _xpc_main 27 0x7ff814f2d110 _xpc_copy_xpcservice_dictionary 28 0x1bbd7e96c WebKit::XPCServiceMain(int, char const**) 29 0x7ff814e7c781 start
Fujii Hironori
Comment 9
2026-03-17 05:25:51 PDT
HTMLAnchorElement::isMouseFocusable() has #if !(PLATFORM(GTK) || PLATFORM(WPE)). This causes the problems.
247257@main
added the #if.
https://github.com/WebKit/WebKit/blob/a49c8344113d1f6aa82d9d37738db76245917c1a/Source/WebCore/html/HTMLAnchorElement.cpp#L110-L114
Fujii Hironori
Comment 10
2026-03-17 19:32:29 PDT
This is reproducible with Safari with tabindex. Filed
bug#310153
.
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