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

Changeset 267468 in webkit


Ignore:
Timestamp:
Sep 23, 2020, 5:03:57 AM (6 years ago)
Author:
Antti Koivisto
Message:

[LFC][Integration] Add canUseFor functions
https://bugs.webkit.org/show_bug.cgi?id=216869

Reviewed by Zalan Bujtas.

Copy the SLL canUseFor code.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • layout/integration/LayoutIntegrationCoverage.cpp: Added.

(WebCore::LayoutIntegration::canUseForCharacter):
(WebCore::LayoutIntegration::canUseForText):
(WebCore::LayoutIntegration::canUseForFontAndText):
(WebCore::LayoutIntegration::canUseForStyle):
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
(WebCore::LayoutIntegration::canUseForLineLayout):
(WebCore::LayoutIntegration::canUseForLineLayoutAfterStyleChange):

  • layout/integration/LayoutIntegrationCoverage.h: Added.

Also switch to OptionSet.

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::isEnabled):
(WebCore::LayoutIntegration::LineLayout::canUseFor):
(WebCore::LayoutIntegration::LineLayout::canUseForAfterStyleChange):

  • layout/integration/LayoutIntegrationLineLayout.h:

(WebCore::LayoutIntegration::LineLayout::canUseFor): Deleted.

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::layoutInlineChildren):

