Index: Source/core/rendering/RenderBox.cpp |
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
index 6dab61653e325531de3df6e28b81637c559736d9..14d95f74985010ba057a8da9d7fd30ad512b385b 100644 |
--- a/Source/core/rendering/RenderBox.cpp |
+++ b/Source/core/rendering/RenderBox.cpp |
@@ -2510,7 +2510,7 @@ bool RenderBox::sizesLogicalWidthToFitContent(SizeType widthType) const |
bool RenderBox::autoWidthShouldFitContent() const |
{ |
return node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) |
- || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag)); |
+ || node()->hasTagName(textareaTag) || (node()->hasTagName(legendTag) && !style()->hasOutOfFlowPosition())); |
} |
void RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd) const |