⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 270544 in webkit


Ignore:
Timestamp:
Dec 8, 2020, 10:25:26 AM (6 years ago)
Author:
Antti Koivisto
Message:

[LFC][Integration] Invalidate line layout path for children of inlines
https://bugs.webkit.org/show_bug.cgi?id=219639

Reviewed by Zalan Bujtas.

We currently assume you can just invalidate the direct parent.

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::blockContainer):
(WebCore::LayoutIntegration::LineLayout::containing):

  • layout/integration/LayoutIntegrationLineLayout.h:
  • rendering/RenderObject.cpp:

(WebCore::RenderObject::insertedIntoTree):
(WebCore::RenderObject::willBeRemovedFromTree):

Invalidate here.

  • rendering/RenderText.cpp:

(WebCore::RenderText::setText):

  • rendering/updating/RenderTreeBuilder.cpp:

(WebCore::RenderTreeBuilder::attachToRenderElementInternal):

  • rendering/updating/RenderTreeBuilderBlock.cpp:

(WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::Block::detach):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r270541 r270544  
     12020-12-08  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Invalidate line layout path for children of inlines
     4        https://bugs.webkit.org/show_bug.cgi?id=219639
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        We currently assume you can just invalidate the direct parent.
     9
     10        * layout/integration/LayoutIntegrationLineLayout.cpp:
     11        (WebCore::LayoutIntegration::LineLayout::blockContainer):
     12        (WebCore::LayoutIntegration::LineLayout::containing):
     13        * layout/integration/LayoutIntegrationLineLayout.h:
     14        * rendering/RenderObject.cpp:
     15        (WebCore::RenderObject::insertedIntoTree):
     16        (WebCore::RenderObject::willBeRemovedFromTree):
     17
     18        Invalidate here.
     19
     20        * rendering/RenderText.cpp:
     21        (WebCore::RenderText::setText):
     22        * rendering/updating/RenderTreeBuilder.cpp:
     23        (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
     24        * rendering/updating/RenderTreeBuilderBlock.cpp:
     25        (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
     26        (WebCore::RenderTreeBuilder::Block::detach):
     27
    1282020-12-08  Rob Buis  <rbuis@igalia.com>
    229
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r270485 r270544  
    6969LineLayout::~LineLayout() = default;
    7070
    71 LineLayout* LineLayout::containing(RenderObject& renderer)
    72 {
    73     if (!renderer.isInline())
    74         return nullptr;
    75 
     71RenderBlockFlow* LineLayout::blockContainer(RenderObject& renderer)
     72{
    7673    // FIXME: These fake renderers have their parent set but are not actually in the tree.
    7774    if (renderer.isReplica() || renderer.isRenderScrollbarPart())
     
    7976   
    8077    for (auto* parent = renderer.parent(); parent; parent = parent->parent()) {
     78        if (!parent->childrenInline())
     79            return nullptr;
    8180        if (is<RenderBlockFlow>(*parent))
    82             return downcast<RenderBlockFlow>(*parent).modernLineLayout();
    83         if (!is<RenderInline>(*parent))
    84             return nullptr;
    85     }
     81            return downcast<RenderBlockFlow>(parent);
     82    }
     83
     84    return nullptr;
     85}
     86
     87LineLayout* LineLayout::containing(RenderObject& renderer)
     88{
     89    if (!renderer.isInline())
     90        return nullptr;
     91
     92    if (auto* container = blockContainer(renderer))
     93        return container->modernLineLayout();
    8694
    8795    return nullptr;
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h

    r270539 r270544  
    5757    ~LineLayout();
    5858
     59    static RenderBlockFlow* blockContainer(RenderObject&);
    5960    static LineLayout* containing(RenderObject&);
    6061    static const LineLayout* containing(const RenderObject&);
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r270539 r270544  
    14671467void RenderObject::insertedIntoTree()
    14681468{
     1469    if (auto* container = LayoutIntegration::LineLayout::blockContainer(*this))
     1470        container->invalidateLineLayoutPath();
     1471
    14691472    // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
    14701473    if (!isFloating() && parent()->childrenInline())
     
    14741477void RenderObject::willBeRemovedFromTree()
    14751478{
     1479    if (auto* container = LayoutIntegration::LineLayout::blockContainer(*this))
     1480        container->invalidateLineLayoutPath();
     1481
    14761482    // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first.
    14771483    // Update cached boundaries in SVG renderers, if a child is removed.
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r270539 r270544  
    14621462    m_knownToHaveNoOverflowAndNoFallbackFonts = false;
    14631463
    1464     if (is<RenderBlockFlow>(*parent()))
    1465         downcast<RenderBlockFlow>(*parent()).invalidateLineLayoutPath();
     1464    if (auto* container = LayoutIntegration::LineLayout::blockContainer(*this))
     1465        container->invalidateLineLayoutPath();
    14661466   
    14671467    if (AXObjectCache* cache = document().existingAXObjectCache())
  • trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp

    r267180 r270544  
    461461    if (AXObjectCache* cache = parent.document().axObjectCache())
    462462        cache->childrenChanged(&parent, newChild);
    463     if (is<RenderBlockFlow>(parent))
    464         downcast<RenderBlockFlow>(parent).invalidateLineLayoutPath();
     463
    465464    if (parent.hasOutlineAutoAncestor() || parent.outlineStyleForRepaint().outlineStyleIsAuto() == OutlineIsAuto::On)
    466465        newChild->setHasOutlineAutoAncestor();
  • trunk/Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp

    r269954 r270544  
    244244    }
    245245
    246     parent.invalidateLineLayoutPath();
    247 
    248246    m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
    249247
     
    292290    auto next = makeWeakPtr(oldChild.nextSibling());
    293291    bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, prev.get(), next.get());
    294 
    295     parent.invalidateLineLayoutPath();
    296292
    297293    auto takenChild = m_builder.detachFromRenderElement(parent, oldChild);
Note: See TracChangeset for help on using the changeset viewer.