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

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

Issue 2336353002: Collapse bottom margins of a last child and its parent if parent's height=auto (Closed)
Patch Set: add CORE_EXPORT 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 | « third_party/WebKit/Source/core/layout/ng/ng_units.h ('k') | no next file » | 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_units.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.cc b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
index 79918a4d661516a8830e0b2bee5388e44a108edd..4f45a68dcab327a8166c123a649c9dae56847d6a 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
@@ -79,6 +79,14 @@ void NGMarginStrut::AppendMarginBlockEnd(const LayoutUnit& value) {
}
}
+void NGMarginStrut::SetMarginBlockEnd(const LayoutUnit& value) {
+ if (value < 0) {
+ negative_margin_block_end = value;
+ } else {
+ margin_block_end = value;
+ }
+}
+
String NGMarginStrut::ToString() const {
return String::format(
"Start: (%d %d) End: (%d %d)", negative_margin_block_start.toInt(),
@@ -86,4 +94,12 @@ String NGMarginStrut::ToString() const {
margin_block_end.toInt());
}
+bool NGMarginStrut::operator==(const NGMarginStrut& other) const {
+ return std::tie(other.margin_block_start, other.margin_block_end,
+ other.negative_margin_block_start,
+ other.negative_margin_block_end) ==
+ std::tie(margin_block_start, margin_block_end,
+ negative_margin_block_start, negative_margin_block_end);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_units.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698