diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/ng_block_node.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/ng/ng_block_node.h | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/ng_block_node.h b/chromium/third_party/blink/renderer/core/layout/ng/ng_block_node.h index 43a54e5fb0b..89b39fa7356 100644 --- a/chromium/third_party/blink/renderer/core/layout/ng/ng_block_node.h +++ b/chromium/third_party/blink/renderer/core/layout/ng/ng_block_node.h @@ -6,7 +6,7 @@ #define NGBlockNode_h #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/geometry/ng_physical_offset.h" +#include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" #include "third_party/blink/renderer/platform/fonts/font_baseline.h" #include "third_party/blink/renderer/platform/wtf/casting.h" @@ -24,7 +24,8 @@ class NGPhysicalContainerFragment; class NGPhysicalFragment; struct MinMaxSize; struct NGBoxStrut; -struct NGLogicalOffset; +struct NGLayoutAlgorithmParams; +struct LogicalOffset; // Represents a node to be laid out. class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { @@ -38,6 +39,13 @@ class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { const NGConstraintSpace& constraint_space, const NGBreakToken* break_token = nullptr); + // This method is just for use within the |NGSimplifiedLayoutAlgorithm|. + // + // If layout is dirty, it will perform layout using the previous constraint + // space used to generate the |NGLayoutResult|. + // Otherwise it will simply return the previous layout result generated. + scoped_refptr<const NGLayoutResult> SimplifiedLayout(); + // This method is just for use within the |NGOutOfFlowLayoutPart|. // // As OOF-positioned objects have their position, and size computed @@ -47,7 +55,7 @@ class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { // If the containing-block size hasn't changed, and we are layout-clean we // can reuse the previous layout result. scoped_refptr<const NGLayoutResult> CachedLayoutResultForOutOfFlowPositioned( - NGLogicalSize container_content_size) const; + LogicalSize container_content_size) const; NGLayoutInputNode NextSibling() const; @@ -75,8 +83,6 @@ class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { MinMaxSize ComputeMinMaxSizeFromLegacy(const MinMaxSizeInput&) const; - NGBoxStrut GetScrollbarSizes() const; - NGLayoutInputNode FirstChild() const; NGBlockNode GetRenderedLegend() const; @@ -90,6 +96,10 @@ class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { // See comments in UseLogicalBottomMarginEdgeForInlineBlockBaseline(). bool UseLogicalBottomMarginEdgeForInlineBlockBaseline() const; + // Return true if the block size of this table cell should be considered + // restricted (e.g. height of the cell or its table is non-auto). + bool IsRestrictedBlockSizeTableCell() const; + // Layout an atomic inline; e.g., inline block. scoped_refptr<const NGLayoutResult> LayoutAtomicInline( const NGConstraintSpace& parent_constraint_space, @@ -97,16 +107,12 @@ class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { FontBaseline, bool use_first_line_style); - // Runs layout on the underlying LayoutObject and creates a fragment for the - // resulting geometry. - scoped_refptr<const NGLayoutResult> RunOldLayout(const NGConstraintSpace&); - // Called if this is an out-of-flow block which needs to be // positioned with legacy layout. - void UseOldOutOfFlowPositioning() const; + void UseLegacyOutOfFlowPositioning() const; // Save static position for legacy AbsPos layout. - void SaveStaticOffsetForLegacy(const NGLogicalOffset&, + void SaveStaticOffsetForLegacy(const LogicalOffset&, const LayoutObject* offset_container); // Write back resolved margins to legacy. @@ -120,6 +126,13 @@ class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { private: void PrepareForLayout(); + // Runs layout on the underlying LayoutObject and creates a fragment for the + // resulting geometry. + scoped_refptr<const NGLayoutResult> RunLegacyLayout(const NGConstraintSpace&); + + scoped_refptr<const NGLayoutResult> RunSimplifiedLayout( + const NGLayoutAlgorithmParams&) const; + // If this node is a LayoutNGMixin, the caller must pass the layout object for // this node cast to a LayoutBlockFlow as the first argument. void FinishLayout(LayoutBlockFlow*, @@ -135,21 +148,21 @@ class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { const NGPhysicalContainerFragment& container, LayoutUnit initial_container_width, bool initial_container_is_flipped, - NGPhysicalOffset offset = {}); + PhysicalOffset offset = {}); void PlaceChildrenInLayoutBox(const NGConstraintSpace&, const NGPhysicalBoxFragment&, - const NGPhysicalOffset& offset_from_start); + const PhysicalOffset& offset_from_start); void PlaceChildrenInFlowThread(const NGConstraintSpace&, const NGPhysicalBoxFragment&); void CopyChildFragmentPosition( const NGPhysicalFragment& fragment, - const NGPhysicalOffset fragment_offset, - const NGPhysicalOffset additional_offset = NGPhysicalOffset()); + const PhysicalOffset fragment_offset, + const PhysicalOffset additional_offset = PhysicalOffset()); - void CopyBaselinesFromOldLayout(const NGConstraintSpace&, - NGBoxFragmentBuilder*); - LayoutUnit AtomicInlineBaselineFromOldLayout(const NGBaselineRequest&, - const NGConstraintSpace&); + void CopyBaselinesFromLegacyLayout(const NGConstraintSpace&, + NGBoxFragmentBuilder*); + LayoutUnit AtomicInlineBaselineFromLegacyLayout(const NGBaselineRequest&, + const NGConstraintSpace&); void UpdateShapeOutsideInfoIfNeeded( const NGLayoutResult&, |