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

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

Issue 24031007: RenderGrid should include grid items' margins in its intrinsic size (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index 65f35a49c45544ad7a3d844238dfd82a5dbfe6e2..65c82221b62186787391f1900db78e5043ad82c7 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -90,21 +90,6 @@ const char* RenderFlexibleBox::renderName() const
return "RenderFlexibleBox";
}
-static LayoutUnit marginLogicalWidthForChild(RenderBox* child, RenderStyle* parentStyle)
-{
- // A margin has three types: fixed, percentage, and auto (variable).
- // Auto and percentage margins become 0 when computing min/max width.
- // Fixed margins can be added in as is.
- Length marginLeft = child->style()->marginStartUsing(parentStyle);
- Length marginRight = child->style()->marginEndUsing(parentStyle);
- LayoutUnit margin = 0;
- if (marginLeft.isFixed())
- margin += marginLeft.value();
- if (marginRight.isFixed())
- margin += marginRight.value();
- return margin;
-}
-
void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
// FIXME: We're ignoring flex-basis here and we shouldn't. We can't start honoring it though until
@@ -114,7 +99,7 @@ void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt
if (child->isOutOfFlowPositioned())
continue;
- LayoutUnit margin = marginLogicalWidthForChild(child, style());
+ LayoutUnit margin = marginIntrinsicLogicalWidthForChild(child);
bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizontalWritingMode();
LayoutUnit minPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->minPreferredLogicalWidth();
LayoutUnit maxPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->maxPreferredLogicalWidth();
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698