Location:
trunk/Source/WebCore
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267465 r267468  
     12020-09-23  Antti Koivisto  <antti@apple.com>
     2
     3        [LFC][Integration] Add canUseFor functions
     4        https://bugs.webkit.org/show_bug.cgi?id=216869
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Copy the SLL canUseFor code.
     9
     10        * Sources.txt:
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * layout/integration/LayoutIntegrationCoverage.cpp: Added.
     13        (WebCore::LayoutIntegration::canUseForCharacter):
     14        (WebCore::LayoutIntegration::canUseForText):
     15        (WebCore::LayoutIntegration::canUseForFontAndText):
     16        (WebCore::LayoutIntegration::canUseForStyle):
     17        (WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
     18        (WebCore::LayoutIntegration::canUseForLineLayout):
     19        (WebCore::LayoutIntegration::canUseForLineLayoutAfterStyleChange):
     20        * layout/integration/LayoutIntegrationCoverage.h: Added.
     21
     22        Also switch to OptionSet.
     23
     24        * layout/integration/LayoutIntegrationLineLayout.cpp:
     25        (WebCore::LayoutIntegration::LineLayout::isEnabled):
     26        (WebCore::LayoutIntegration::LineLayout::canUseFor):
     27        (WebCore::LayoutIntegration::LineLayout::canUseForAfterStyleChange):
     28        * layout/integration/LayoutIntegrationLineLayout.h:
     29        (WebCore::LayoutIntegration::LineLayout::canUseFor): Deleted.
     30        * rendering/RenderBlockFlow.cpp:
     31        (WebCore::RenderBlockFlow::layoutInlineChildren):
     32
    1332020-09-23  Zalan Bujtas  <zalan@apple.com>
    234
  • trunk/Source/WebCore/Sources.txt

    r267463 r267468  
    14561456layout/inlineformatting/text/TextUtil.cpp
    14571457layout/integration/LayoutIntegrationBoxTree.cpp
     1458layout/integration/LayoutIntegrationCoverage.cpp
    14581459layout/integration/LayoutIntegrationLineLayout.cpp
    14591460layout/integration/LayoutIntegrationPagination.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r267463 r267468  
    49764976                E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    49774977                E401E0A41C3C0B8300F34D10 /* StyleChange.h in Headers */ = {isa = PBXBuildFile; fileRef = E401E0A31C3C0B8300F34D10 /* StyleChange.h */; settings = {ATTRIBUTES = (Private, ); }; };
     4978                E403B7A2251B11930019E800 /* LayoutIntegrationCoverage.h in Headers */ = {isa = PBXBuildFile; fileRef = E403B7A1251B11930019E800 /* LayoutIntegrationCoverage.h */; };
     4979                E403B7A3251B11C10019E800 /* LayoutIntegrationPagination.h in Headers */ = {isa = PBXBuildFile; fileRef = E4312AB724B3265600678349 /* LayoutIntegrationPagination.h */; };
    49784980                E418025523D4549B00FFB071 /* LayoutIntegrationBoxTree.h in Headers */ = {isa = PBXBuildFile; fileRef = E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
    49794981                E419041F1CC6486B00C35F5D /* FontSelectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E419041E1CC6486B00C35F5D /* FontSelectorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1581515817                E401E0A31C3C0B8300F34D10 /* StyleChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleChange.h; sourceTree = "<group>"; };
    1581615818                E401E0A51C3C0CF700F34D10 /* StyleChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleChange.cpp; sourceTree = "<group>"; };
     15819                E403B79F251B118B0019E800 /* LayoutIntegrationCoverage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationCoverage.cpp; sourceTree = "<group>"; };
     15820                E403B7A1251B11930019E800 /* LayoutIntegrationCoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationCoverage.h; sourceTree = "<group>"; };
    1581715821                E406F3FB1198307D009D59D6 /* ColorData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ColorData.cpp; path = DerivedSources/WebCore/ColorData.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
    1581815822                E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationBoxTree.h; sourceTree = "<group>"; };
     
    2844428448                        isa = PBXGroup;
    2844528449                        children = (
     28450                                E418025623D454B500FFB071 /* LayoutIntegrationBoxTree.cpp */,
     28451                                E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */,
     28452                                E403B79F251B118B0019E800 /* LayoutIntegrationCoverage.cpp */,
     28453                                E403B7A1251B11930019E800 /* LayoutIntegrationCoverage.h */,
     28454                                E4ABABDE2360893D00FA4345 /* LayoutIntegrationLineLayout.cpp */,
     28455                                E4ABABDB236088FD00FA4345 /* LayoutIntegrationLineLayout.h */,
    2844628456                                E4312AB524B3265600678349 /* LayoutIntegrationPagination.cpp */,
    2844728457                                E4312AB724B3265600678349 /* LayoutIntegrationPagination.h */,
    28448                                 E418025623D454B500FFB071 /* LayoutIntegrationBoxTree.cpp */,
    28449                                 E418025323D4549A00FFB071 /* LayoutIntegrationBoxTree.h */,
    28450                                 E4ABABDE2360893D00FA4345 /* LayoutIntegrationLineLayout.cpp */,
    28451                                 E4ABABDB236088FD00FA4345 /* LayoutIntegrationLineLayout.h */,
    2845228458                        );
    2845328459                        path = integration;
     
    3278432790                                AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
    3278532791                                FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */,
     32792                                E403B7A2251B11930019E800 /* LayoutIntegrationCoverage.h in Headers */,
    3278632793                                E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */,
    3278732794                                E4343D252392779000EBBB66 /* LineLayoutTraversalComplexPath.h in Headers */,
     
    3365233659                                1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */,
    3365333660                                BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */,
     33661                                E403B7A3251B11C10019E800 /* LayoutIntegrationPagination.h in Headers */,
    3365433662                                5D925B680F64D4DD00B847F0 /* ScrollAlignment.h in Headers */,
    3365533663                                CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */,
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r267463 r267468  
    3838#include "InvalidationState.h"
    3939#include "LayoutBoxGeometry.h"
     40#include "LayoutIntegrationCoverage.h"
    4041#include "LayoutIntegrationPagination.h"
    4142#include "LayoutTreeBuilder.h"
     
    6667LineLayout::~LineLayout() = default;
    6768
    68 bool LineLayout::canUseFor(const RenderBlockFlow& flow, Optional<bool> couldUseSimpleLineLayout)
    69 {
    70     if (!RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled())
     69bool LineLayout::isEnabled()
     70{
     71    return RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled();
     72}
     73
     74bool LineLayout::canUseFor(const RenderBlockFlow& flow)
     75{
     76    if (!isEnabled())
    7177        return false;
    7278
    73     // Initially only a subset of SLL features is supported.
    74     auto passesSimpleLineLayoutTest = valueOrCompute(couldUseSimpleLineLayout, [&] {
    75         return SimpleLineLayout::canUseFor(flow);
    76     });
    77 
    78     return passesSimpleLineLayoutTest;
     79    return canUseForLineLayout(flow);
    7980}
    8081
    8182bool LineLayout::canUseForAfterStyleChange(const RenderBlockFlow& flow, StyleDifference diff)
    8283{
    83     ASSERT(RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled());
    84     return SimpleLineLayout::canUseForAfterStyleChange(flow, diff);
     84    ASSERT(isEnabled());
     85    return canUseForLineLayoutAfterStyleChange(flow, diff);
    8586}
    8687
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h

    r267463 r267468  
    5656    ~LineLayout();
    5757
    58     static bool canUseFor(const RenderBlockFlow&, Optional<bool> couldUseSimpleLineLayout = { });
     58    static bool isEnabled();
     59    static bool canUseFor(const RenderBlockFlow&);
    5960    static bool canUseForAfterStyleChange(const RenderBlockFlow&, StyleDifference);
    6061
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r267463 r267468  
    670670{
    671671    auto computeLineLayoutPath = [&] {
    672         bool canUseSimpleLines = SimpleLineLayout::canUseFor(*this);
     672        bool isIntegrationEnabled = false;
    673673#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    674         if (LayoutIntegration::LineLayout::canUseFor(*this, canUseSimpleLines))
     674        if (LayoutIntegration::LineLayout::canUseFor(*this))
    675675            return LayoutFormattingContextPath;
     676        isIntegrationEnabled = LayoutIntegration::LineLayout::isEnabled();
    676677#endif
    677         if (canUseSimpleLines)
     678        if (!isIntegrationEnabled && SimpleLineLayout::canUseFor(*this))
    678679            return SimpleLinesPath;
    679680
Note: See TracChangeset for help on using the changeset viewer.