Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7ca23d97bf74d73cef04215026d9f49591e639c4
      
https://github.com/WebKit/WebKit/commit/7ca23d97bf74d73cef04215026d9f49591e639c4
  Author: Simon Fraser <[email protected]>
  Date:   2025-10-22 (Wed, 22 Oct 2025)

  Changed paths:
    M 
LayoutTests/fast/repaint/hidpi-content-inside-iframe-leaves-trails-expected.txt
    M LayoutTests/fast/repaint/hidpi-content-inside-iframe-leaves-trails.html
    M LayoutTests/fast/repaint/iframe-on-subpixel-position-expected.txt
    M 
LayoutTests/platform/mac-sequoia-wk2/fast/repaint/iframe-on-subpixel-position-expected.txt
    M 
LayoutTests/platform/mac-wk2/fast/repaint/iframe-on-subpixel-position-expected.txt
    M Source/WebCore/rendering/RenderView.cpp
    M Source/WebCore/rendering/RenderView.h

  Log Message:
  -----------
  Batch repaints in non-composited iframes
https://bugs.webkit.org/show_bug.cgi?id=301161
rdar://163085959

Reviewed by Alan Baradlay.

RenderView already has some repaint batching logic in the form of 
RepaintRegionAccumulator,
which was added for WebKit1 to avoid the overhead of calling into NSView for 
each repaint;
it only kicks in for the root RenderView in WebKit1, because of the 
`isTopDocument()`
check, and the fact that only WebKit1 calls 
`RenderView::repaintViewRectangle()` for
the root (this is never called for composited frames, where repainting goes to 
a GraphicsLayer).

We can leverage this code for repaints in non-composited iframes by removing 
the `isTopDocument()`
check, and ensuring that when we flush the region, we call 
`iframeOwnerRenderer->repaintRectangle()`.

In addition, we add some logic to detect when at least 75% of the area of the 
iframe has been
repainted, and then dirty the entire view, also calling 
`layoutContext().setNeedsFullRepaint()`
which cuts off subsequent repaints. As before, we know this is OK to do because 
this iframe has
no compositing layers.

* 
LayoutTests/fast/repaint/hidpi-content-inside-iframe-leaves-trails-expected.txt:
* LayoutTests/fast/repaint/hidpi-content-inside-iframe-leaves-trails.html:
* LayoutTests/fast/repaint/iframe-on-subpixel-position-expected.txt:
* 
LayoutTests/platform/mac-sequoia-wk2/fast/repaint/iframe-on-subpixel-position-expected.txt:
* 
LayoutTests/platform/mac-wk2/fast/repaint/iframe-on-subpixel-position-expected.txt:
* Source/WebCore/rendering/RenderView.cpp:
(WebCore::RenderView::repaintViewRectangle):
(WebCore::RenderView::accumulateRepaintRect):
(WebCore::RenderView::flushAccumulatedRepaintRegion const):
(WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
(WebCore::RenderView::RepaintRegionAccumulator::~RepaintRegionAccumulator):
(WebCore::RenderView::repaintViewRectangle const): Deleted.
* Source/WebCore/rendering/RenderView.h:

Canonical link: https://commits.webkit.org/301964@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to