Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
index 0a7572f7a7f0e4aa2ec4a84f2e3f2b828c1c6118..f4f1e846b6df33fbfa69be5eb41cae33f587dace 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
@@ -2144,8 +2144,26 @@ void LayoutBlock::computeChildPreferredLogicalWidths(LayoutObject& child, Layout |
minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(child).computeLogicalHeightWithoutLayout(); |
return; |
} |
- minPreferredLogicalWidth = child.minPreferredLogicalWidth(); |
- maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); |
+ |
+ if (child.isLayoutBlock() && !child.isTable() && !child.isReplaced()) { |
mstensho (USE GERRIT)
2015/12/09 16:56:04
Why exclude table?
svillar
2015/12/09 17:41:32
Because there is a different section in the spec f
mstensho (USE GERRIT)
2015/12/09 19:17:33
This? http://imgur.com/osjEW7F
I think we should
|
+ const Length& computedInlineSize = child.styleRef().logicalWidth(); |
+ if (computedInlineSize.isFitContent() || computedInlineSize.isFillAvailable() || computedInlineSize.isAuto() |
+ || (computedInlineSize.hasPercent() && !toLayoutBox(child).percentageLogicalHeightIsResolvable())) { |
+ minPreferredLogicalWidth = child.minPreferredLogicalWidth(); |
+ maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); |
+ } else { |
+ ASSERT(computedInlineSize.isMinContent() || computedInlineSize.isMaxContent() || computedInlineSize.isSpecified()); |
+ LogicalExtentComputedValues computedValues; |
+ toLayoutBlock(child).computeLogicalWidth(computedValues); |
mstensho (USE GERRIT)
2015/12/09 16:56:04
How is this supposed to work if we haven't laid ou
svillar
2015/12/09 17:41:32
It will work because for min|max-content computeLo
mstensho (USE GERRIT)
2015/12/09 19:17:33
OK, that should work.
But I still think my sugges
|
+ minPreferredLogicalWidth = maxPreferredLogicalWidth = computedValues.m_extent; |
+ } |
+ } else { |
+ // TODO(svillar): we leave the original implementation as default fallback. Still need to specialcase |
+ // some other situations: https://drafts.csswg.org/css-sizing/#intrinsic |
+ minPreferredLogicalWidth = child.minPreferredLogicalWidth(); |
+ maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); |
+ } |
+ |
if (child.isLayoutBlock() && toLayoutBlock(child).needsRecalcLogicalWidthAfterLayoutChildren()) |
m_needsRecalcLogicalWidthAfterLayoutChildren = true; |
} |