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

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

Issue 2350603002: Ignore zero-height fragments during margin collapsing (Closed)
Patch Set: Set writing mode and fixed size on style_. 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e4d1d5f1b60c7867fed493f351050988b2368cad..74aaac469d36903164a9a4c8afb4ce853cd67f02 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
@@ -52,11 +52,18 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
//
// @param space Constraint space for the block.
// @param child_margins Margins information for the current child.
- // @param children_margin_strut MarginStrut for children of the current child.
+ // @param fragment Current child's fragment.
// @return Margin block start based on collapsed margins result.
LayoutUnit CollapseMargins(const NGConstraintSpace& space,
const NGBoxStrut& child_margins,
- const NGMarginStrut& children_margin_strut);
+ const NGFragment& fragment);
+
+ // Updates block-{start|end} of the currently constructed fragment.
+ //
+ // This method is supposed to be called on every child but it only updates
+ // the block-start once (on the first non-zero height child fragment) and
+ // keeps updating block-end (on every non-zero height child).
+ void UpdateMarginStrut(const NGMarginStrut& from);
RefPtr<const ComputedStyle> style_;
Member<NGBox> first_child_;
@@ -71,6 +78,9 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
LayoutUnit max_inline_size_;
// MarginStrut for the previous child.
NGMarginStrut prev_child_margin_strut_;
+ // Whether the block-start was set for the currently built
+ // fragment's margin strut.
+ bool is_fragment_margin_strut_block_start_updated_ : 1;
};
} // namespace blink
« no previous file with comments | « no previous file | 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