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

Changeset 267461 in webkit


Ignore:
Timestamp:
Sep 22, 2020, 8:50:31 PM (6 years ago)
Author:
Alan Bujtas
Message:

[LFC][Integration] Move RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check out from LineBuilder::constraintsForLine
https://bugs.webkit.org/show_bug.cgi?id=216862

Reviewed by Simon Fraser.

  • layout/LayoutState.cpp:

(WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild):

  • layout/LayoutState.h:

(WebCore::Layout::LayoutState::isIntegratedRootBoxFirstChild const):

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):

  • layout/inlineformatting/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::constraintsForLine):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267460 r267461  
     12020-09-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Move RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check out from LineBuilder::constraintsForLine
     4        https://bugs.webkit.org/show_bug.cgi?id=216862
     5
     6        Reviewed by Simon Fraser.
     7
     8        * layout/LayoutState.cpp:
     9        (WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild):
     10        * layout/LayoutState.h:
     11        (WebCore::Layout::LayoutState::isIntegratedRootBoxFirstChild const):
     12        * layout/inlineformatting/InlineFormattingContext.cpp:
     13        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
     14        * layout/inlineformatting/InlineLineBuilder.cpp:
     15        (WebCore::Layout::LineBuilder::constraintsForLine):
     16
    1172020-09-22  Zalan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/layout/LayoutState.cpp

    r267076 r267461  
    237237{
    238238    ASSERT(RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled());
    239     m_isIntegratedRootBoxFirstChild = value;
     239    m_isIntegratedRootBoxFirstChild = value ? IsIntegratedRootBoxFirstChild::Yes : IsIntegratedRootBoxFirstChild::No;
    240240}
    241241
  • trunk/Source/WebCore/layout/LayoutState.h

    r267418 r267461  
    9090    void setViewportSize(const LayoutSize&);
    9191    LayoutSize viewportSize() const;
    92     bool isIntegratedRootBoxFirstChild() const { return m_isIntegratedRootBoxFirstChild; }
     92    enum IsIntegratedRootBoxFirstChild { Yes, No, NotApplicable };
     93    IsIntegratedRootBoxFirstChild isIntegratedRootBoxFirstChild() const { return m_isIntegratedRootBoxFirstChild; }
    9394    void setIsIntegratedRootBoxFirstChild(bool);
    9495
     
    114115    // LFC integration only.
    115116    LayoutSize m_viewportSize;
    116     bool m_isIntegratedRootBoxFirstChild { false };
     117    IsIntegratedRootBoxFirstChild m_isIntegratedRootBoxFirstChild { IsIntegratedRootBoxFirstChild::NotApplicable };
    117118};
    118119
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r267446 r267461  
    486486    };
    487487    constructLineGeometry();
     488
    488489    return lineLogicalRect;
    489490}
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp

    r267404 r267461  
    430430            // of an element are affected.
    431431            // For example, the first line of an anonymous block box is only affected if it is the first child of its parent element.
    432             isFormattingContextRootCandidateToTextIndent = RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()
    433                 ? layoutState().isIntegratedRootBoxFirstChild()
    434                 : root.parent().firstInFlowChild() == &root;
     432            auto isIntegratedRootBoxFirstChild = layoutState().isIntegratedRootBoxFirstChild();
     433            if (isIntegratedRootBoxFirstChild == LayoutState::IsIntegratedRootBoxFirstChild::NotApplicable)
     434                isFormattingContextRootCandidateToTextIndent = root.parent().firstInFlowChild() == &root;
     435            else
     436                isFormattingContextRootCandidateToTextIndent = isIntegratedRootBoxFirstChild == LayoutState::IsIntegratedRootBoxFirstChild::Yes;
    435437        }
    436438        if (!isFormattingContextRootCandidateToTextIndent)
Note: See TracChangeset for help on using the changeset viewer.