Index: third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h |
index d1a7301598a7f732cc60104dc743c69eb7c4df04..029c62b39ae6cd87011d2509ccaf2eed05b16fed 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h |
@@ -38,6 +38,10 @@ class CORE_EXPORT NGFragmentBuilder final |
NGFragmentBuilder& AddFloatingObject(NGFloatingObject*, |
const NGLogicalOffset&); |
+ NGFragmentBuilder& SetBfcOffset(const NGLogicalOffset& offset); |
+ |
+ NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object); |
+ |
// Builder has non-trivial out-of-flow descendant methods. |
// These methods are building blocks for implementation of |
// out-of-flow descendants by layout algorithms. |
@@ -84,19 +88,16 @@ class CORE_EXPORT NGFragmentBuilder final |
NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*, |
const NGStaticPosition&); |
- NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object); |
- |
void SetBreakToken(NGBreakToken* token) { |
DCHECK(!break_token_); |
break_token_ = token; |
} |
bool HasBreakToken() const { return break_token_; } |
- // Sets MarginStrut for the resultant fragment. |
- NGFragmentBuilder& SetMarginStrutBlockStart( |
- const NGDeprecatedMarginStrut& from); |
- NGFragmentBuilder& SetMarginStrutBlockEnd( |
- const NGDeprecatedMarginStrut& from); |
+ NGFragmentBuilder& SetEndMarginStrut(const NGMarginStrut& from) { |
+ end_margin_strut_ = from; |
+ return *this; |
+ } |
// Offsets are not supposed to be set during fragment construction, so we |
// do not provide a setter here. |
@@ -107,14 +108,22 @@ class CORE_EXPORT NGFragmentBuilder final |
unsigned start_index, |
unsigned end_index); |
+ // Mutable list of floats that need to be positioned. |
+ HeapVector<Member<NGFloatingObject>>& MutableUnpositionedFloats() { |
+ return unpositioned_floats_; |
+ } |
+ |
// List of floats that need to be positioned. |
- HeapVector<Member<NGFloatingObject>>& UnpositionedFloats() { |
+ const HeapVector<Member<NGFloatingObject>>& UnpositionedFloats() const { |
return unpositioned_floats_; |
} |
+ const WTF::Optional<NGLogicalOffset>& BfcOffset() const { |
+ return bfc_offset_; |
+ } |
+ |
DECLARE_VIRTUAL_TRACE(); |
- private: |
// Out-of-flow descendant placement information. |
// The generated fragment must compute NGStaticPosition for all |
// out-of-flow descendants. |
@@ -142,8 +151,6 @@ class CORE_EXPORT NGFragmentBuilder final |
NGLogicalSize size_; |
NGLogicalSize overflow_; |
- NGDeprecatedMarginStrut margin_strut_; |
- |
HeapVector<Member<NGPhysicalFragment>> children_; |
Vector<NGLogicalOffset> offsets_; |
@@ -161,6 +168,9 @@ class CORE_EXPORT NGFragmentBuilder final |
HeapVector<Member<NGFloatingObject>> positioned_floats_; |
Member<NGBreakToken> break_token_; |
+ |
+ WTF::Optional<NGLogicalOffset> bfc_offset_; |
+ NGMarginStrut end_margin_strut_; |
}; |
} // namespace blink |