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

Changeset 254568 in webkit


Ignore:
Timestamp:
Jan 15, 2020, 7:46:09 AM (7 years ago)
Author:
Antti Koivisto
Message:

[LFC][Integration] Call SimpleLineLayout::canUseFor only once
​https://bugs.webkit.org/show_bug.cgi?id=206281

Reviewed by Sam Weinig.

It can be somewhat costly.

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::canUseFor):

  • layout/integration/LayoutIntegrationLineLayout.h:

(WebCore::LayoutIntegration::LineLayout::canUseFor):

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::layoutInlineChildren):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r254567 r254568  
     12020-01-15  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Call SimpleLineLayout::canUseFor only once
     4        https://bugs.webkit.org/show_bug.cgi?id=206281
     5
     6        Reviewed by Sam Weinig.
     7
     8        It can be somewhat costly.
     9
     10        * layout/integration/LayoutIntegrationLineLayout.cpp:
     11        (WebCore::LayoutIntegration::LineLayout::canUseFor):
     12        * layout/integration/LayoutIntegrationLineLayout.h:
     13        (WebCore::LayoutIntegration::LineLayout::canUseFor):
     14        * rendering/RenderBlockFlow.cpp:
     15        (WebCore::RenderBlockFlow::layoutInlineChildren):
     16
    1172020-01-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    218
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r254378 r254568  
    5959LineLayout::~LineLayout() = default;
    6060
    61 bool LineLayout::canUseFor(const RenderBlockFlow& flow)
     61bool LineLayout::canUseFor(const RenderBlockFlow& flow, Optional<bool> couldUseSimpleLineLayout)
    6262{
    6363    if (!RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled())
    … …  
    6565
    6666    // Initially only a subset of SLL features is supported.
    67     if (!SimpleLineLayout::canUseFor(flow))
     67    auto passesSimpleLineLayoutTest = valueOrCompute(couldUseSimpleLineLayout, [&] {
     68        return SimpleLineLayout::canUseFor(flow);
     69    });
     70
     71    if (!passesSimpleLineLayoutTest)
    6872        return false;
    6973
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h

    r254378 r254568  
    5959    ~LineLayout();
    6060
    61     static bool canUseFor(const RenderBlockFlow&);
     61    static bool canUseFor(const RenderBlockFlow&, Optional<bool> couldUseSimpleLineLayout = { });
    6262
    6363    void updateStyle();
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r254378 r254568  
    670670{
    671671    auto computeLineLayoutPath = [&] {
     672        bool canUseSimpleLines = SimpleLineLayout::canUseFor(*this);
    672673#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    673         if (LayoutIntegration::LineLayout::canUseFor(*this))
     674        if (LayoutIntegration::LineLayout::canUseFor(*this, canUseSimpleLines))
    674675            return LayoutFormattingContextPath;
    675676#endif
    676         if (SimpleLineLayout::canUseFor(*this))
     677        if (canUseSimpleLines)
    677678            return SimpleLinesPath;
     679
    678680        return LineBoxesPath;
    679681    };
Note: See TracChangeset for help on using the changeset viewer.