Changeset 131481 in webkit
- Timestamp:
- Oct 16, 2012 11:44:37 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r131480 r131481 1 2012-10-16 Tony Chang <tony@chromium.org> 2 3 in a column flexbox, input overflows the box when stretched 4 https://bugs.webkit.org/show_bug.cgi?id=99273 5 6 Reviewed by Ojan Vafai. 7 8 Add a ref test since we're testing form rendering. Make sure that we get the 9 right behavior without the performance optimization (e.g., in multiline flexbox). 10 11 * css3/flexbox/stretch-input-in-column-expected.html: Added. 12 * css3/flexbox/stretch-input-in-column.html: Added. 13 1 14 2012-10-16 Csaba Osztrogonác <ossy@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r131479 r131481 1 2012-10-16 Tony Chang <tony@chromium.org> 2 3 in a column flexbox, input overflows the box when stretched 4 https://bugs.webkit.org/show_bug.cgi?id=99273 5 6 Reviewed by Ojan Vafai. 7 8 Fix a bug where we didn't properly subtract padding and border when overriding the child size. 9 We didn't see this because of a performance optimization in RenderBox where we stretch children. 10 Also apply this performance optimization in new flexbox for form controls. 11 12 Test: css3/flexbox/stretch-input-in-column.html 13 14 * rendering/RenderBox.cpp: 15 (WebCore::flexboxChildHasStretchAlignment): 16 (WebCore::isStretchingVerticalFlexboxChild): 17 (WebCore::RenderBox::sizesLogicalWidthToFitContent): Apply performance optimization to form controls in new flexbox. 18 * rendering/RenderFlexibleBox.cpp: 19 (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Properly subtract border and padding. 20 1 21 2012-10-16 Simon Fraser <simon.fraser@apple.com> 2 22 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r131348 r131481 1773 1773 } 1774 1774 1775 static bool flexItemHasStretchAlignment(const RenderObject* flexitem) 1776 { 1777 RenderObject* parent = flexitem->parent(); 1778 return flexitem->style()->alignSelf() == AlignStretch || (flexitem->style()->alignSelf() == AlignAuto && parent->style()->alignItems() == AlignStretch); 1779 } 1780 1781 static bool isStretchingColumnFlexItem(const RenderObject* flexitem) 1782 { 1783 RenderObject* parent = flexitem->parent(); 1784 if (parent->isDeprecatedFlexibleBox() && parent->style()->boxOrient() == VERTICAL && parent->style()->boxAlign() == BSTRETCH) 1785 return true; 1786 1787 // We don't stretch multiline flexboxes because they need to apply line spacing (align-content) first. 1788 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexWrapNone && parent->style()->isColumnFlexDirection() && flexItemHasStretchAlignment(flexitem)) 1789 return true; 1790 return false; 1791 } 1792 1775 1793 bool RenderBox::sizesLogicalWidthToFitContent(SizeType widthType) const 1776 1794 { … … 1801 1819 // stretched size to avoid an extra layout when applying alignment. 1802 1820 if (parent()->isFlexibleBox()) { 1803 // For multiline columns, we need to apply the flex-line-packfirst, so we can't stretch now.1821 // For multiline columns, we need to apply align-content first, so we can't stretch now. 1804 1822 if (!parent()->style()->isColumnFlexDirection() || parent()->style()->flexWrap() != FlexWrapNone) 1805 1823 return true; 1806 EAlignItems itemAlign = style()->alignSelf(); 1807 if (itemAlign != AlignStretch && (itemAlign != AlignAuto || parent()->style()->alignItems() != AlignStretch)) 1824 if (!flexItemHasStretchAlignment(this)) 1808 1825 return true; 1809 1826 } … … 1813 1830 // FIXME: Think about block-flow here. 1814 1831 // https://bugs.webkit.org/show_bug.cgi?id=46473 1815 if (parent()->isDeprecatedFlexibleBox() 1816 && (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH)) 1832 if (parent()->isDeprecatedFlexibleBox() && (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH)) 1817 1833 return true; 1818 1834 1819 // Button, input, select, textarea, and legend treat 1820 // width value of 'auto' as 'intrinsic' unless it's in a 1821 // stretching vertical flexbox. 1835 // Button, input, select, textarea, and legend treat width value of 'auto' as 'intrinsic' unless it's in a 1836 // stretching column flexbox. 1822 1837 // FIXME: Think about block-flow here. 1823 1838 // https://bugs.webkit.org/show_bug.cgi?id=46473 1824 if (logicalWidth.type() == Auto && ! (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag)))1839 if (logicalWidth.type() == Auto && !isStretchingColumnFlexItem(this) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag))) 1825 1840 return true; 1826 1841 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r130714 r131481 1304 1304 1305 1305 if (childWidth != child->logicalWidth()) { 1306 child->setOverrideLogicalContentWidth(childWidth );1306 child->setOverrideLogicalContentWidth(childWidth - child->borderAndPaddingLogicalWidth()); 1307 1307 child->setChildNeedsLayout(true, MarkOnlyThis); 1308 1308 child->layoutIfNeeded();
Note: See TracChangeset
for help on using the changeset viewer.