Changeset 83098 in webkit


Ignore:
Timestamp:
Apr 6, 2011 2:08:20 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

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

Reviewed by Eric Seidel.

borderPaddingMarginStart and borderPaddingMarginEnd should take RenderInline
https://bugs.webkit.org/show_bug.cgi?id=57965

Changed the argument types of borderPaddingMarginStart and borderPaddingMarginEnd
from RenderBoxModelObject to RenderInline since they call marginStart and marginEnd
instead of marginStartForChild and marginEndForChild respectively.

Calling these two functions on RenderInline is okay because writing-mode cannot differ
from that of the containing block.

  • rendering/RenderBlockLineLayout.cpp: (WebCore::borderPaddingMarginStart): (WebCore::borderPaddingMarginEnd): (WebCore::inlineLogicalWidth):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83097 r83098  
     12011-04-06  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        borderPaddingMarginStart and borderPaddingMarginEnd should take RenderInline
     6        https://bugs.webkit.org/show_bug.cgi?id=57965
     7
     8        Changed the argument types of borderPaddingMarginStart and borderPaddingMarginEnd
     9        from RenderBoxModelObject to RenderInline since they call marginStart and marginEnd
     10        instead of marginStartForChild and marginEndForChild respectively.
     11
     12        Calling these two functions on RenderInline is okay because writing-mode cannot differ
     13        from that of the containing block.
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::borderPaddingMarginStart):
     17        (WebCore::borderPaddingMarginEnd):
     18        (WebCore::inlineLogicalWidth):
     19
    1202011-04-06  Sheriff Bot  <webkit.review.bot@gmail.com>
    221
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r83076 r83098  
    6161const unsigned cMaxLineDepth = 200;
    6262
    63 static inline int borderPaddingMarginStart(RenderBoxModelObject* child)
    64 {
    65     // FIXME: Should we call marginStartForChild instead?
     63static inline int borderPaddingMarginStart(RenderInline* child)
     64{
    6665    return child->marginStart() + child->paddingStart() + child->borderStart();
    6766}
    6867
    69 static inline int borderPaddingMarginEnd(RenderBoxModelObject* child)
     68static inline int borderPaddingMarginEnd(RenderInline* child)
    7069{
    7170    return child->marginEnd() + child->paddingEnd() + child->borderEnd();
     
    7776    int extraWidth = 0;
    7877    RenderObject* parent = child->parent();
    79     while (parent->isInline() && !parent->isInlineBlockOrInlineTable() && lineDepth++ < cMaxLineDepth) {
    80         RenderBoxModelObject* parentAsBoxModelObject = toRenderBoxModelObject(parent);
    81         ASSERT(parentAsBoxModelObject);
     78    while (parent->isRenderInline() && lineDepth++ < cMaxLineDepth) {
     79        RenderInline* parentAsRenderInline = toRenderInline(parent);
    8280        if (start && !child->previousSibling())
    83             extraWidth += borderPaddingMarginStart(parentAsBoxModelObject);
     81            extraWidth += borderPaddingMarginStart(parentAsRenderInline);
    8482        if (end && !child->nextSibling())
    85             extraWidth += borderPaddingMarginEnd(parentAsBoxModelObject);
     83            extraWidth += borderPaddingMarginEnd(parentAsRenderInline);
    8684        child = parent;
    8785        parent = child->parent();
Note: See TracChangeset for help on using the changeset viewer.