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

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

Issue 708843002: Remove -webkit-auto, -webkit-center, -webkit-left, -webkit-right. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT 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
Index: sky/engine/core/rendering/RenderBox.cpp
diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp
index 2fbfd0ccfa979c2051a4560190bfe6a0397d5ae4..4dc64d5af2b5b2ce94e368bb31380b405c0f8fe3 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -1861,9 +1861,8 @@ 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."
- const RenderStyle* containingBlockStyle = containingBlock->style();
if ((marginStartLength.isAuto() && marginEndLength.isAuto() && marginBoxWidth < containerWidth)
- || (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlockStyle->textAlign() == WEBKIT_CENTER)) {
+ || (!marginStartLength.isAuto() && !marginEndLength.isAuto())) {
// 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;
@@ -1878,9 +1877,7 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const
return;
}
- bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT)
- || (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT));
- if ((marginStartLength.isAuto() && marginBoxWidth < containerWidth) || pushToEndFromTextAlign) {
+ if (marginStartLength.isAuto() && marginBoxWidth < containerWidth) {
marginEnd = marginEndWidth;
marginStart = containerWidth - childWidth - marginEnd;
return;
« no previous file with comments | « sky/engine/core/rendering/RenderBlockLineLayout.cpp ('k') | sky/engine/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698