Changeset 252735 in webkit


Ignore:
Timestamp:
Nov 21, 2019 8:32:09 AM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC] Add support for LFC layout only.
https://bugs.webkit.org/show_bug.cgi?id=204441
<rdar://problem/57382929>

Reviewed by Antti Koivisto.

Clean up the render tree state when RenderView::layout is not called.

  • page/FrameViewLayoutContext.cpp:

(WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):

  • rendering/updating/RenderTreeUpdater.cpp:

(WebCore::RenderTreeUpdater::updateRendererStyle):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252732 r252735  
     12019-11-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Add support for LFC layout only.
     4        https://bugs.webkit.org/show_bug.cgi?id=204441
     5        <rdar://problem/57382929>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Clean up the render tree state when RenderView::layout is not called.
     10
     11        * page/FrameViewLayoutContext.cpp:
     12        (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
     13        * rendering/updating/RenderTreeUpdater.cpp:
     14        (WebCore::RenderTreeUpdater::updateRendererStyle):
     15
    1162019-11-21  Andres Gonzalez  <andresg_22@apple.com>
    217
  • trunk/Source/WebCore/page/FrameViewLayoutContext.cpp

    r252534 r252735  
    4141#include "Settings.h"
    4242#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     43#include "DisplayBox.h"
    4344#include "InvalidationContext.h"
    4445#include "InvalidationState.h"
     
    4647#include "LayoutState.h"
    4748#include "LayoutTreeBuilder.h"
     49#include "RenderDescendantIterator.h"
    4850#endif
    4951
     
    6062        return;
    6163
     64    auto& renderView = *this->renderView();
    6265    if (!m_layoutTreeContent) {
    63         m_layoutTreeContent = Layout::TreeBuilder::buildLayoutTree(*renderView());
     66        m_layoutTreeContent = Layout::TreeBuilder::buildLayoutTree(renderView);
    6467        // FIXME: New layout tree requires a new state for now.
    6568        m_layoutState = nullptr;
     
    7477
    7578    auto layoutContext = Layout::LayoutContext { *m_layoutState };
    76     layoutContext.layout(renderView()->size(), invalidationState);
     79    layoutContext.layout(view().layoutSize(), invalidationState);
     80
     81    // Clean up the render tree state when we don't run RenderView::layout.
     82    if (renderView.needsLayout()) {
     83        auto contentSize = m_layoutState->displayBoxForLayoutBox(*m_layoutState->root().firstChild()).size();
     84        renderView.setSize(contentSize);
     85        renderView.repaintViewRectangle({ 0, 0, contentSize.width(), contentSize.height() });
     86
     87        for (auto& descendant : descendantsOfType<RenderObject>(renderView))
     88            descendant.clearNeedsLayout();
     89        renderView.clearNeedsLayout();
     90    }
     91
    7792#ifndef NDEBUG
    7893    Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree(*m_layoutState);
  • trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp

    r252638 r252735  
    298298#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    299299    if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextEnabled()) {
    300         if (!m_document.view() || !m_document.view()->layoutContext().layoutFormattingState())
     300        if (!m_document.view() || !m_document.view()->layoutContext().layoutTreeContent())
    301301            return;
    302302        if (auto* layoutBox = m_document.view()->layoutContext().layoutTreeContent()->layoutBoxForRenderer(renderer))
Note: See TracChangeset for help on using the changeset viewer.