Changeset 138770 in webkit
- Timestamp:
- Jan 3, 2013, 5:21:07 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r138767 r138770 1 2013-01-03 Tony Chang <tony@chromium.org> 2 3 incorrect flexbox relayout with overflow, padding and absolute positioning 4 https://bugs.webkit.org/show_bug.cgi?id=106022 5 6 Reviewed by Ojan Vafai. 7 8 * css3/flexbox/stretch-simplified-layout-expected.txt: Added. 9 * css3/flexbox/stretch-simplified-layout.html: Added. 10 1 11 2013-01-03 Terry Anderson <tdanderson@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r138769 r138770 1 2013-01-03 Tony Chang <tony@chromium.org> 2 3 incorrect flexbox relayout with overflow, padding and absolute positioning 4 https://bugs.webkit.org/show_bug.cgi?id=106022 5 6 Reviewed by Ojan Vafai. 7 8 The problem was we were entering simplified layout, which doesn't apply the stretch 9 behavior for flex children. That should be fine if we had kept the override size from 10 the previous layout. So clear the override size during layout rather than after layout. 11 12 Not clearing the override size re-triggers bug 98611. Fix this by always forcing a 13 layout of an image if it has an override size set. The presence of an override size means 14 we did some special layout that may not be covered by re-computing the logical width and 15 height. 16 17 Test: css3/flexbox/stretch-simplified-layout.html 18 19 * rendering/RenderFlexibleBox.cpp: 20 (WebCore::RenderFlexibleBox::layoutBlock): Don't clear the override size after layout. 21 (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Clear the override size right before layout. 22 * rendering/RenderFlexibleBox.h: 23 (RenderFlexibleBox): Remove clearChildOverrideSizes() since it's not called anymore. 24 * rendering/RenderImage.cpp: 25 (WebCore::RenderImage::imageDimensionsChanged): If an override size is present, force a relayout. 26 Also cleaned up the code a bit to avoid computing the width and height unless we need to. 27 1 28 2013-01-03 Adam Klein <adamk@chromium.org> 2 29 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r138312 r138770 343 343 344 344 computeRegionRangeForBlock(); 345 clearChildOverrideSizes();346 345 347 346 repaintChildrenDuringLayoutIfMoved(oldChildRects); … … 413 412 // direction:rtl + flex-direction:column means the cross-axis direction is flipped. 414 413 flipForRightToLeftColumn(); 415 }416 417 void RenderFlexibleBox::clearChildOverrideSizes()418 {419 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox())420 child->clearOverrideSize();421 414 } 422 415 … … 858 851 if (child->isOutOfFlowPositioned()) 859 852 continue; 853 854 child->clearOverrideSize(); 860 855 861 856 // Only need to layout here if we will need to get the logicalHeight of the child in computeNextFlexLine. -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r138235 r138770 140 140 bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlignmentSpace); 141 141 void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&, LayoutUnit& oldClientAfterEdge); 142 void clearChildOverrideSizes();143 142 void appendChildFrameRects(ChildFrameRects&); 144 143 void repaintChildrenDuringLayoutIfMoved(const ChildFrameRects&); -
trunk/Source/WebCore/rendering/RenderImage.cpp
r137960 r138770 223 223 if (!preferredLogicalWidthsDirty()) 224 224 setPreferredLogicalWidthsDirty(true); 225 LogicalExtentComputedValues computedValues; 226 computeLogicalWidthInRegion(computedValues); 227 LayoutUnit newWidth = computedValues.m_extent; 228 computeLogicalHeight(height(), 0, computedValues); 229 LayoutUnit newHeight = computedValues.m_extent; 225 226 bool hasOverrideSize = hasOverrideHeight() || hasOverrideWidth(); 227 if (!hasOverrideSize && !imageSizeChanged) { 228 LogicalExtentComputedValues computedValues; 229 computeLogicalWidthInRegion(computedValues); 230 LayoutUnit newWidth = computedValues.m_extent; 231 computeLogicalHeight(height(), 0, computedValues); 232 LayoutUnit newHeight = computedValues.m_extent; 233 234 imageSizeChanged = width() != newWidth || height() != newHeight; 235 } 230 236 231 237 // FIXME: We only need to recompute the containing block's preferred size … … 233 239 // There's no easy way to detect that shrink-to-fit is needed, always force a layout. 234 240 bool containingBlockNeedsToRecomputePreferredSize = 235 style()->logicalWidth(). type() == Percent236 || style()->logicalMaxWidth(). type() == Percent237 || style()->logicalMinWidth(). type() == Percent;238 239 if (imageSizeChanged || width() != newWidth || height() != newHeight|| containingBlockNeedsToRecomputePreferredSize) {241 style()->logicalWidth().isPercent() 242 || style()->logicalMaxWidth().isPercent() 243 || style()->logicalMinWidth().isPercent(); 244 245 if (imageSizeChanged || hasOverrideSize || containingBlockNeedsToRecomputePreferredSize) { 240 246 shouldRepaint = false; 241 247 if (!selfNeedsLayout())
Note:
See TracChangeset
for help on using the changeset viewer.