Changeset 83066 in webkit


Ignore:
Timestamp:
Apr 6, 2011 10:06:14 AM (13 years ago)
Author:
rniwa@webkit.org
Message:

2011-04-06 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Dimitri Glazkov.

Split getBorderPaddingMargin into two functions
https://bugs.webkit.org/show_bug.cgi?id=57947

  • rendering/RenderBlockLineLayout.cpp: (WebCore::borderPaddingMarginStart): Extracted from getBorderPaddingMargin. (WebCore::borderPaddingMarginEnd): Ditto. (WebCore::inlineLogicalWidth): Calls borderPaddingMarginStart and borderPaddingMarginEnd. (WebCore::RenderBlock::findNextLineBreak): Ditto.
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83065 r83066  
     12011-04-06  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Split getBorderPaddingMargin into two functions
     6        https://bugs.webkit.org/show_bug.cgi?id=57947
     7
     8        * rendering/RenderBlockLineLayout.cpp:
     9        (WebCore::borderPaddingMarginStart): Extracted from getBorderPaddingMargin.
     10        (WebCore::borderPaddingMarginEnd): Ditto.
     11        (WebCore::inlineLogicalWidth): Calls borderPaddingMarginStart and borderPaddingMarginEnd.
     12        (WebCore::RenderBlock::findNextLineBreak): Ditto.
     13
    1142011-04-06  MORITA Hajime  <morrita@google.com>
    215
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r83042 r83066  
    6161const unsigned cMaxLineDepth = 200;
    6262
    63 static int getBorderPaddingMargin(RenderBoxModelObject* child, bool endOfInline)
    64 {
    65     if (endOfInline)
    66         return child->marginEnd() + child->paddingEnd() + child->borderEnd();
     63static inline int borderPaddingMarginStart(RenderBoxModelObject* child)
     64{
     65    // FIXME: Should we call marginStartForChild instead?
    6766    return child->marginStart() + child->paddingStart() + child->borderStart();
     67}
     68
     69static inline int borderPaddingMarginEnd(RenderBoxModelObject* child)
     70{
     71    return child->marginEnd() + child->paddingEnd() + child->borderEnd();
    6872}
    6973
     
    7478    RenderObject* parent = child->parent();
    7579    while (parent->isInline() && !parent->isInlineBlockOrInlineTable() && lineDepth++ < cMaxLineDepth) {
     80        RenderBoxModelObject* parentAsBoxModelObject = toRenderBoxModelObject(parent);
     81        ASSERT(parentAsBoxModelObject);
    7682        if (start && !child->previousSibling())
    77             extraWidth += getBorderPaddingMargin(toRenderBoxModelObject(parent), false);
     83            extraWidth += borderPaddingMarginStart(parentAsBoxModelObject);
    7884        if (end && !child->nextSibling())
    79             extraWidth += getBorderPaddingMargin(toRenderBoxModelObject(parent), true);
     85            extraWidth += borderPaddingMarginEnd(parentAsBoxModelObject);
    8086        child = parent;
    8187        parent = child->parent();
     
    17191725            }
    17201726
    1721             tmpW += flowBox->marginStart() + flowBox->borderStart() + flowBox->paddingStart() +
    1722                     flowBox->marginEnd() + flowBox->borderEnd() + flowBox->paddingEnd();
     1727            tmpW += borderPaddingMarginStart(flowBox) + borderPaddingMarginEnd(flowBox);
    17231728        } else if (o->isReplaced()) {
    17241729            RenderBox* replacedBox = toRenderBox(o);
Note: See TracChangeset for help on using the changeset viewer.