Changeset 138668 in webkit
- Timestamp:
- Jan 2, 2013 3:54:21 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r138663 r138668 1 2013-01-02 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 When a block's height is determined by min-height/max-height, children with percentage heights are sized incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=26559 5 6 Reviewed by Tony Chang. 7 8 Add tests to ensure percent heights are correctly determined. 9 10 * fast/block/min-max-height-percent-height-child-expected.txt: Added. 11 * fast/block/min-max-height-percent-height-child.html: Added. 12 1 13 2013-01-02 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r138667 r138668 1 2013-01-02 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 When a block's height is determined by min-height/max-height, children with percentage heights are sized incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=26559 5 6 Reviewed by Tony Chang. 7 8 Percentage logical height computation now takes into account the min and max height of the container. 9 10 Test: fast/block/min-max-height-percent-height-child.html 11 12 * rendering/RenderBox.cpp: 13 (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax): Added. Like constrainLogicalHeightByMinMax, 14 but constrains the content box instead of the border box. 15 (WebCore): 16 (WebCore::RenderBox::computeContentLogicalHeight): Make const so it can be called from the const method 17 constrainContentBoxLogicalHeightByMinMax. 18 (WebCore::RenderBox::computePercentageLogicalHeight): Use constrainContentBoxLogicalHeightByMinMax to properly 19 respect min and max height on the containing box when computing the percentage height. 20 * rendering/RenderBox.h: 21 (RenderBox): 22 1 23 2013-01-02 Tony Chang <tony@chromium.org> 2 24 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r138332 r138668 471 471 } 472 472 473 LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight) const 474 { 475 RenderStyle* styleToUse = style(); 476 if (!styleToUse->logicalMaxHeight().isUndefined()) { 477 LayoutUnit maxH = computeContentLogicalHeight(MaxSize, styleToUse->logicalMaxHeight()); 478 if (maxH != -1) 479 logicalHeight = min(logicalHeight, maxH); 480 } 481 return max(logicalHeight, computeContentLogicalHeight(MinSize, styleToUse->logicalMinHeight())); 482 } 483 473 484 IntRect RenderBox::absoluteContentBox() const 474 485 { … … 2299 2310 } 2300 2311 2301 LayoutUnit RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height) 2312 LayoutUnit RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height) const 2302 2313 { 2303 2314 LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height); … … 2382 2393 } 2383 2394 } else if (cbstyle->logicalHeight().isFixed()) { 2384 LayoutUnit contentBoxHeight WithScrollbar= cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle->logicalHeight().value());2385 availableHeight = max<LayoutUnit>(0, c ontentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight());2395 LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle->logicalHeight().value()); 2396 availableHeight = max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight())); 2386 2397 } else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) { 2387 2398 // We need to recur and compute the percentage height for our containing block. … … 2389 2400 if (heightWithScrollbar != -1) { 2390 2401 LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar); 2391 availableHeight = max<LayoutUnit>(0, contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight()); 2402 // We need to adjust for min/max height because this method does not 2403 // handle the min/max of the current block, its caller does. So the 2404 // return value from the recursive call will not have been adjusted 2405 // yet. 2406 LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight()); 2407 availableHeight = max<LayoutUnit>(0, contentBoxHeight); 2392 2408 } 2393 2409 } else if (cb->isRenderView() || isOutOfFlowPositionedWithSpecifiedHeight) { -
trunk/Source/WebCore/rendering/RenderBox.h
r138332 r138668 83 83 LayoutUnit constrainLogicalWidthInRegionByMinMax(LayoutUnit, LayoutUnit, RenderBlock*, RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = 0) const; 84 84 LayoutUnit constrainLogicalHeightByMinMax(LayoutUnit) const; 85 LayoutUnit constrainContentBoxLogicalHeightByMinMax(LayoutUnit) const; 85 86 86 87 int pixelSnappedLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedHeight() : pixelSnappedWidth(); } … … 414 415 LayoutUnit computeLogicalWidthInRegionUsing(SizeType, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const; 415 416 LayoutUnit computeLogicalHeightUsing(SizeType, const Length& height) const; 416 LayoutUnit computeContentLogicalHeight(SizeType, const Length& height) ;417 LayoutUnit computeContentLogicalHeight(SizeType, const Length& height) const; 417 418 LayoutUnit computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height) const; 418 419 LayoutUnit computeReplacedLogicalWidthUsing(SizeType, Length width) const;
Note: See TracChangeset
for help on using the changeset viewer.