Index: Source/core/rendering/RenderBox.cpp |
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
index f8701312bfd61f38a443479ad7901352007b805a..4402f7d7e7ad42f41312f9f59e93cf03f4e148ab 100644 |
--- a/Source/core/rendering/RenderBox.cpp |
+++ b/Source/core/rendering/RenderBox.cpp |
@@ -3422,7 +3422,17 @@ void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re |
} else if (!logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { |
// RULE 5: (solve for width) |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
- computedValues.m_extent = availableSpace - (logicalLeftValue + valueForLength(logicalRight, containerLogicalWidth, renderView)); |
+ // Use shrink-to-fit for width for Button, input, select, textarea, and legend treat width value of |
+ // 'auto' as 'intrinsic' unless it's in a stretching column flexbox. |
+ if (!isStretchingColumnFlexItem(this) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) |
ojan
2013/09/24 23:58:44
This should share more code withe RenderBox::sizes
cbiesinger
2013/09/26 18:03:14
Can you explain a bit why you need the isStretchin
pals
2013/10/03 11:00:05
Done.
pals
2013/10/03 11:00:05
Done. Removed the check. Thanks for pointing it ou
|
+ || node()->hasTagName(buttonTag) || isHTMLTextAreaElement(node()) || node()->hasTagName(legendTag))) { |
+ LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; |
+ LayoutUnit preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding; |
ojan
2013/09/24 23:58:44
Make sure to add layout tests with and without bor
pals
2013/10/03 11:00:05
Done.
cbiesinger
2013/10/03 21:43:30
Thanks for the updated patch.
On 2013/10/03 11:00
|
+ LayoutUnit availableWidth = availableSpace - logicalLeftValue; |
+ computedValues.m_extent = min(max(preferredMinWidth, availableWidth), preferredWidth); |
+ } else { |
+ computedValues.m_extent = availableSpace - (logicalLeftValue + valueForLength(logicalRight, containerLogicalWidth, renderView)); |
+ } |
} else if (!logicalLeftIsAuto && !logicalWidthIsAuto && logicalRightIsAuto) { |
// RULE 6: (no need solve for right) |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |