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

Unified Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 760143002: Make fixed-width elements not center by default. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | sky/tests/layout/ellipsis-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBox.cpp
diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp
index eaa4339067fb77e435fceb07a6b0be5f6ff4e79e..54cad1a3609de3dc55af6adfa3dd705d5452a31c 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -1648,8 +1648,7 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const
// CSS 2.1: "If both 'margin-left' and 'margin-right' are 'auto', their used values are equal. This horizontally centers the element
// with respect to the edges of the containing block."
- if ((marginStartLength.isAuto() && marginEndLength.isAuto() && marginBoxWidth < containerWidth)
- || (!marginStartLength.isAuto() && !marginEndLength.isAuto())) {
+ if (marginStartLength.isAuto() && marginEndLength.isAuto() && marginBoxWidth < containerWidth) {
// Other browsers center the margin box for align=center elements so we match them here.
LayoutUnit centeredMarginBoxStart = std::max<LayoutUnit>(0, (containerWidth - childWidth - marginStartWidth - marginEndWidth) / 2);
marginStart = centeredMarginBoxStart + marginStartWidth;
« no previous file with comments | « no previous file | sky/tests/layout/ellipsis-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698