Skip to content

Commit

Permalink
[LFC] Remove unsupported (and broken) LayoutContext::layout codepath
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260142

Reviewed by Antti Koivisto.

Full LFC codepath has not been maintained for a while now (integration codepath is slowly taking over).

* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::LocalFrameViewLayoutContext::performLayout):
(WebCore::LocalFrameViewLayoutContext::layoutUsingFormattingContext): Deleted.
* Source/WebCore/page/LocalFrameViewLayoutContext.h:
(WebCore::LocalFrameViewLayoutContext::enablePaintOffsetCache):

Canonical link: https://commits.webkit.org/266895@main
  • Loading branch information
alanbaradlay committed Aug 15, 2023
1 parent 92e85e0 commit f8811c9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
33 changes: 0 additions & 33 deletions Source/WebCore/page/LocalFrameViewLayoutContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,6 @@ namespace WebCore {
UpdateScrollInfoAfterLayoutTransaction::UpdateScrollInfoAfterLayoutTransaction() = default;
UpdateScrollInfoAfterLayoutTransaction::~UpdateScrollInfoAfterLayoutTransaction() = default;

void LocalFrameViewLayoutContext::layoutUsingFormattingContext()
{
if (!frame().settings().layoutFormattingContextEnabled())
return;
// LocalFrameView::setContentsSize temporary disables layout.
if (m_disableSetNeedsLayoutCount)
return;

m_layoutState = nullptr;
m_layoutTree = nullptr;

auto& renderView = *this->renderView();
m_layoutTree = Layout::TreeBuilder::buildLayoutTree(renderView);
m_layoutState = makeUnique<Layout::LayoutState>(*document(), m_layoutTree->root());
auto layoutContext = Layout::LayoutContext { *m_layoutState };
layoutContext.layout(view().layoutSize());

// Clean up the render tree state when we don't run RenderView::layout.
if (renderView.needsLayout()) {
auto contentSize = Layout::BoxGeometry::marginBoxRect(m_layoutState->geometryForBox(*m_layoutState->root().firstChild())).size();
renderView.setSize(contentSize);
renderView.repaintViewRectangle({ 0, 0, contentSize.width(), contentSize.height() });

for (auto& descendant : descendantsOfType<RenderObject>(renderView))
descendant.clearNeedsLayout();
renderView.clearNeedsLayout();
}
#if ASSERT_ENABLED
Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree(*m_layoutState, renderView);
#endif
}

static bool isObjectAncestorContainerOf(RenderElement& ancestor, RenderElement& descendant)
{
for (auto* renderer = &descendant; renderer; renderer = renderer->container()) {
Expand Down Expand Up @@ -266,7 +234,6 @@ void LocalFrameViewLayoutContext::performLayout()
RenderTreeNeedsLayoutChecker checker(*renderView());
#endif
layoutRoot->layout();
layoutUsingFormattingContext();
++m_layoutCount;
#if ENABLE(TEXT_AUTOSIZING)
applyTextSizingIfNeeded(*layoutRoot.get());
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/page/LocalFrameViewLayoutContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ class LocalFrameViewLayoutContext {
// These functions may only be accessed by LayoutStateMaintainer or LayoutStateDisabler.
void disablePaintOffsetCache() { m_paintOffsetCacheDisableCount++; }
void enablePaintOffsetCache() { ASSERT(m_paintOffsetCacheDisableCount > 0); m_paintOffsetCacheDisableCount--; }
void layoutUsingFormattingContext();

LocalFrame& frame() const;
LocalFrameView& view() const;
Expand Down

0 comments on commit f8811c9

Please sign in to comment.