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

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

Issue 10668050: Merge 120934 - Non-fixed length margins don't work with align=center (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 6 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 | « LayoutTests/fast/block/positive-margin-block-child-align-center-calc-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBox.cpp
===================================================================
--- Source/WebCore/rendering/RenderBox.cpp (revision 121273)
+++ Source/WebCore/rendering/RenderBox.cpp (working copy)
@@ -1833,8 +1833,8 @@
if ((marginStartLength.isAuto() && marginEndLength.isAuto() && childWidth < containerWidth)
|| (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlock->style()->textAlign() == WEBKIT_CENTER)) {
// Other browsers center the margin box for align=center elements so we match them here.
- LayoutUnit marginStartWidth = marginStartLength.value();
- LayoutUnit marginEndWidth = marginEndLength.value();
+ LayoutUnit marginStartWidth = minimumValueForLength(marginStartLength, containerWidth, renderView);
+ LayoutUnit marginEndWidth = minimumValueForLength(marginEndLength, containerWidth, renderView);
LayoutUnit centeredMarginBoxStart = max<LayoutUnit>(0, (containerWidth - childWidth - marginStartWidth - marginEndWidth) / 2);
containingBlock->setMarginStartForChild(this, centeredMarginBoxStart + marginStartWidth);
containingBlock->setMarginEndForChild(this, containerWidth - childWidth - containingBlock->marginStartForChild(this) + marginEndWidth);
« no previous file with comments | « LayoutTests/fast/block/positive-margin-block-child-align-center-calc-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698