Changeset 293297 in webkit
- Timestamp:
- Apr 23, 2022 4:03:32 PM (2 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r293296 r293297 1 2022-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 1 29 2022-04-23 Brady Eidson <beidson@apple.com> 2 30 -
trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
r282348 r293297 119 119 } 120 120 121 void FlexFormattingContext::layoutInFlowContentForIntergration(const ConstraintsForInFlowContent&) 122 { 123 } 124 125 IntrinsicWidthConstraints FlexFormattingContext::computedIntrinsicWidthConstraintsForIntegration() 126 { 127 return { }; 128 } 129 121 130 } 122 131 } -
trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h
r282348 r293297 43 43 FlexFormattingContext(const ContainerBox& formattingContextRoot, FlexFormattingState&); 44 44 void layoutInFlowContent(const ConstraintsForInFlowContent&) override; 45 IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override; 45 46 LayoutUnit usedContentHeight() const override; 46 47 IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;48 47 49 48 const FlexFormattingGeometry& formattingGeometry() const final { return m_flexFormattingGeometry; } 50 49 const FormattingQuirks& formattingQuirks() const final { return m_flexFormattingQuirks; } 50 51 void layoutInFlowContentForIntergration(const ConstraintsForInFlowContent&); 52 IntrinsicWidthConstraints computedIntrinsicWidthConstraintsForIntegration(); 51 53 52 54 private: -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
r289192 r293297 151 151 } 152 152 153 void InlineFormattingContext::l ineLayoutForIntergration(const ConstraintsForInFlowContent& constraints)153 void InlineFormattingContext::layoutInFlowContentForIntergration(const ConstraintsForInFlowContent& constraints) 154 154 { 155 155 invalidateFormattingState(); -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h
r286096 r293297 48 48 public: 49 49 InlineFormattingContext(const ContainerBox& formattingContextRoot, InlineFormattingState&, const InlineDamage* = nullptr); 50 50 51 void layoutInFlowContent(const ConstraintsForInFlowContent&) override; 52 IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override; 51 53 LayoutUnit usedContentHeight() const override; 52 54 53 55 const InlineFormattingState& formattingState() const { return downcast<InlineFormattingState>(FormattingContext::formattingState()); } 54 56 InlineFormattingState& formattingState() { return downcast<InlineFormattingState>(FormattingContext::formattingState()); } 55 56 void lineLayoutForIntergration(const ConstraintsForInFlowContent&);57 IntrinsicWidthConstraints computedIntrinsicWidthConstraintsForIntegration();58 59 57 const InlineFormattingGeometry& formattingGeometry() const final { return m_inlineFormattingGeometry; } 60 58 const InlineFormattingQuirks& formattingQuirks() const final { return m_inlineFormattingQuirks; } 61 59 62 IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override; 60 void layoutInFlowContentForIntergration(const ConstraintsForInFlowContent&); 61 IntrinsicWidthConstraints computedIntrinsicWidthConstraintsForIntegration(); 63 62 64 63 private: -
trunk/Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp
r293293 r293297 29 29 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 30 30 31 #include "FlexFormattingContext.h" 31 32 #include "HitTestLocation.h" 32 33 #include "HitTestRequest.h" … … 40 41 FlexLayout::FlexLayout(RenderFlexibleBox& flexBoxRenderer) 41 42 : m_boxTree(flexBoxRenderer) 42 , m_layoutState(flexBoxRenderer.document(), m_boxTree.rootLayoutBox()) 43 , m_layoutState(flexBoxRenderer.document(), rootLayoutBox()) 44 , m_flexFormattingState(m_layoutState.ensureFlexFormattingState(rootLayoutBox())) 43 45 { 44 46 } … … 66 68 std::pair<LayoutUnit, LayoutUnit> FlexLayout::computeIntrinsicWidthConstraints() 67 69 { 68 return { }; 70 auto flexFormattingContext = Layout::FlexFormattingContext { rootLayoutBox(), m_flexFormattingState }; 71 auto constraints = flexFormattingContext.computedIntrinsicWidthConstraintsForIntegration(); 72 73 return { constraints.minimum, constraints.maximum }; 69 74 } 70 75 71 76 void FlexLayout::layout() 72 77 { 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() }); 73 83 } 74 84 -
trunk/Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h
r293293 r293297 28 28 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 29 29 30 #include "FlexFormattingState.h" 30 31 #include "LayoutIntegrationBoxTree.h" 31 32 #include "LayoutState.h" … … 64 65 65 66 private: 67 const Layout::ContainerBox& rootLayoutBox() const { return m_boxTree.rootLayoutBox(); } 68 Layout::ContainerBox& rootLayoutBox() { return m_boxTree.rootLayoutBox(); } 69 66 70 BoxTree m_boxTree; 67 71 Layout::LayoutState m_layoutState; 72 Layout::FlexFormattingState& m_flexFormattingState; 68 73 }; 69 74 -
trunk/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
r293114 r293297 381 381 auto horizontalConstraints = Layout::HorizontalConstraints { rootGeometry.contentBoxLeft(), rootGeometry.contentBoxWidth() }; 382 382 383 inlineFormattingContext.l ineLayoutForIntergration({ horizontalConstraints, rootGeometry.contentBoxTop() });383 inlineFormattingContext.layoutInFlowContentForIntergration({ horizontalConstraints, rootGeometry.contentBoxTop() }); 384 384 385 385 constructContent();
Note: See TracChangeset
for help on using the changeset viewer.