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

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: 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_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,
ikilpatrick 2016/09/13 19:08:39 I assume there is no overhead for using std::tie?
Gleb Lanbin 2016/09/13 19:33:45 std::tie is approved to use in Chromium https://ch
+ 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

Powered by Google App Engine
This is Rietveld 408576698