Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h

Issue 2597823004: WIP version of new margin collapsing logic + support of empty blocks with floats
Patch Set: update Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bbe754be0f7d6e25037d8d9e0d0839c01452cfa7 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,8 @@ class CORE_EXPORT NGFragmentBuilder final
NGFragmentBuilder& AddFloatingObject(NGFloatingObject*,
const NGLogicalOffset&);
+ NGFragmentBuilder& SetBfcOffset(const NGLogicalOffset& offset);
+
// Builder has non-trivial out-of-flow descendant methods.
// These methods are building blocks for implementation of
// out-of-flow descendants by layout algorithms.
@@ -92,11 +94,10 @@ class CORE_EXPORT NGFragmentBuilder final
}
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.
@@ -112,9 +113,12 @@ class CORE_EXPORT NGFragmentBuilder final
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 +146,6 @@ class CORE_EXPORT NGFragmentBuilder final
NGLogicalSize size_;
NGLogicalSize overflow_;
- NGDeprecatedMarginStrut margin_strut_;
-
HeapVector<Member<NGPhysicalFragment>> children_;
Vector<NGLogicalOffset> offsets_;
@@ -161,6 +163,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

Powered by Google App Engine
This is Rietveld 408576698