- WebCore/ChangeLog +19 lines
Lines 1-3 WebCore/ChangeLog_sec1
1
2010-09-24  David Hyatt  <hyatt@apple.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        https://bugs.webkit.org/show_bug.cgi?id=46496, rename containingBlockWidthForContent to
6
        containingBlockLogicalWidthForContent.
7
8
        * rendering/RenderBlock.cpp:
9
        (WebCore::RenderBlock::localCaretRect):
10
        * rendering/RenderBox.cpp:
11
        (WebCore::RenderBox::containingBlockLogicalWidthForContent):
12
        (WebCore::RenderBox::computeLogicalWidth):
13
        (WebCore::RenderBox::computeReplacedWidthUsing):
14
        * rendering/RenderBox.h:
15
        * rendering/RenderBoxModelObject.cpp:
16
        (WebCore::RenderBoxModelObject::relativePositionOffsetX):
17
        (WebCore::RenderBoxModelObject::containingBlockLogicalWidthForContent):
18
        * rendering/RenderBoxModelObject.h:
19
1
2010-09-24  David Hyatt  <hyatt@apple.com>
20
2010-09-24  David Hyatt  <hyatt@apple.com>
2
21
3
        Reviewed by Sam Weinig.
22
        Reviewed by Sam Weinig.
- WebCore/rendering/RenderBlock.cpp -1 / +1 lines
Lines 5781-5787 IntRect RenderBlock::localCaretRect(Inli WebCore/rendering/RenderBlock.cpp_sec1
5781
            // FIXME: why call localToAbsoluteForContent() twice here, too?
5781
            // FIXME: why call localToAbsoluteForContent() twice here, too?
5782
            FloatPoint absRightPoint = localToAbsolute(FloatPoint(myRight, 0));
5782
            FloatPoint absRightPoint = localToAbsolute(FloatPoint(myRight, 0));
5783
5783
5784
            int containerRight = containingBlock()->x() + containingBlockWidthForContent();
5784
            int containerRight = containingBlock()->x() + containingBlockLogicalWidthForContent();
5785
            FloatPoint absContainerPoint = localToAbsolute(FloatPoint(containerRight, 0));
5785
            FloatPoint absContainerPoint = localToAbsolute(FloatPoint(containerRight, 0));
5786
5786
5787
            *extraWidthToEndOfLine = absContainerPoint.x() - absRightPoint.x();
5787
            *extraWidthToEndOfLine = absContainerPoint.x() - absRightPoint.x();
- WebCore/rendering/RenderBox.cpp -4 / +11 lines
Lines 1035-1046 IntRect RenderBox::clipRect(int tx, int WebCore/rendering/RenderBox.cpp_sec1
1035
    return IntRect(clipX, clipY, clipWidth, clipHeight);
1035
    return IntRect(clipX, clipY, clipWidth, clipHeight);
1036
}
1036
}
1037
1037
1038
int RenderBox::containingBlockWidthForContent() const
1038
int RenderBox::containingBlockLogicalWidthForContent() const
1039
{
1039
{
1040
    RenderBlock* cb = containingBlock();
1040
    RenderBlock* cb = containingBlock();
1041
    if (shrinkToAvoidFloats())
1041
    if (shrinkToAvoidFloats())
1042
        return cb->availableLogicalWidthForLine(y(), false);
1042
        return cb->availableLogicalWidthForLine(y(), false);
1043
    return cb->availableWidth();
1043
    return cb->availableLogicalWidth();
1044
}
1044
}
1045
1045
1046
void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
1046
void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
Lines 1360-1371 void RenderBox::computeLogicalWidth() WebCore/rendering/RenderBox.cpp_sec2
1360
1360
1361
    // The parent box is flexing us, so it has increased or decreased our
1361
    // The parent box is flexing us, so it has increased or decreased our
1362
    // width.  Use the width from the style context.
1362
    // width.  Use the width from the style context.
1363
    // FIXME: Account for block-flow in flexible boxes.
1364
    // https://bugs.webkit.org/show_bug.cgi?id=46418
1363
    if (hasOverrideSize() &&  parent()->style()->boxOrient() == HORIZONTAL
1365
    if (hasOverrideSize() &&  parent()->style()->boxOrient() == HORIZONTAL
1364
            && parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
1366
            && parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
1365
        setWidth(overrideSize());
1367
        setWidth(overrideSize());
1366
        return;
1368
        return;
1367
    }
1369
    }
1368
1370
1371
    // FIXME: Account for block-flow in flexible boxes.
1372
    // https://bugs.webkit.org/show_bug.cgi?id=46418
1369
    bool inVerticalBox = parent()->isFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
1373
    bool inVerticalBox = parent()->isFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
1370
    bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
1374
    bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
1371
    bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);
1375
    bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);
Lines 1373-1379 void RenderBox::computeLogicalWidth() WebCore/rendering/RenderBox.cpp_sec3
1373
    Length w = (treatAsReplaced) ? Length(computeReplacedWidth(), Fixed) : style()->width();
