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

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

Issue 2628583003: [ng_layout] Fix incorrect margin computation (Closed)
Patch Set: Created 3 years, 11 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 | 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_absolute_utils.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc
index 98f327e0dd94a1846adfbbd94818c96176f7856b..3b5b8ab88fffe12ce4c175dc0a5c4e89b527026f 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc
@@ -112,9 +112,9 @@ void ComputeAbsoluteHorizontal(
}
}
} else if (!margin_left) {
- margin_left = margin_space;
+ margin_left = margin_space - *margin_right;
} else if (!margin_right) {
- margin_right = margin_space;
+ margin_right = margin_space - *margin_left;
} else {
// Are values overconstrained?
if (*margin_left + *margin_right != margin_space) {
@@ -256,9 +256,9 @@ void ComputeAbsoluteVertical(
margin_bottom = margin_space;
}
} else if (!margin_top) {
- margin_top = margin_space;
+ margin_top = margin_space - *margin_bottom;
} else if (!margin_bottom) {
- margin_bottom = margin_space;
+ margin_bottom = margin_space - *margin_top;
} else {
// Are values overconstrained?
if (*margin_top + *margin_bottom != margin_space) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698