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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2841823006: Resolve inline margins in over-constrained situations correctly. (Closed)
Patch Set: Resolve inline margins in over-constrained situations correctly. 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/over-constrained-auto-margin.html ('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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 097fec971dac558f6d294e287ee84ef1491c2e7a..7155f2b7b2c378898b76e7d160ba353934d260d5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2682,14 +2682,17 @@ void LayoutBox::ComputeLogicalWidth(
computed_values.margins_.end_) &&
!IsFloating() && !IsInline() && !cb->IsFlexibleBoxIncludingDeprecated() &&
!cb->IsLayoutGrid()) {
- LayoutUnit new_margin = container_logical_width - computed_values.extent_ -
- cb->MarginStartForChild(*this);
+ LayoutUnit new_margin_total =
+ container_logical_width - computed_values.extent_;
bool has_inverted_direction = cb->Style()->IsLeftToRightDirection() !=
Style()->IsLeftToRightDirection();
- if (has_inverted_direction)
- computed_values.margins_.start_ = new_margin;
- else
- computed_values.margins_.end_ = new_margin;
+ if (has_inverted_direction) {
+ computed_values.margins_.start_ =
+ new_margin_total - computed_values.margins_.end_;
+ } else {
+ computed_values.margins_.end_ =
+ new_margin_total - computed_values.margins_.start_;
+ }
}
if (style_to_use.TextAutosizingMultiplier() != 1 &&
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/over-constrained-auto-margin.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698