Changeset 128238 in webkit


Ignore:
Timestamp:
Sep 11, 2012 4:20:44 PM (12 years ago)
Author:
tony@chromium.org
Message:

Pass the logical height and logical top into RenderBox::computeLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=96432

Reviewed by Ojan Vafai.

This allows us to call RenderBox::computeLogicalHeight without first having to call
setLogicalHeight() and setLogicalTop(). Previously, computeLogicalHeight would depend
on these values.

No new tests, this is just a refactor.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::updateLogicalHeight): Pass logicalHeight and logicalTop as params.
(WebCore::RenderBox::computeLogicalHeight): Use passed in values instead of calling logicalHeight/logicalTop.
(WebCore::RenderBox::computePositionedLogicalHeight): Pass the logicalHeight into computePositionedLogicalHeightUsing.
(WebCore::RenderBox::computePositionedLogicalHeightUsing): Pass in the logicalHeight as a parameter.

  • rendering/RenderBox.h:

(RenderBox): Update computePositionedLogicalHeightUsing and computeLogicalHeight.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128237 r128238  
     12012-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
    1222012-09-11  Joshua Bell  <jsbell@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r128215 r128238  
    19651965{
    19661966    LogicalExtentComputedValues computedValues;
    1967     computeLogicalHeight(computedValues);
     1967    computeLogicalHeight(logicalHeight(), logicalTop(), computedValues);
    19681968
    19691969    setLogicalHeight(computedValues.m_extent);
     
    19731973}
    19741974
    1975 void RenderBox::computeLogicalHeight(LogicalExtentComputedValues& computedValues) const
    1976 {
    1977     computedValues.m_extent = logicalHeight();
    1978     computedValues.m_position = logicalTop();
     1975void RenderBox::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
     1976{
     1977    computedValues.m_extent = logicalHeight;
     1978    computedValues.m_position = logicalTop;
    19791979
    19801980    // Cell height is managed by the table and inline non-replaced elements do not support a height property.
     
    20002000            if (hasPerpendicularContainingBlock) {
    20012001                bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), style());
    2002                 computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), logicalHeight(),
     2002                computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), computedValues.m_extent,
    20032003                    shouldFlipBeforeAfter ? computedValues.m_margins.m_after : computedValues.m_margins.m_before,
    20042004                    shouldFlipBeforeAfter ? computedValues.m_margins.m_before : computedValues.m_margins.m_after);
     
    20402040            heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight());
    20412041            if (heightResult == -1)
    2042                 heightResult = logicalHeight();
     2042                heightResult = computedValues.m_extent;
    20432043            heightResult = constrainLogicalHeightByMinMax(heightResult);
    20442044        } else {
     
    29312931
    29322932    // 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,
    29342935                                        logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    29352936                                        computedValues);
     
    29422943        LogicalExtentComputedValues maxValues;
    29432944
    2944         computePositionedLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
     2945        computePositionedLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    29452946                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    29462947                                            maxValues);
     
    29582959        LogicalExtentComputedValues minValues;
    29592960
    2960         computePositionedLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
     2961        computePositionedLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    29612962                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    29622963                                            minValues);
     
    30133014
    30143015void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
    3015                                                     LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
     3016                                                    LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
    30163017                                                    Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
    30173018                                                    LogicalExtentComputedValues& computedValues) const
     
    30253026
    30263027    LayoutUnit logicalHeightValue;
    3027     LayoutUnit contentLogicalHeight = logicalHeight() - bordersPlusPadding;
     3028    LayoutUnit contentLogicalHeight = logicalHeight - bordersPlusPadding;
    30283029
    30293030    LayoutUnit logicalTopValue = 0;
  • trunk/Source/WebCore/rendering/RenderBox.h

    r128201 r128238  
    367367    virtual void updateLogicalWidth();
    368368    virtual void updateLogicalHeight();
    369     void computeLogicalHeight(LogicalExtentComputedValues&) const;
     369    void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const;
    370370
    371371    RenderBoxRegionInfo* renderBoxRegionInfo(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage, RenderBoxRegionInfoFlags = CacheRenderBoxRegionInfo) const;
     
    593593                                            Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
    594594                                            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,
    597597                                             Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
    598598                                             LogicalExtentComputedValues&) const;
Note: See TracChangeset for help on using the changeset viewer.