Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 99fe659f25c86d0ad5174c53809fa2388341e986
https://github.com/WebKit/WebKit/commit/99fe659f25c86d0ad5174c53809fa2388341e986
Author: Devin Rousso <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
A
LayoutTests/platform/gtk/non-compositing/reparent-view-without-damage-expected.txt
A LayoutTests/platform/gtk/non-compositing/reparent-view-without-damage.html
A LayoutTests/platform/gtk/reparent-view-without-damage-expected.txt
A LayoutTests/platform/gtk/reparent-view-without-damage.html
A LayoutTests/platform/gtk/resources/reparent-view-without-damage.js
M Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
M Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp
M Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h
M
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphicsGLib.cpp
M
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphicsGLib.h
M
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/NonCompositedFrameRenderer.cpp
M Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebView.cpp
M Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp
Log Message:
-----------
[GTK] skip non-composited frames without damage
https://bugs.webkit.org/show_bug.cgi?id=323978
Reviewed by Carlos Alberto Lopez Perez.
GTK can still (re)present frames even after `requestAnimationFrame` callbacks
with no rendering changes.
Removing that waste also exposes cases where GTK loses its displayed image
without any WebCore damage.
*
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/NonCompositedFrameRenderer.cpp:
(WebKit::NonCompositedFrameRenderer::updateRendering):
Skipping unnecessary frames must not stop animation callbacks or strand callers
waiting for an explicit repaint.
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h:
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp:
(WebKit::AcceleratedBackingStore::realize):
(WebKit::AcceleratedBackingStore::unrealize):
Removing and reinserting a view in one callback can coalesce visibility changes
(i.e. `resume` may never run).
Recovery must follow actual buffer loss without requesting another frame when
one is already pending.
* Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in:
*
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphicsGLib.h:
*
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphicsGLib.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::didDiscardBackingStore): Added.
The UIProcess knows when GTK lost the image even though the WebProcess owns
damage and rendering.
The missing picture requires full recovery, including when painting was
suspended.
* Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSnapshotFromWidget):
GTK events can invalidate the allocation during reparenting and attempting to
snapshot that state can cause a null PNG data dereference.
* LayoutTests/platform/gtk/non-compositing/reparent-view-without-damage.html:
Added.
*
LayoutTests/platform/gtk/non-compositing/reparent-view-without-damage-expected.txt:
Added.
* LayoutTests/platform/gtk/reparent-view-without-damage.html: Added.
* LayoutTests/platform/gtk/reparent-view-without-damage-expected.txt: Added.
* LayoutTests/platform/gtk/resources/reparent-view-without-damage.js: Added.
* Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::takeViewPortSnapshot):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebView.cpp:
(PresentationWebViewTest): Added.
(PresentationWebViewTest::PresentationWebViewTest): Added.
(PresentationWebViewTest::~PresentationWebViewTest): Added.
(PresentationWebViewTest::waitForColor): Added.
(PresentationWebViewTest::waitForNextFrame): Added.
(PresentationWebViewTest::waitForAnimationFrames): Added.
(PresentationWebViewTest::assertAnimationFramesWithoutDamage): Added.
(PresentationWebViewTest::loadPageForReparenting): Added.
(AcceleratedPresentationWebViewTest): Added.
(AcceleratedPresentationWebViewTest::AcceleratedPresentationWebViewTest): Added.
(testWebViewPresentationWithoutDamage): Added.
(testWebViewPresentationAfterReparentToNewWindow): Added.
(testWebViewPresentationAfterRapidReparent): Added.
(testWebViewPresentationAfterReparentDuringLoad): Added.
(testWebViewCloseAfterReparent): Added.
(beforeAll):
Canonical link: https://commits.webkit.org/321558@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications