Changeset 128238 in webkit
- Timestamp:
- Sep 11, 2012 4:20:44 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128237 r128238 1 2012-09-11 Tony Chang <tony@chromium.org> 2 3 Pass the logical height and logical top into RenderBox::computeLogicalHeight 4 https://bugs.webkit.org/show_bug.cgi?id=96432 5 6 Reviewed by Ojan Vafai. 7 8 This allows us to call RenderBox::computeLogicalHeight without first having to call 9 setLogicalHeight() and setLogicalTop(). Previously, computeLogicalHeight would depend 10 on these values. 11 12 No new tests, this is just a refactor. 13 14 * rendering/RenderBox.cpp: 15 (WebCore::RenderBox::updateLogicalHeight): Pass logicalHeight and logicalTop as params. 16 (WebCore::RenderBox::computeLogicalHeight): Use passed in values instead of calling logicalHeight/logicalTop. 17 (WebCore::RenderBox::computePositionedLogicalHeight): Pass the logicalHeight into computePositionedLogicalHeightUsing. 18 (WebCore::RenderBox::computePositionedLogicalHeightUsing): Pass in the logicalHeight as a parameter. 19 * rendering/RenderBox.h: 20 (RenderBox): Update computePositionedLogicalHeightUsing and computeLogicalHeight. 21 1 22 2012-09-11 Joshua Bell <jsbell@chromium.org> 2 23 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r128215 r128238 1965 1965 { 1966 1966 LogicalExtentComputedValues computedValues; 1967 computeLogicalHeight( computedValues);1967 computeLogicalHeight(logicalHeight(), logicalTop(), computedValues); 1968 1968 1969 1969 setLogicalHeight(computedValues.m_extent); … … 1973 1973 } 1974 1974 1975 void RenderBox::computeLogicalHeight(L ogicalExtentComputedValues& computedValues) const1976 { 1977 computedValues.m_extent = logicalHeight ();1978 computedValues.m_position = logicalTop ();1975 void RenderBox::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const 1976 { 1977 computedValues.m_extent = logicalHeight; 1978 computedValues.m_position = logicalTop; 1979 1979 1980 1980 // Cell height is managed by the table and inline non-replaced elements do not support a height property. … … 2000 2000 if (hasPerpendicularContainingBlock) { 2001 2001 bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), style()); 2002 computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), logicalHeight(),2002 computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), computedValues.m_extent, 2003 2003 shouldFlipBeforeAfter ? computedValues.m_margins.m_after : computedValues.m_margins.m_before, 2004 2004 shouldFlipBeforeAfter ? computedValues.m_margins.m_before : computedValues.m_margins.m_after); … … 2040 2040 heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight()); 2041 2041 if (heightResult == -1) 2042 heightResult = logicalHeight();2042 heightResult = computedValues.m_extent; 2043 2043 heightResult = constrainLogicalHeightByMinMax(heightResult); 2044 2044 } else { … … 2931 2931 2932 2932 // Calculate constraint equation values for 'height' case. 2933 computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, 2933 LayoutUnit logicalHeight = computedValues.m_extent; 2934 computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, 2934 2935 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, 2935 2936 computedValues); … … 2942 2943 LogicalExtentComputedValues maxValues; 2943 2944 2944 computePositionedLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, 2945 computePositionedLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, 2945 2946 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, 2946 2947 maxValues); … … 2958 2959 LogicalExtentComputedValues minValues; 2959 2960 2960 computePositionedLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, 2961 computePositionedLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, 2961 2962 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, 2962 2963 minValues); … … 3013 3014 3014 3015 void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock, 3015 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, 3016 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight, 3016 3017 Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter, 3017 3018 LogicalExtentComputedValues& computedValues) const … … 3025 3026 3026 3027 LayoutUnit logicalHeightValue; 3027 LayoutUnit contentLogicalHeight = logicalHeight ()- bordersPlusPadding;3028 LayoutUnit contentLogicalHeight = logicalHeight - bordersPlusPadding; 3028 3029 3029 3030 LayoutUnit logicalTopValue = 0; -
trunk/Source/WebCore/rendering/RenderBox.h
r128201 r128238 367 367 virtual void updateLogicalWidth(); 368 368 virtual void updateLogicalHeight(); 369 void computeLogicalHeight(L ogicalExtentComputedValues&) const;369 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const; 370 370 371 371 RenderBoxRegionInfo* renderBoxRegionInfo(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage, RenderBoxRegionInfoFlags = CacheRenderBoxRegionInfo) const; … … 593 593 Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight, 594 594 LogicalExtentComputedValues&) const; 595 void computePositionedLogicalHeightUsing(SizeType, Length logicalHeight , const RenderBoxModelObject* containerBlock,596 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, 595 void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock, 596 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight, 597 597 Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom, 598 598 LogicalExtentComputedValues&) const;
Note: See TracChangeset
for help on using the changeset viewer.