|
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 |
} |