[webkit-changes] [WebKit/WebKit] abd0e9: RepaintRects need to be recomputed when state chan...

Simon Fraser noreply at github.com
Tue Dec 10 08:55:53 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: abd0e960c37bcf3ba63944e9544bffb45be80722
      https://github.com/WebKit/WebKit/commit/abd0e960c37bcf3ba63944e9544bffb45be80722
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-12-10 (Tue, 10 Dec 2024)

  Changed paths:
    M Source/WebCore/page/LocalFrameViewLayoutContext.cpp
    M Source/WebCore/page/LocalFrameViewLayoutContext.h
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderLayer.h
    M Source/WebCore/rendering/RenderObject.h

  Log Message:
  -----------
  RepaintRects need to be recomputed when state changes that affects them
https://bugs.webkit.org/show_bug.cgi?id=284351
rdar://141198097

Reviewed by Alan Baradlay.

With the PR in bug 267252 applied, these two tests hit assertions in repaint rect
verification (RenderLayer.cpp:1230):

imported/blink/fast/hidpi/border-background-align.html
printing/iframe-print.html

This is because bug 267252 eliminates a layout that happens when the state of `isPrinting`
or deviceScaleFactor changes, so `updateLayerPositions()` doesn't do a full traversal, and
we don't recompute new repaint rects.

printing/iframe-print.html asserts because the return value of `RenderView::computeVisibleRectsInContainer()`
is affecting by printing.
imported/blink/fast/hidpi/border-background-align.html asserts because `deviceScaleFactor` affects rect rounding.

Fix by tracking these in `RepaintRectEnvironment` in LocalFrameViewLayoutContext, and when they change, forcing
a full RenderLayer traversal via a new flag added to `invalidationLayerPositionsFlags()`.

* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::LocalFrameViewLayoutContext::flushUpdateLayerPositions):
* Source/WebCore/page/LocalFrameViewLayoutContext.h:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updateLayerPositionsAfterLayout):
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderObject.h: Fix typo

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



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


More information about the webkit-changes mailing list