WebCore/ChangeLog

 12010-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
1202010-09-24 David Hyatt <hyatt@apple.com>
221
322 Reviewed by Sam Weinig.
68282

WebCore/rendering/RenderBlock.cpp

@@IntRect RenderBlock::localCaretRect(Inli
57815781 // FIXME: why call localToAbsoluteForContent() twice here, too?
57825782 FloatPoint absRightPoint = localToAbsolute(FloatPoint(myRight, 0));
57835783
5784  int containerRight = containingBlock()->x() + containingBlockWidthForContent();
 5784 int containerRight = containingBlock()->x() + containingBlockLogicalWidthForContent();
57855785 FloatPoint absContainerPoint = localToAbsolute(FloatPoint(containerRight, 0));
57865786
57875787 *extraWidthToEndOfLine = absContainerPoint.x() - absRightPoint.x();
68282

WebCore/rendering/RenderBox.cpp

@@IntRect RenderBox::clipRect(int tx, int
10351035 return IntRect(clipX, clipY, clipWidth, clipHeight);
10361036}
10371037
1038 int RenderBox::containingBlockWidthForContent() const
 1038int RenderBox::containingBlockLogicalWidthForContent() const
10391039{
10401040 RenderBlock* cb = containingBlock();
10411041 if (shrinkToAvoidFloats())
10421042 return cb->availableLogicalWidthForLine(y(), false);
1043  return cb->availableWidth();
 1043 return cb->availableLogicalWidth();
10441044}
10451045
10461046void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const

@@void RenderBox::computeLogicalWidth()
13601360
13611361 // The parent box is flexing us, so it has increased or decreased our
13621362 // 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
13631365 if (hasOverrideSize() && parent()->style()->boxOrient() == HORIZONTAL
13641366 && parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
13651367 setWidth(overrideSize());
13661368 return;
13671369 }
13681370
 1371 // FIXME: Account for block-flow in flexible boxes.
 1372 // https://bugs.webkit.org/show_bug.cgi?id=46418
13691373 bool inVerticalBox = parent()->isFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
13701374 bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
13711375 bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);

@@void RenderBox::computeLogicalWidth()
13731377 Length w = (treatAsReplaced) ? Length(computeReplacedWidth(), Fixed) : style()->width();
13741378
13751379 RenderBlock* cb = containingBlock();
1376  int containerWidth = max(0, containingBlockWidthForContent());
 1380 int containerWidth = max(0, containingBlockLogicalWidthForContent());
13771381
13781382 Length marginLeft = style()->marginLeft();
13791383 Length marginRight = style()->marginRight();

@@int RenderBox::computeReplacedWidthUsing
17241728 case Fixed:
17251729 return computeContentBoxLogicalWidth(width.value());
17261730 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();
17281735 if (cw > 0)
17291736 return computeContentBoxLogicalWidth(width.calcMinValue(cw));
17301737 }
68282

WebCore/rendering/RenderBox.h

@@public:
219219
220220 virtual void repaintDuringLayoutIfMoved(const IntRect&);
221221
222  virtual int containingBlockWidthForContent() const;
 222 virtual int containingBlockLogicalWidthForContent() const;
223223
224224 virtual void computeLogicalWidth();
225225 virtual void computeLogicalHeight();
68276

WebCore/rendering/RenderBoxModelObject.cpp

@@int RenderBoxModelObject::relativePositi
320320{
321321 // Objects that shrink to avoid floats normally use available line width when computing containing block width. However
322322 // 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
324324 // call availableWidth on our containing block.
325325 if (!style()->left().isAuto()) {
326326 RenderBlock* cb = containingBlock();

@@void RenderBoxModelObject::paintBoxShado
17811781 }
17821782}
17831783
1784 int RenderBoxModelObject::containingBlockWidthForContent() const
 1784int RenderBoxModelObject::containingBlockLogicalWidthForContent() const
17851785{
1786  return containingBlock()->availableWidth();
 1786 return containingBlock()->availableLogicalWidth();
17871787}
17881788
17891789} // namespace WebCore
68200

WebCore/rendering/RenderBoxModelObject.h

@@public:
101101 bool hasHorizontalBordersPaddingOrMargin() const { return hasHorizontalBordersOrPadding() || marginLeft() != 0 || marginRight() != 0; }
102102 bool hasHorizontalBordersOrPadding() const { return borderLeft() != 0 || borderRight() != 0 || paddingLeft() != 0 || paddingRight() != 0; }
103103
104  virtual int containingBlockWidthForContent() const;
 104 virtual int containingBlockLogicalWidthForContent() const;
105105
106106 virtual void childBecameNonInline(RenderObject* /*child*/) { }
107107
68174