1377
    Length w = (treatAsReplaced) ? Length(computeReplacedWidth(), Fixed) : style()->width();
1374
1378
1375
    RenderBlock* cb = containingBlock();
1379
    RenderBlock* cb = containingBlock();
1376
    int containerWidth = max(0, containingBlockWidthForContent());
1380
    int containerWidth = max(0, containingBlockLogicalWidthForContent());
1377
1381
1378
    Length marginLeft = style()->marginLeft();
1382
    Length marginLeft = style()->marginLeft();
1379
    Length marginRight = style()->marginRight();
1383
    Length marginRight = style()->marginRight();
Lines 1724-1730 int RenderBox::computeReplacedWidthUsing WebCore/rendering/RenderBox.cpp_sec4
1724
        case Fixed:
1728
        case Fixed:
1725
            return computeContentBoxLogicalWidth(width.value());
1729
            return computeContentBoxLogicalWidth(width.value());
1726
        case Percent: {
1730
        case Percent: {
1727
            const int cw = isPositioned() ? containingBlockWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockWidthForContent();
1731
            // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the
1732
            // containing block's block-flow.
1733
            // https://bugs.webkit.org/show_bug.cgi?id=46496
1734
            const int cw = isPositioned() ? containingBlockWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent();
1728
            if (cw > 0)
1735
            if (cw > 0)
1729
                return computeContentBoxLogicalWidth(width.calcMinValue(cw));
1736
                return computeContentBoxLogicalWidth(width.calcMinValue(cw));
1730
        }
1737
        }
- WebCore/rendering/RenderBox.h -1 / +1 lines
Lines 219-225 public: WebCore/rendering/RenderBox.h_sec1
219
219
220
    virtual void repaintDuringLayoutIfMoved(const IntRect&);
220
    virtual void repaintDuringLayoutIfMoved(const IntRect&);
221
221
222
    virtual int containingBlockWidthForContent() const;
222
    virtual int containingBlockLogicalWidthForContent() const;
223
223
224
    virtual void computeLogicalWidth();
224
    virtual void computeLogicalWidth();
225
    virtual void computeLogicalHeight();
225
    virtual void computeLogicalHeight();
- WebCore/rendering/RenderBoxModelObject.cpp -3 / +3 lines
Lines 320-326 int RenderBoxModelObject::relativePositi WebCore/rendering/RenderBoxModelObject.cpp_sec1
320
{
320
{
321
    // Objects that shrink to avoid floats normally use available line width when computing containing block width.  However
321
    // Objects that shrink to avoid floats normally use available line width when computing containing block width.  However
322
    // in the case of relative positioning using percentages, we can't do this.  The offset should always be resolved using the
322
    // in the case of relative positioning using percentages, we can't do this.  The offset should always be resolved using the
323
    // available width of the containing block.  Therefore we don't use containingBlockWidthForContent() here, but instead explicitly
323
    // available width of the containing block.  Therefore we don't use containingBlockLogicalWidthForContent() here, but instead explicitly
324
    // call availableWidth on our containing block.
324
    // call availableWidth on our containing block.
325
    if (!style()->left().isAuto()) {
325
    if (!style()->left().isAuto()) {
326
        RenderBlock* cb = containingBlock();
326
        RenderBlock* cb = containingBlock();
Lines 1781-1789 void RenderBoxModelObject::paintBoxShado WebCore/rendering/RenderBoxModelObject.cpp_sec2
1781
    }
1781
    }
1782
}
1782
}
1783
1783
1784
int RenderBoxModelObject::containingBlockWidthForContent() const
1784
int RenderBoxModelObject::containingBlockLogicalWidthForContent() const
1785
{
1785
{
1786
    return containingBlock()->availableWidth();
1786
    return containingBlock()->availableLogicalWidth();
1787
}
1787
}
1788
1788
1789
} // namespace WebCore
1789
} // namespace WebCore
- WebCore/rendering/RenderBoxModelObject.h -1 / +1 lines
Lines 101-107 public: WebCore/rendering/RenderBoxModelObject.h_sec1
101
    bool hasHorizontalBordersPaddingOrMargin() const { return hasHorizontalBordersOrPadding() || marginLeft() != 0 || marginRight() != 0; }
101
    bool hasHorizontalBordersPaddingOrMargin() const { return hasHorizontalBordersOrPadding() || marginLeft() != 0 || marginRight() != 0; }
102
    bool hasHorizontalBordersOrPadding() const { return borderLeft() != 0 || borderRight() != 0 || paddingLeft() != 0 || paddingRight() != 0; }
102
    bool hasHorizontalBordersOrPadding() const { return borderLeft() != 0 || borderRight() != 0 || paddingLeft() != 0 || paddingRight() != 0; }
103
103
104
    virtual int containingBlockWidthForContent() const;
104
    virtual int containingBlockLogicalWidthForContent() const;
105
105
106
    virtual void childBecameNonInline(RenderObject* /*child*/) { }
106
    virtual void childBecameNonInline(RenderObject* /*child*/) { }
107
107

Return to Bug 46497