Commit 206f5a00 authored by rniwa@webkit.org's avatar rniwa@webkit.org

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.

git-svn-id: svn://svn.chromium.org/blink/trunk@83066 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6908d483
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.
2011-04-06 MORITA Hajime <morrita@google.com>
Reviewed by Dimitri Glazkov.
......@@ -60,23 +60,29 @@ namespace WebCore {
// We don't let our line box tree for a single line get any deeper than this.
const unsigned cMaxLineDepth = 200;
static int getBorderPaddingMargin(RenderBoxModelObject* child, bool endOfInline)
static inline int borderPaddingMarginStart(RenderBoxModelObject* child)
{
if (endOfInline)
return child->marginEnd() + child->paddingEnd() + child->borderEnd();
// FIXME: Should we call marginStartForChild instead?
return child->marginStart() + child->paddingStart() + child->borderStart();
}
static inline int borderPaddingMarginEnd(RenderBoxModelObject* child)
{
return child->marginEnd() + child->paddingEnd() + child->borderEnd();
}
static int inlineLogicalWidth(RenderObject* child, bool start = true, bool end = true)
{
unsigned lineDepth = 1;
int extraWidth = 0;
RenderObject* parent = child->parent();
while (parent->isInline() && !parent->isInlineBlockOrInlineTable() && lineDepth++ < cMaxLineDepth) {
RenderBoxModelObject* parentAsBoxModelObject = toRenderBoxModelObject(parent);
ASSERT(parentAsBoxModelObject);
if (start && !child->previousSibling())
extraWidth += getBorderPaddingMargin(toRenderBoxModelObject(parent), false);
extraWidth += borderPaddingMarginStart(parentAsBoxModelObject);
if (end && !child->nextSibling())
extraWidth += getBorderPaddingMargin(toRenderBoxModelObject(parent), true);
extraWidth += borderPaddingMarginEnd(parentAsBoxModelObject);
child = parent;
parent = child->parent();
}
......@@ -1718,8 +1724,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
}
}
tmpW += flowBox->marginStart() + flowBox->borderStart() + flowBox->paddingStart() +
flowBox->marginEnd() + flowBox->borderEnd() + flowBox->paddingEnd();
tmpW += borderPaddingMarginStart(flowBox) + borderPaddingMarginEnd(flowBox);
} else if (o->isReplaced()) {
RenderBox* replacedBox = toRenderBox(o);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment