Skip to content

Commit

Permalink
[CoordinatedGraphics] Setting LocalFrameView's content size should …
Browse files Browse the repository at this point in the history
…not require relayout

https://bugs.webkit.org/show_bug.cgi?id=270445

Reviewed by Darin Adler.

In `LocalFrameViewLayoutContext::performLayout()` we layout the render
tree in several phases:

- `LayoutPhase::InPreLayout`
- `LayoutPhase::InRenderTreeLayout`
- `LayoutPhase::InViewSizeAdjust`
- `LayoutPhase::InPostLayout`

In the last phase, we assert that the layout root doesn't require
relayout after updating `LocalFrameView`'s content size.

Currently, at the end of `LayerTreeHost::contentsSizeChanged()` we call
`didChangeViewport()`, which in some circumstances (e.g. when fixed
layout is used) can trigger
`LocalFrameView::setViewportConstrainedObjectsNeedLayout()` and make
`RenderView::needsLayout()` return `true`. This should not happen.

* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::contentsSizeChanged):

Canonical link: https://commits.webkit.org/276079@main
  • Loading branch information
obyknovenius committed Mar 14, 2024
1 parent 93f08f0 commit 7c138c8
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ GraphicsLayerFactory* LayerTreeHost::graphicsLayerFactory()
void LayerTreeHost::contentsSizeChanged(const IntSize& newSize)
{
m_viewportController.didChangeContentsSize(newSize);
didChangeViewport();
}

void LayerTreeHost::didChangeViewportAttributes(ViewportAttributes&& attr)
Expand Down

0 comments on commit 7c138c8

Please sign in to comment.