Changeset 293297 in webkit


Ignore:
Timestamp:
Apr 23, 2022 4:03:32 PM (2 years ago)
Author:
Alan Bujtas
Message:

[FFC][Integration] Add integration API to FlexFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=239692

Reviewed by Antti Koivisto.

The integration codepath needs dedicated (and temporary)APIs on the formatting contexts.
(This is exactly how inline layout has been integrated.)

  • layout/formattingContexts/flex/FlexFormattingContext.cpp:

(WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntergration):
(WebCore::Layout::FlexFormattingContext::computedIntrinsicWidthConstraintsForIntegration):

  • layout/formattingContexts/flex/FlexFormattingContext.h:
  • layout/formattingContexts/inline/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::layoutInFlowContentForIntergration):
(WebCore::Layout::InlineFormattingContext::lineLayoutForIntergration): Deleted.

  • layout/formattingContexts/inline/InlineFormattingContext.h:
  • layout/integration/flex/LayoutIntegrationFlexLayout.cpp:

(WebCore::LayoutIntegration::FlexLayout::FlexLayout):
(WebCore::LayoutIntegration::FlexLayout::computeIntrinsicWidthConstraints):
(WebCore::LayoutIntegration::FlexLayout::layout):

  • layout/integration/flex/LayoutIntegrationFlexLayout.h:

