Changeset 90773 in webkit


Ignore:
Timestamp:
Jul 11, 2011 12:02:17 PM (13 years ago)
Author:
tony@chromium.org
Message:

rename RenderObject::isFlexibleBox to isDeprecatedFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=64217

Reviewed by Ojan Vafai.

This is to make way for the new flexbox needing a similar method.
RenderObject also has isFlexingChildren() and isStretchingChildren(),
but we may be able to use those for the new flexbox as well so I
didn't rename them.

No new tests, just refactoring.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::removeChild):
(WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
(WebCore::shouldCheckLines):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
(WebCore::RenderBox::computeLogicalWidth):
(WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
(WebCore::RenderBox::computeLogicalHeight):

  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):

  • rendering/RenderDeprecatedFlexibleBox.h:

(WebCore::RenderDeprecatedFlexibleBox::isDeprecatedFlexibleBox):

  • rendering/RenderObject.h:

(WebCore::RenderObject::isDeprecatedFlexibleBox):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90769 r90773  
     12011-07-11  Tony Chang  <tony@chromium.org>
     2
     3        rename RenderObject::isFlexibleBox to isDeprecatedFlexibleBox
     4        https://bugs.webkit.org/show_bug.cgi?id=64217
     5
     6        Reviewed by Ojan Vafai.
     7
     8        This is to make way for the new flexbox needing a similar method.
     9        RenderObject also has isFlexingChildren() and isStretchingChildren(),
     10        but we may be able to use those for the new flexbox as well so I
     11        didn't rename them.
     12
     13        No new tests, just refactoring.
     14
     15        * rendering/RenderBlock.cpp:
     16        (WebCore::RenderBlock::removeChild):
     17        (WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
     18        (WebCore::shouldCheckLines):
     19        * rendering/RenderBox.cpp:
     20        (WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
     21        (WebCore::RenderBox::computeLogicalWidth):
     22        (WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
     23        (WebCore::RenderBox::computeLogicalHeight):
     24        * rendering/RenderDeprecatedFlexibleBox.cpp:
     25        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
     26        * rendering/RenderDeprecatedFlexibleBox.h:
     27        (WebCore::RenderDeprecatedFlexibleBox::isDeprecatedFlexibleBox):
     28        * rendering/RenderObject.h:
     29        (WebCore::RenderObject::isDeprecatedFlexibleBox):
     30
    1312011-07-11  Nate Chapin  <japhet@chromium.org>
    232
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r90698 r90773  
    10461046
    10471047    RenderObject* child = prev ? prev : next;
    1048     if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && !isFlexibleBox()) {
     1048    if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && !isDeprecatedFlexibleBox()) {
    10491049        // The removal has knocked us down to containing only a single anonymous
    10501050        // box.  We can go ahead and pull the content right back up into our
     
    14531453bool RenderBlock::expandsToEncloseOverhangingFloats() const
    14541454{
    1455     return isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || (parent() && parent()->isFlexibleBox())
     1455    return isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || (parent() && parent()->isDeprecatedFlexibleBox())
    14561456           || hasColumns() || isTableCell() || isFieldset() || isWritingModeRoot() || isRoot();
    14571457}
     
    55095509    return !obj->isFloatingOrPositioned() && !obj->isRunIn() &&
    55105510            obj->isBlockFlow() && obj->style()->height().isAuto() &&
    5511             (!obj->isFlexibleBox() || obj->style()->boxOrient() == VERTICAL);
     5511            (!obj->isDeprecatedFlexibleBox() || obj->style()->boxOrient() == VERTICAL);
    55125512}
    55135513
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r90734 r90773  
    228228        if (parentBlock) {
    229229            RenderObject* parent = parentBlock->parent();
    230             if (parent && parent->isFlexibleBox())
     230            if (parent && parent->isDeprecatedFlexibleBox())
    231231                parentBlock = toRenderBlock(parent);
    232232
     
    15501550    // https://bugs.webkit.org/show_bug.cgi?id=46418
    15511551    if (hasOverrideSize() &&  parent()->style()->boxOrient() == HORIZONTAL
    1552             && parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
     1552            && parent()->isDeprecatedFlexibleBox() && parent()->isFlexingChildren()) {
    15531553        setLogicalWidth(overrideWidth());
    15541554        return;
     
    15571557    // FIXME: Account for block-flow in flexible boxes.
    15581558    // https://bugs.webkit.org/show_bug.cgi?id=46418
    1559     bool inVerticalBox = parent()->isFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
     1559    bool inVerticalBox = parent()->isDeprecatedFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
    15601560    bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
    15611561    bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);
     
    16171617
    16181618    if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (logicalWidth() + marginStart() + marginEnd())
    1619             && !isFloating() && !isInline() && !cb->isFlexibleBox())
     1619            && !isFloating() && !isInline() && !cb->isDeprecatedFlexibleBox())
    16201620        cb->setMarginEndForChild(this, containerLogicalWidth - logicalWidth() - cb->marginStartForChild(this));
    16211621}
     
    16761676    // FIXME: Think about block-flow here.
    16771677    // https://bugs.webkit.org/show_bug.cgi?id=46473
    1678     if (parent()->isFlexibleBox()
     1678    if (parent()->isDeprecatedFlexibleBox()
    16791679            && (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH))
    16801680        return true;
     
    16851685    // FIXME: Think about block-flow here.
    16861686    // https://bugs.webkit.org/show_bug.cgi?id=46473
    1687     if (logicalWidth.type() == Auto && !(parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag)))
     1687    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)))
    16881688        return true;
    16891689
     
    17541754        // FIXME: Account for block-flow in flexible boxes.
    17551755        // https://bugs.webkit.org/show_bug.cgi?id=46418
    1756         bool inHorizontalBox = parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
     1756        bool inHorizontalBox = parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
    17571757        bool stretching = parent()->style()->boxAlign() == BSTRETCH;
    17581758        bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inHorizontalBox || !stretching);
     
    17631763        // FIXME: Account for block-flow in flexible boxes.
    17641764        // https://bugs.webkit.org/show_bug.cgi?id=46418
    1765         if (hasOverrideSize() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL
     1765        if (hasOverrideSize() && parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == VERTICAL
    17661766                && parent()->isFlexingChildren())
    17671767            h = Length(overrideHeight() - borderAndPaddingLogicalHeight(), Fixed);
     
    17761776        // FIXME: Account for block-flow in flexible boxes.
    17771777        // https://bugs.webkit.org/show_bug.cgi?id=46418
    1778         if (h.isAuto() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
     1778        if (h.isAuto() && parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
    17791779                && parent()->isStretchingChildren()) {
    17801780            h = Length(parentBox()->contentLogicalHeight() - marginBefore() - marginAfter() - borderAndPaddingLogicalHeight(), Fixed);
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r90668 r90773  
    217217
    218218    if (previousSize != size()
    219         || (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
     219        || (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
    220220        && parent()->style()->boxAlign() == BSTRETCH))
    221221        relayoutChildren = true;
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h

    r88952 r90773  
    4747    virtual bool avoidsFloats() const { return true; }
    4848
    49     virtual bool isFlexibleBox() const { return true; }
     49    virtual bool isDeprecatedFlexibleBox() const { return true; }
    5050    virtual bool isFlexingChildren() const { return m_flexingChildren; }
    5151    virtual bool isStretchingChildren() const { return m_stretchingChildren; }
  • trunk/Source/WebCore/rendering/RenderObject.h

    r90734 r90773  
    740740    virtual void destroy();
    741741
    742     // Virtual function helpers for CSS3 Flexible Box Layout
    743     virtual bool isFlexibleBox() const { return false; }
     742    // Virtual function helpers for the deprecated Flexible Box Layout (display: -webkit-box)
     743    virtual bool isDeprecatedFlexibleBox() const { return false; }
    744744    virtual bool isFlexingChildren() const { return false; }
    745745    virtual bool isStretchingChildren() const { return false; }
Note: See TracChangeset for help on using the changeset viewer.