Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9eb6ffd6f2c93fe5f650e207e402cff5370dce3e
https://github.com/WebKit/WebKit/commit/9eb6ffd6f2c93fe5f650e207e402cff5370dce3e
Author: Matt Woodrow <[email protected]>
Date: 2024-07-22 (Mon, 22 Jul 2024)
Changed paths:
M Source/WebCore/dom/Document.cpp
M Source/WebCore/dom/Document.h
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/MouseRelatedEvent.cpp
M Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/LocalFrameView.h
M Source/WebCore/page/LocalFrameViewLayoutContext.cpp
M Source/WebCore/page/LocalFrameViewLayoutContext.h
M Source/WebCore/rendering/RenderElement.cpp
M Source/WebCore/rendering/RenderElement.h
M Source/WebCore/rendering/RenderLayer.cpp
M Source/WebCore/rendering/RenderLayer.h
M Source/WebCore/rendering/RenderLayerInlines.h
M Source/WebCore/rendering/RenderLayerScrollableArea.cpp
Log Message:
-----------
Speedometer 3: getBoundingClientRect spends time updating layer positions
that it doesn't use.
https://bugs.webkit.org/show_bug.cgi?id=276393
<rdar://131418297>
Reviewed by Simon Fraser.
Adds a new option to Document::updateLayout for callers to request that
updateLayerPositions
be deferred, and uses it for getBoundingClientRect.
Adds an assertion to RenderLayer::position/size() to make sure no code tries to
access
layers positions while in this new state.
The assert only covers the scope of getBoundingClientRect, since arbtirary
other code
can run next and might try to access the unflushed layer. This shouldn't be a
new concern
though, since `needsLayout` will be true, and the other code should already be
flushing layout
if it needs to access layer positions.
LocalFrameView::needsLayout now returns true if there's actual layout, or a
pending layer
flush, so that we flush the layers next time to we try to layout.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateLayout):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::boundingClientRect):
* Source/WebCore/dom/MouseRelatedEvent.cpp:
* Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::topContentInsetDidChange):
(WebCore::LocalFrameView::hasPendingUpdateLayerPositions const):
(WebCore::LocalFrameView::flushUpdateLayerPositions):
(WebCore::LocalFrameView::didLayout):
(WebCore::LocalFrameView::updateLayerPositionsAfterScrolling):
(WebCore::LocalFrameView::updateLayerPositionsAfterOverflowScroll):
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::LocalFrameViewLayoutContext::layout):
(WebCore::LocalFrameViewLayoutContext::performLayout):
(WebCore::LocalFrameViewLayoutContext::runOrScheduleAsynchronousTasks):
(WebCore::LocalFrameViewLayoutContext::needsLayout const):
(WebCore::LocalFrameViewLayoutContext::needsLayoutInternal const):
* Source/WebCore/page/LocalFrameViewLayoutContext.h:
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::didVisitSinceLayout const):
(WebCore::RenderElement::didVisitDuringLastLayout const): Deleted.
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositionsAfterStyleChange):
(WebCore::RenderLayer::updateLayerPositionsAfterLayout):
(WebCore::RenderLayer::recursiveUpdateLayerPositions):
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderLayerInlines.h:
(WebCore::RenderLayer::location const):
(WebCore::RenderLayer::size const):
(WebCore::RenderLayer::rect const):
* Source/WebCore/rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::scrollTo):
Canonical link: https://commits.webkit.org/281227@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes