Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6f39fe014f9a15fe870b42b1352fa15957dc2693
      
https://github.com/WebKit/WebKit/commit/6f39fe014f9a15fe870b42b1352fa15957dc2693
  Author: Alan Baradlay <za...@apple.com>
  Date:   2024-04-07 (Sun, 07 Apr 2024)

  Changed paths:
    M LayoutTests/fast/repaint/full-repaint-on-content-change-expected.txt
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/RenderListMarker.cpp
    M Source/WebCore/rendering/RenderObject.cpp
    M Source/WebCore/rendering/RenderTableCol.cpp
    M Source/WebCore/rendering/RenderTableRow.cpp
    M Source/WebCore/rendering/RenderTableSection.cpp
    M Source/WebCore/rendering/svg/RenderSVGImage.cpp
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGImage.cpp
    M Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
    M Source/WebCore/rendering/updating/RenderTreeBuilder.h

  Log Message:
  -----------
  Repaint should only be called on attached renderers
https://bugs.webkit.org/show_bug.cgi?id=272292

Reviewed by Antti Koivisto.

1. In some cases (e.g. pseudo content) a subtree root gets detached first 
followed by the descendant renderers
2. Repaint functions start with traversing all the way to the RenderView just 
to check if dispatching repaint is safe -which in most cases comes back true 
(normal at-layout repaint, invalidation, standard tree teardown)

This patch fixes a correctness and a performance issue:

correctness: In case of #1, when calling willBeRemovedFromTree() (right before 
deleting the descendant renderer), the renderer is
already detached from the render tree. It is still attached to the root of the 
subtree (which is already detached), but has no access to the rest of the 
render tree (i.e. willBeRemovedFromTree is technically just 
willBeRemovedFromParent)

performance: ensuring correctness eliminates the need for checking if the 
renderer is still attached.

(Sadly ::imageChanged gets called indirectly through initializeStyle before the 
initial attach)

* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::repaint const): Use isDescendantOf instead of 
isRooted() as I am planning on completely remove isRooted().
(WebCore::RenderObject::repaintRectangle const):
(WebCore::RenderObject::repaintSlowRepaintObject const):
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::destroy):
(WebCore::RenderTreeBuilder::detachFromRenderElement):
* Source/WebCore/rendering/updating/RenderTreeBuilder.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to