[webkit-changes] [WebKit/WebKit] 2172f7: getBoundingClientRect spends time flushing layout ...

mattwoodrow noreply at github.com
Sun Feb 23 14:52:10 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2172f7b5f9f2ae8cd4ab6795400b6d3eb6c61f94
      https://github.com/WebKit/WebKit/commit/2172f7b5f9f2ae8cd4ab6795400b6d3eb6c61f94
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2025-02-23 (Sun, 23 Feb 2025)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/contain-paint-offscreen-container-expected.txt
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/Element.cpp

  Log Message:
  -----------
  getBoundingClientRect spends time flushing layout even if the current layout state is sufficiently valid.
https://bugs.webkit.org/show_bug.cgi?id=287880
<rdar://145082013>

Reviewed by Alan Baradlay.

Extends updateLayoutIfDimensionsOutOfDate to pass through LayoutOptions to the
final layout if required.

Adds Top and Left options, and rejects the fast path if any ancestor requires
position movement layout (on top of any ancestor requiring normal self layout).

Allows updateLayoutIfDimensionsOutOfDate to succeed if the queried renderer
requires only simplified layout, and it will succeed.

Start using updateLayoutIfDimensionsOutOfDate for getBoundingClientRect.

Moves a check from RenderBlock::simplifiedLayout() to
RenderBlock::canPerformSimplifiedLayout() (and make the latter public) so that
it correctly determines if the simplified layout will succeed.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
* Source/WebCore/dom/Document.h:
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::boundingClientRect):
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::canPerformSimplifiedLayout const):
(WebCore::RenderBlock::simplifiedLayout):
* Source/WebCore/rendering/RenderBlock.h:

Canonical link: https://commits.webkit.org/290922@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