Changeset 252543 in webkit


Ignore:
Timestamp:
Nov 18, 2019 9:13:51 AM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC][Invalidation] Do not collect inline items multiple times
https://bugs.webkit.org/show_bug.cgi?id=204296
<rdar://problem/57283761>

Reviewed by Antti Koivisto.

When inline layout is preceded by preferred width computation, we don't need to re-collect the inline items again.

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
(WebCore::Layout::InlineFormattingContext::collectInlineContent): Deleted.

  • layout/inlineformatting/InlineFormattingContext.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252542 r252543  
     12019-11-18  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Invalidation] Do not collect inline items multiple times
     4        https://bugs.webkit.org/show_bug.cgi?id=204296
     5        <rdar://problem/57283761>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        When inline layout is preceded by preferred width computation, we don't need to re-collect the inline items again.
     10
     11        * layout/inlineformatting/InlineFormattingContext.cpp:
     12        (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
     13        (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
     14        (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
     15        (WebCore::Layout::InlineFormattingContext::collectInlineContent): Deleted.
     16        * layout/inlineformatting/InlineFormattingContext.h:
     17
    1182019-11-18  Philippe Normand  <pnormand@igalia.com>
    219
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r252531 r252543  
    8585    }
    8686
    87     collectInlineContent();
     87    collectInlineContentIfNeeded();
    8888    lineLayout(usedHorizontalValues);
    8989    LOG_WITH_STREAM(FormattingContextLayout, stream << "[End] -> inline formatting context -> formatting root(" << &root() << ")");
     
    211211    }
    212212
    213     collectInlineContent();
     213    collectInlineContentIfNeeded();
    214214
    215215    auto maximumLineWidth = [&](auto availableWidth) {
     
    322322}
    323323
    324 void InlineFormattingContext::collectInlineContent()
    325 {
     324void InlineFormattingContext::collectInlineContentIfNeeded()
     325{
     326    auto& formattingState = this->formattingState();
     327    if (!formattingState.inlineItems().isEmpty())
     328        return;
    326329    // Traverse the tree and create inline items out of containers and leaf nodes. This essentially turns the tree inline structure into a flat one.
    327330    // <span>text<span></span><img></span> -> [ContainerStart][InlineBox][ContainerStart][ContainerEnd][InlineBox][ContainerEnd]
    328     auto& formattingState = this->formattingState();
    329331    LayoutQueue layoutQueue;
    330332    if (root().hasInFlowOrFloatingChild())
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h

    r252531 r252543  
    8989    void computeWidthAndMargin(const Box&, UsedHorizontalValues);
    9090
    91     void collectInlineContent();
     91    void collectInlineContentIfNeeded();
    9292    Line::InitialConstraints initialConstraintsForLine(UsedHorizontalValues, const LayoutUnit lineLogicalTop);
    9393    void setDisplayBoxesForLine(const LineLayout::LineContent&, UsedHorizontalValues);
Note: See TracChangeset for help on using the changeset viewer.