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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.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_block_layout_algorithm.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
index 8d825b4d487b2f4dfef4fdd045d477a86b927142..6219095d530ab6906c26d7eba164c15fe0a15379 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
@@ -46,6 +46,16 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
}
private:
+ // Computes collapsed margins for 2 adjoining blocks and updates the resultant
+ // fragment's MarginStrut if needed.
+ // See https://www.w3.org/TR/CSS2/box.html#collapsing-margins
+ //
+ // @param child_margins Margins information for the current child.
+ // @param children_margin_strut MarginStrut for children of the current child.
+ // @return Margin block start based on collapsed margins result.
+ LayoutUnit CollapseMargins(const NGBoxStrut& child_margins,
+ const NGMarginStrut& children_margin_strut);
+
RefPtr<const ComputedStyle> style_;
Member<NGBox> first_child_;
@@ -56,6 +66,8 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
Member<NGBox> current_child_;
LayoutUnit content_size_;
LayoutUnit max_inline_size_;
+ // MarginStrut for the previous child.
+ NGMarginStrut prev_child_margin_strut_;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698