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

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 766223004: Blocks should be aligned by style of parents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: consider ltr in rtl Created 6 years 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: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index d08b3e586e7a1029c8b6f54e29794111935075af..374712aed83b2523a6bee622b05802a0cd97b518 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -2110,8 +2110,13 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const
bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT)
|| (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT));
if ((marginStartLength.isAuto() && marginBoxWidth < availableWidth) || pushToEndFromTextAlign) {
mstensho (USE GERRIT) 2014/12/08 10:01:21 Now handling of regular auto margins will be broke
Kyungtae Kim 2014/12/09 04:53:08 I included autoMargin cases in a new test case
- marginEnd = marginEndWidth;
- marginStart = availableWidth - childWidth - marginEnd;
+ if (containingBlockStyle->isLeftToRightDirection() != style()->isLeftToRightDirection()) {
+ marginStart = marginStartWidth;
+ marginEnd = availableWidth - childWidth - marginStart;
+ } else {
+ marginEnd = marginEndWidth;
+ marginStart = availableWidth - childWidth - marginEnd;
+ }
return;
}

Powered by Google App Engine
This is Rietveld 408576698