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

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

Issue 2346473003: Do not collapse margins with padding/border b/w parent and first/last child (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
« 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 4f45a68dcab327a8166c123a649c9dae56847d6a..d65adf7c2a8d0fb29454d3f645e6952a4a783772 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::SetMarginBlockStart(const LayoutUnit& value) {
+ if (value < 0) {
+ negative_margin_block_start = value;
+ } else {
+ margin_block_start = value;
+ }
+}
+
void NGMarginStrut::SetMarginBlockEnd(const LayoutUnit& value) {
if (value < 0) {
negative_margin_block_end = value;
@@ -88,10 +96,10 @@ void NGMarginStrut::SetMarginBlockEnd(const LayoutUnit& value) {
}
String NGMarginStrut::ToString() const {
- return String::format(
- "Start: (%d %d) End: (%d %d)", negative_margin_block_start.toInt(),
- margin_block_start.toInt(), negative_margin_block_end.toInt(),
- margin_block_end.toInt());
+ return String::format("Start: (%d %d) End: (%d %d)",
+ margin_block_start.toInt(), margin_block_end.toInt(),
+ negative_margin_block_start.toInt(),
+ negative_margin_block_end.toInt());
}
bool NGMarginStrut::operator==(const NGMarginStrut& other) const {
« 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