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

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

Issue 2313873002: Initial implementation of Collapsing Margins computational logic for LayoutNG (Closed)
Patch Set: synced to the head Created 4 years, 3 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 d524b3625fa451727cd962485bd367e715cee296..998a2aa8fe1e10f6d3164c892b70c839608de132 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
@@ -26,6 +26,12 @@ class CORE_EXPORT NGFragmentBuilder final
NGFragmentBuilder& AddChild(NGFragment*, NGLogicalOffset);
+ // Sets MarginStrut for the resultant fragment.
+ // These 2 methods below should be only called once as we update the
+ // fragment's MarginStrut block start/end from first/last children MarginStrut
+ NGFragmentBuilder& SetMarginStrutBlockStart(const NGMarginStrut& from);
+ NGFragmentBuilder& SetMarginStrutBlockEnd(const NGMarginStrut& from);
+
// Offsets are not supposed to be set during fragment construction, so we
// do not provide a setter here.
@@ -42,8 +48,15 @@ class CORE_EXPORT NGFragmentBuilder final
NGLogicalSize size_;
NGLogicalSize overflow_;
+ NGMarginStrut margin_strut_;
+
HeapVector<Member<NGPhysicalFragmentBase>> children_;
Vector<NGLogicalOffset> offsets_;
+
+ // Whether MarginStrut block start/end was updated.
+ // It's used for DCHECK safety check.
+ bool is_margin_strut_block_start_updated_ : 1;
+ bool is_margin_strut_block_end_updated_ : 1;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698