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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc

Issue 2865903002: [LayoutNG] Inline margin/border/padding, inter-item breaking, and tests (Closed)
Patch Set: Cleanup Created 3 years, 7 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_length_utils.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
index 95aa08381fffd84f8e8aad8b55e64a54c7854154..c059aa8d7b325d101929e7b86bc868bca5921660 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
@@ -396,6 +396,32 @@ NGBoxStrut ComputePadding(const NGConstraintSpace& constraint_space,
return padding;
}
+LayoutUnit ComputeMarginBorderPaddingInlineStart(
cbiesinger 2017/05/22 19:02:58 I'd rather not add functions like these; why not u
kojii 2017/05/22 19:22:42 It computes 4 values and discard 3 out of that. I'
kojii 2017/05/22 19:26:31 BTW, you might know but in case, the legacy has Ma
+ const NGConstraintSpace& constraint_space,
+ const ComputedStyle& style) {
+ MinMaxContentSize empty_sizes;
+ return ResolveInlineLength(constraint_space, style, empty_sizes,
+ style.MarginStart(),
+ LengthResolveType::kMarginBorderPaddingSize) +
+ LayoutUnit(style.BorderStartWidth()) +
+ ResolveInlineLength(constraint_space, style, empty_sizes,
+ style.PaddingStart(),
+ LengthResolveType::kMarginBorderPaddingSize);
+}
+
+LayoutUnit ComputeMarginBorderPaddingInlineEnd(
+ const NGConstraintSpace& constraint_space,
+ const ComputedStyle& style) {
+ MinMaxContentSize empty_sizes;
+ return ResolveInlineLength(constraint_space, style, empty_sizes,
+ style.MarginEnd(),
+ LengthResolveType::kMarginBorderPaddingSize) +
+ LayoutUnit(style.BorderEndWidth()) +
+ ResolveInlineLength(constraint_space, style, empty_sizes,
+ style.PaddingEnd(),
+ LengthResolveType::kMarginBorderPaddingSize);
+}
+
void ApplyAutoMargins(const NGConstraintSpace& constraint_space,
const ComputedStyle& style,
const LayoutUnit& inline_size,

Powered by Google App Engine
This is Rietveld 408576698