(WebCore::LayoutIntegration::FlexLayout::rootLayoutBox const):
(WebCore::LayoutIntegration::FlexLayout::rootLayoutBox):

  • layout/integration/inline/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::layout):

Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r293296 r293297  
     12022-04-23  Alan Bujtas  <zalan@apple.com>
     2
     3        [FFC][Integration] Add integration API to FlexFormattingContext
     4        https://bugs.webkit.org/show_bug.cgi?id=239692
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The integration codepath needs dedicated (and temporary)APIs on the formatting contexts.
     9        (This is exactly how inline layout has been integrated.)
     10
     11        * layout/formattingContexts/flex/FlexFormattingContext.cpp:
     12        (WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntergration):
     13        (WebCore::Layout::FlexFormattingContext::computedIntrinsicWidthConstraintsForIntegration):
     14        * layout/formattingContexts/flex/FlexFormattingContext.h:
     15        * layout/formattingContexts/inline/InlineFormattingContext.cpp:
     16        (WebCore::Layout::InlineFormattingContext::layoutInFlowContentForIntergration):
     17        (WebCore::Layout::InlineFormattingContext::lineLayoutForIntergration): Deleted.
     18        * layout/formattingContexts/inline/InlineFormattingContext.h:
     19        * layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
     20        (WebCore::LayoutIntegration::FlexLayout::FlexLayout):
     21        (WebCore::LayoutIntegration::FlexLayout::computeIntrinsicWidthConstraints):
     22        (WebCore::LayoutIntegration::FlexLayout::layout):
     23        * layout/integration/flex/LayoutIntegrationFlexLayout.h:
     24        (WebCore::LayoutIntegration::FlexLayout::rootLayoutBox const):
     25        (WebCore::LayoutIntegration::FlexLayout::rootLayoutBox):
     26        * layout/integration/inline/LayoutIntegrationLineLayout.cpp:
     27        (WebCore::LayoutIntegration::LineLayout::layout):
     28
    1292022-04-23  Brady Eidson  <beidson@apple.com>
    230
  • trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp

    r282348 r293297  
    119119}
    120120
     121void FlexFormattingContext::layoutInFlowContentForIntergration(const ConstraintsForInFlowContent&)
     122{
     123}
     124
     125IntrinsicWidthConstraints FlexFormattingContext::computedIntrinsicWidthConstraintsForIntegration()
     126{
     127    return { };
     128}
     129
    121130}
    122131}
  • trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h

    r282348 r293297  
    4343    FlexFormattingContext(const ContainerBox& formattingContextRoot, FlexFormattingState&);
    4444    void layoutInFlowContent(const ConstraintsForInFlowContent&) override;
     45    IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
    4546    LayoutUnit usedContentHeight() const override;
    46 
    47     IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
    4847
    4948    const FlexFormattingGeometry& formattingGeometry() const final { return m_flexFormattingGeometry; }
    5049    const FormattingQuirks& formattingQuirks() const final { return m_flexFormattingQuirks; }
     50
     51    void layoutInFlowContentForIntergration(const ConstraintsForInFlowContent&);
     52    IntrinsicWidthConstraints computedIntrinsicWidthConstraintsForIntegration();
    5153
    5254private:
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp

    r289192 r293297  
    151151}
    152152
    153 void InlineFormattingContext::lineLayoutForIntergration(const ConstraintsForInFlowContent& constraints)
     153void InlineFormattingContext::layoutInFlowContentForIntergration(const ConstraintsForInFlowContent& constraints)
    154154{
    155155    invalidateFormattingState();
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h

    r286096 r293297  
    4848public:
    4949    InlineFormattingContext(const ContainerBox& formattingContextRoot, InlineFormattingState&, const InlineDamage* = nullptr);
     50
    5051    void layoutInFlowContent(const ConstraintsForInFlowContent&) override;
     52    IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
    5153    LayoutUnit usedContentHeight() const override;
    5254
    5355    const InlineFormattingState& formattingState() const { return downcast<InlineFormattingState>(FormattingContext::formattingState()); }
    5456    InlineFormattingState& formattingState() { return downcast<InlineFormattingState>(FormattingContext::formattingState()); }
    55 
    56     void lineLayoutForIntergration(const ConstraintsForInFlowContent&);
    57     IntrinsicWidthConstraints computedIntrinsicWidthConstraintsForIntegration();
    58 
    5957    const InlineFormattingGeometry& formattingGeometry() const final { return m_inlineFormattingGeometry; }
    6058    const InlineFormattingQuirks& formattingQuirks() const final { return m_inlineFormattingQuirks; }
    6159
    62     IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
     60    void layoutInFlowContentForIntergration(const ConstraintsForInFlowContent&);
     61    IntrinsicWidthConstraints computedIntrinsicWidthConstraintsForIntegration();
    6362
    6463private:
  • trunk/Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp

    r293293 r293297  
    2929#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    3030
     31#include "FlexFormattingContext.h"
    3132#include "HitTestLocation.h"
    3233#include "HitTestRequest.h"
     
    4041FlexLayout::FlexLayout(RenderFlexibleBox& flexBoxRenderer)
    4142    : m_boxTree(flexBoxRenderer)
    42     , m_layoutState(flexBoxRenderer.document(), m_boxTree.rootLayoutBox())
     43    , m_layoutState(flexBoxRenderer.document(), rootLayoutBox())
     44    , m_flexFormattingState(m_layoutState.ensureFlexFormattingState(rootLayoutBox()))
    4345{
    4446}
     
    6668std::pair<LayoutUnit, LayoutUnit> FlexLayout::computeIntrinsicWidthConstraints()
    6769{
    68     return { };
     70    auto flexFormattingContext = Layout::FlexFormattingContext { rootLayoutBox(), m_flexFormattingState };
     71    auto constraints = flexFormattingContext.computedIntrinsicWidthConstraintsForIntegration();
     72
     73    return { constraints.minimum, constraints.maximum };
    6974}
    7075
    7176void FlexLayout::layout()
    7277{
     78    auto& rootGeometry = m_layoutState.geometryForBox(rootLayoutBox());
     79    auto flexFormattingContext = Layout::FlexFormattingContext { rootLayoutBox(), m_flexFormattingState };
     80    auto horizontalConstraints = Layout::HorizontalConstraints { rootGeometry.contentBoxLeft(), rootGeometry.contentBoxWidth() };
     81
     82    flexFormattingContext.layoutInFlowContentForIntergration({ horizontalConstraints, rootGeometry.contentBoxTop() });
    7383}
    7484
  • trunk/Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h

    r293293 r293297  
    2828#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    2929
     30#include "FlexFormattingState.h"
    3031#include "LayoutIntegrationBoxTree.h"
    3132#include "LayoutState.h"
     
    6465
    6566private:
     67    const Layout::ContainerBox& rootLayoutBox() const { return m_boxTree.rootLayoutBox(); }
     68    Layout::ContainerBox& rootLayoutBox() { return m_boxTree.rootLayoutBox(); }
     69
    6670    BoxTree m_boxTree;
    6771    Layout::LayoutState m_layoutState;
     72    Layout::FlexFormattingState& m_flexFormattingState;
    6873};
    6974
  • trunk/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp

    r293114 r293297  
    381381    auto horizontalConstraints = Layout::HorizontalConstraints { rootGeometry.contentBoxLeft(), rootGeometry.contentBoxWidth() };
    382382
    383     inlineFormattingContext.lineLayoutForIntergration({ horizontalConstraints, rootGeometry.contentBoxTop() });
     383    inlineFormattingContext.layoutInFlowContentForIntergration({ horizontalConstraints, rootGeometry.contentBoxTop() });
    384384
    385385    constructContent();
Note: See TracChangeset for help on using the changeset viewer.