[webkit-changes] [WebKit/WebKit] 58d446: [content-visibility] Optimize lazy layout

Rob Buis noreply at github.com
Mon Feb 12 14:13:12 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 58d4460957a8b92c7109bddc65c5972a556aceb2
      https://github.com/WebKit/WebKit/commit/58d4460957a8b92c7109bddc65c5972a556aceb2
  Author: Rob Buis <rbuis at igalia.com>
  Date:   2024-02-12 (Mon, 12 Feb 2024)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-getboundingclientrect-on-children-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-getboundingclientrect-on-children.html
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderElement.h
    M Source/WebCore/rendering/RenderElementInlines.h
    M Source/WebCore/rendering/RenderGrid.cpp
    M Source/WebCore/rendering/RenderObject.cpp
    M Source/WebCore/rendering/RenderObject.h

  Log Message:
  -----------
  [content-visibility] Optimize lazy layout
https://bugs.webkit.org/show_bug.cgi?id=263327

Reviewed by Alan Baradlay.

Keep track of whether a hidden content-visibility subtree has been laid out using a dedicated bit
named everHadSkippedContentLayout, and only force layout if everHadSkippedContentLayout is false.
In order to make clearNeedsLayoutForSkippedContent work correctly the everHadSkippedContentLayout
bit is cleared for the whole content-visibility subtree.

This patch also merges isSkippedContentRootForLayout and isSkippedContentRoot since it was not
always clear which one to call and was a source of bugs. The new behaviour is now to always take layout into
account, but for size containment related code the static WebCore::isSkippedContentRoot is used
that does not take layout into account since size containment determination should be invariant to (forced) layout.

The test content-visibility-getboundingclientrect-on-children.html is added to verify layout is forced
only once for subtrees.

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




More information about the webkit-changes mailing list