|
Lines 576-585
int RenderBox::reflectionOffset() const
a/Source/WebCore/rendering/RenderBox.cpp_sec1
|
| 576 |
{ |
576 |
{ |
| 577 |
if (!style()->boxReflect()) |
577 |
if (!style()->boxReflect()) |
| 578 |
return 0; |
578 |
return 0; |
| 579 |
RenderView* renderView = view(); |
|
|
| 580 |
if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxReflect()->direction() == ReflectionRight) |
579 |
if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxReflect()->direction() == ReflectionRight) |
| 581 |
return valueForLength(style()->boxReflect()->offset(), borderBoxRect().width(), renderView); |
580 |
return valueForLength(style()->boxReflect()->offset(), borderBoxRect().width()); |
| 582 |
return valueForLength(style()->boxReflect()->offset(), borderBoxRect().height(), renderView); |
581 |
return valueForLength(style()->boxReflect()->offset(), borderBoxRect().height()); |
| 583 |
} |
582 |
} |
| 584 |
|
583 |
|
| 585 |
LayoutRect RenderBox::reflectedRect(const LayoutRect& r) const |
584 |
LayoutRect RenderBox::reflectedRect(const LayoutRect& r) const |
|
Lines 1089-1095
void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
a/Source/WebCore/rendering/RenderBox.cpp_sec2
|
| 1089 |
// To avoid the background color bleeding out behind the border, we'll render background and border |
1088 |
// To avoid the background color bleeding out behind the border, we'll render background and border |
| 1090 |
// into a transparency layer, and then clip that in one go (which requires setting up the clip before |
1089 |
// into a transparency layer, and then clip that in one go (which requires setting up the clip before |
| 1091 |
// beginning the layer). |
1090 |
// beginning the layer). |
| 1092 |
RoundedRect border = style()->getRoundedBorderFor(paintRect, view()); |
1091 |
RoundedRect border = style()->getRoundedBorderFor(paintRect, this); |
| 1093 |
stateSaver.save(); |
1092 |
stateSaver.save(); |
| 1094 |
paintInfo.context->clipRoundedRect(border); |
1093 |
paintInfo.context->clipRoundedRect(border); |
| 1095 |
paintInfo.context->beginTransparencyLayer(1); |
1094 |
paintInfo.context->beginTransparencyLayer(1); |
|
Lines 1408-1414
bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
a/Source/WebCore/rendering/RenderBox.cpp_sec3
|
| 1408 |
IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion)); |
1407 |
IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion)); |
| 1409 |
paintInfo.context->save(); |
1408 |
paintInfo.context->save(); |
| 1410 |
if (style()->hasBorderRadius()) |
1409 |
if (style()->hasBorderRadius()) |
| 1411 |
paintInfo.context->clipRoundedRect(style()->getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, size()))); |
1410 |
paintInfo.context->clipRoundedRect(style()->getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, size()), this)); |
| 1412 |
paintInfo.context->clip(clipRect); |
1411 |
paintInfo.context->clip(clipRect); |
| 1413 |
return true; |
1412 |
return true; |
| 1414 |
} |
1413 |
} |
|
Lines 1448-1457
LayoutRect RenderBox::clipRect(const LayoutPoint& location, RenderRegion* region
a/Source/WebCore/rendering/RenderBox.cpp_sec4
|
| 1448 |
{ |
1447 |
{ |
| 1449 |
LayoutRect borderBoxRect = borderBoxRectInRegion(region); |
1448 |
LayoutRect borderBoxRect = borderBoxRectInRegion(region); |
| 1450 |
LayoutRect clipRect = LayoutRect(borderBoxRect.location() + location, borderBoxRect.size()); |
1449 |
LayoutRect clipRect = LayoutRect(borderBoxRect.location() + location, borderBoxRect.size()); |
| 1451 |
RenderView* renderView = view(); |
|
|
| 1452 |
|
1450 |
|
| 1453 |
if (!style()->clipLeft().isAuto()) { |
1451 |
if (!style()->clipLeft().isAuto()) { |
| 1454 |
LayoutUnit c = valueForLength(style()->clipLeft(), borderBoxRect.width(), renderView); |
1452 |
LayoutUnit c = valueForLength(style()->clipLeft(), borderBoxRect.width()); |
| 1455 |
clipRect.move(c, 0); |
1453 |
clipRect.move(c, 0); |
| 1456 |
clipRect.contract(c, 0); |
1454 |
clipRect.contract(c, 0); |
| 1457 |
} |
1455 |
} |
|
Lines 1460-1475
LayoutRect RenderBox::clipRect(const LayoutPoint& location, RenderRegion* region
a/Source/WebCore/rendering/RenderBox.cpp_sec5
|
| 1460 |
// from the left and top edges. Therefore it's better to avoid constraining to smaller widths and heights. |
1458 |
// from the left and top edges. Therefore it's better to avoid constraining to smaller widths and heights. |
| 1461 |
|
1459 |
|
| 1462 |
if (!style()->clipRight().isAuto()) |
1460 |
if (!style()->clipRight().isAuto()) |
| 1463 |
clipRect.contract(width() - valueForLength(style()->clipRight(), width(), renderView), 0); |
1461 |
clipRect.contract(width() - valueForLength(style()->clipRight(), width()), 0); |
| 1464 |
|
1462 |
|
| 1465 |
if (!style()->clipTop().isAuto()) { |
1463 |
if (!style()->clipTop().isAuto()) { |
| 1466 |
LayoutUnit c = valueForLength(style()->clipTop(), borderBoxRect.height(), renderView); |
1464 |
LayoutUnit c = valueForLength(style()->clipTop(), borderBoxRect.height()); |
| 1467 |
clipRect.move(0, c); |
1465 |
clipRect.move(0, c); |
| 1468 |
clipRect.contract(0, c); |
1466 |
clipRect.contract(0, c); |
| 1469 |
} |
1467 |
} |
| 1470 |
|
1468 |
|
| 1471 |
if (!style()->clipBottom().isAuto()) |
1469 |
if (!style()->clipBottom().isAuto()) |
| 1472 |
clipRect.contract(0, height() - valueForLength(style()->clipBottom(), height(), renderView)); |
1470 |
clipRect.contract(0, height() - valueForLength(style()->clipBottom(), height())); |
| 1473 |
|
1471 |
|
| 1474 |
return clipRect; |
1472 |
return clipRect; |
| 1475 |
} |
1473 |
} |
|
Lines 1994-2002
void RenderBox::computeLogicalWidthInRegion(LogicalExtentComputedValues& compute
a/Source/WebCore/rendering/RenderBox.cpp_sec6
|
| 1994 |
|
1992 |
|
| 1995 |
if (isInline() && !isInlineBlockOrInlineTable()) { |
1993 |
if (isInline() && !isInlineBlockOrInlineTable()) { |
| 1996 |
// just calculate margins |
1994 |
// just calculate margins |
| 1997 |
RenderView* renderView = view(); |
1995 |
computedValues.m_margins.m_start = minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth); |
| 1998 |
computedValues.m_margins.m_start = minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth, renderView); |
1996 |
computedValues.m_margins.m_end = minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth); |
| 1999 |
computedValues.m_margins.m_end = minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth, renderView); |
|
|
| 2000 |
if (treatAsReplaced) |
1997 |
if (treatAsReplaced) |
| 2001 |
computedValues.m_extent = max<LayoutUnit>(floatValueForLength(logicalWidthLength, 0) + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth()); |
1998 |
computedValues.m_extent = max<LayoutUnit>(floatValueForLength(logicalWidthLength, 0) + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth()); |
| 2002 |
return; |
1999 |
return; |
|
Lines 2015-2023
void RenderBox::computeLogicalWidthInRegion(LogicalExtentComputedValues& compute
a/Source/WebCore/rendering/RenderBox.cpp_sec7
|
| 2015 |
|
2012 |
|
| 2016 |
// Margin calculations. |
2013 |
// Margin calculations. |
| 2017 |
if (hasPerpendicularContainingBlock || isFloating() || isInline()) { |
2014 |
if (hasPerpendicularContainingBlock || isFloating() || isInline()) { |
| 2018 |
RenderView* renderView = view(); |
2015 |
computedValues.m_margins.m_start = minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth); |
| 2019 |
computedValues.m_margins.m_start = minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth, renderView); |
2016 |
computedValues.m_margins.m_end = minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth); |
| 2020 |
computedValues.m_margins.m_end = minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth, renderView); |
|
|
| 2021 |
} else { |
2017 |
} else { |
| 2022 |
LayoutUnit containerLogicalWidthForAutoMargins = containerLogicalWidth; |
2018 |
LayoutUnit containerLogicalWidthForAutoMargins = containerLogicalWidth; |
| 2023 |
if (avoidsFloats() && cb->containsFloats()) |
2019 |
if (avoidsFloats() && cb->containsFloats()) |
|
Lines 2048-2056
LayoutUnit RenderBox::fillAvailableMeasure(LayoutUnit availableLogicalWidth) con
a/Source/WebCore/rendering/RenderBox.cpp_sec8
|
| 2048 |
|
2044 |
|
| 2049 |
LayoutUnit RenderBox::fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd) const |
2045 |
LayoutUnit RenderBox::fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd) const |
| 2050 |
{ |
2046 |
{ |
| 2051 |
RenderView* renderView = view(); |
2047 |
marginStart = minimumValueForLength(style()->marginStart(), availableLogicalWidth); |
| 2052 |
marginStart = minimumValueForLength(style()->marginStart(), availableLogicalWidth, renderView); |
2048 |
marginEnd = minimumValueForLength(style()->marginEnd(), availableLogicalWidth); |
| 2053 |
marginEnd = minimumValueForLength(style()->marginEnd(), availableLogicalWidth, renderView); |
|
|
| 2054 |
return availableLogicalWidth - marginStart - marginEnd; |
2049 |
return availableLogicalWidth - marginStart - marginEnd; |
| 2055 |
} |
2050 |
} |
| 2056 |
|
2051 |
|
|
Lines 2100-2106
LayoutUnit RenderBox::computeLogicalWidthInRegionUsing(SizeType widthType, Layou
a/Source/WebCore/rendering/RenderBox.cpp_sec9
|
| 2100 |
|
2095 |
|
| 2101 |
if (!logicalWidth.isIntrinsicOrAuto()) { |
2096 |
if (!logicalWidth.isIntrinsicOrAuto()) { |
| 2102 |
// FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead. |
2097 |
// FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead. |
| 2103 |
return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth, view())); |
2098 |
return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, availableLogicalWidth)); |
| 2104 |
} |
2099 |
} |
| 2105 |
|
2100 |
|
| 2106 |
if (logicalWidth.isIntrinsic()) |
2101 |
if (logicalWidth.isIntrinsic()) |
|
Lines 2196-2207
void RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, Layo
a/Source/WebCore/rendering/RenderBox.cpp_sec10
|
| 2196 |
const RenderStyle* containingBlockStyle = containingBlock->style(); |
2191 |
const RenderStyle* containingBlockStyle = containingBlock->style(); |
| 2197 |
Length marginStartLength = style()->marginStartUsing(containingBlockStyle); |
2192 |
Length marginStartLength = style()->marginStartUsing(containingBlockStyle); |
| 2198 |
Length marginEndLength = style()->marginEndUsing(containingBlockStyle); |
2193 |
Length marginEndLength = style()->marginEndUsing(containingBlockStyle); |
| 2199 |
RenderView* renderView = view(); |
|
|
| 2200 |
|
2194 |
|
| 2201 |
if (isFloating() || isInline()) { |
2195 |
if (isFloating() || isInline()) { |
| 2202 |
// Inline blocks/tables and floats don't have their margins increased. |
2196 |
// Inline blocks/tables and floats don't have their margins increased. |
| 2203 |
marginStart = minimumValueForLength(marginStartLength, containerWidth, renderView); |
2197 |
marginStart = minimumValueForLength(marginStartLength, containerWidth); |
| 2204 |
marginEnd = minimumValueForLength(marginEndLength, containerWidth, renderView); |
2198 |
marginEnd = minimumValueForLength(marginEndLength, containerWidth); |
| 2205 |
return; |
2199 |
return; |
| 2206 |
} |
2200 |
} |
| 2207 |
|
2201 |
|
|
Lines 2209-2216
void RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, Layo
a/Source/WebCore/rendering/RenderBox.cpp_sec11
|
| 2209 |
if ((marginStartLength.isAuto() && marginEndLength.isAuto() && childWidth < containerWidth) |
2203 |
if ((marginStartLength.isAuto() && marginEndLength.isAuto() && childWidth < containerWidth) |
| 2210 |
|| (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlock->style()->textAlign() == WEBKIT_CENTER)) { |
2204 |
|| (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlock->style()->textAlign() == WEBKIT_CENTER)) { |
| 2211 |
// Other browsers center the margin box for align=center elements so we match them here. |
2205 |
// Other browsers center the margin box for align=center elements so we match them here. |
| 2212 |
LayoutUnit marginStartWidth = minimumValueForLength(marginStartLength, containerWidth, renderView); |
2206 |
LayoutUnit marginStartWidth = minimumValueForLength(marginStartLength, containerWidth); |
| 2213 |
LayoutUnit marginEndWidth = minimumValueForLength(marginEndLength, containerWidth, renderView); |
2207 |
LayoutUnit marginEndWidth = minimumValueForLength(marginEndLength, containerWidth); |
| 2214 |
LayoutUnit centeredMarginBoxStart = max<LayoutUnit>(0, (containerWidth - childWidth - marginStartWidth - marginEndWidth) / 2); |
2208 |
LayoutUnit centeredMarginBoxStart = max<LayoutUnit>(0, (containerWidth - childWidth - marginStartWidth - marginEndWidth) / 2); |
| 2215 |
marginStart = centeredMarginBoxStart + marginStartWidth; |
2209 |
marginStart = centeredMarginBoxStart + marginStartWidth; |
| 2216 |
marginEnd = containerWidth - childWidth - marginStart + marginEndWidth; |
2210 |
marginEnd = containerWidth - childWidth - marginStart + marginEndWidth; |
|
Lines 2219-2225
void RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, Layo
a/Source/WebCore/rendering/RenderBox.cpp_sec12
|
| 2219 |
|
2213 |
|
| 2220 |
// Case Two: The object is being pushed to the start of the containing block's available logical width. |
2214 |
// Case Two: The object is being pushed to the start of the containing block's available logical width. |
| 2221 |
if (marginEndLength.isAuto() && childWidth < containerWidth) { |
2215 |
if (marginEndLength.isAuto() && childWidth < containerWidth) { |
| 2222 |
marginStart = valueForLength(marginStartLength, containerWidth, renderView); |
2216 |
marginStart = valueForLength(marginStartLength, containerWidth); |
| 2223 |
marginEnd = containerWidth - childWidth - marginStart; |
2217 |
marginEnd = containerWidth - childWidth - marginStart; |
| 2224 |
return; |
2218 |
return; |
| 2225 |
} |
2219 |
} |
|
Lines 2228-2242
void RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, Layo
a/Source/WebCore/rendering/RenderBox.cpp_sec13
|
| 2228 |
bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT) |
2222 |
bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT) |
| 2229 |
|| (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT)); |
2223 |
|| (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT)); |
| 2230 |
if ((marginStartLength.isAuto() && childWidth < containerWidth) || pushToEndFromTextAlign) { |
2224 |
if ((marginStartLength.isAuto() && childWidth < containerWidth) || pushToEndFromTextAlign) { |
| 2231 |
marginEnd = valueForLength(marginEndLength, containerWidth, renderView); |
2225 |
marginEnd = valueForLength(marginEndLength, containerWidth); |
| 2232 |
marginStart = containerWidth - childWidth - marginEnd; |
2226 |
marginStart = containerWidth - childWidth - marginEnd; |
| 2233 |
return; |
2227 |
return; |
| 2234 |
} |
2228 |
} |
| 2235 |
|
2229 |
|
| 2236 |
// Case Four: Either no auto margins, or our width is >= the container width (css2.1, 10.3.3). In that case |
2230 |
// Case Four: Either no auto margins, or our width is >= the container width (css2.1, 10.3.3). In that case |
| 2237 |
// auto margins will just turn into 0. |
2231 |
// auto margins will just turn into 0. |
| 2238 |
marginStart = minimumValueForLength(marginStartLength, containerWidth, renderView); |
2232 |
marginStart = minimumValueForLength(marginStartLength, containerWidth); |
| 2239 |
marginEnd = minimumValueForLength(marginEndLength, containerWidth, renderView); |
2233 |
marginEnd = minimumValueForLength(marginEndLength, containerWidth); |
| 2240 |
} |
2234 |
} |
| 2241 |
|
2235 |
|
| 2242 |
RenderBoxRegionInfo* RenderBox::renderBoxRegionInfo(RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, RenderBoxRegionInfoFlags cacheFlag) const |
2236 |
RenderBoxRegionInfo* RenderBox::renderBoxRegionInfo(RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, RenderBoxRegionInfoFlags cacheFlag) const |
|
Lines 2479-2485
LayoutUnit RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heig
a/Source/WebCore/rendering/RenderBox.cpp_sec14
|
| 2479 |
if (height.isPercent()) |
2473 |
if (height.isPercent()) |
| 2480 |
return computePercentageLogicalHeight(height); |
2474 |
return computePercentageLogicalHeight(height); |
| 2481 |
if (height.isViewportPercentage()) |
2475 |
if (height.isViewportPercentage()) |
| 2482 |
return valueForLength(height, 0, view()); |
2476 |
return valueForLength(height, 0); |
| 2483 |
return -1; |
2477 |
return -1; |
| 2484 |
} |
2478 |
} |
| 2485 |
|
2479 |
|
|
Lines 2615-2621
LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType sizeType, Length
a/Source/WebCore/rendering/RenderBox.cpp_sec15
|
| 2615 |
case ViewportPercentageHeight: |
2609 |
case ViewportPercentageHeight: |
| 2616 |
case ViewportPercentageMin: |
2610 |
case ViewportPercentageMin: |
| 2617 |
case ViewportPercentageMax: |
2611 |
case ViewportPercentageMax: |
| 2618 |
return adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, 0, view())); |
2612 |
return adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, 0)); |
| 2619 |
case FitContent: |
2613 |
case FitContent: |
| 2620 |
case FillAvailable: |
2614 |
case FillAvailable: |
| 2621 |
case Percent: |
2615 |
case Percent: |
|
Lines 2716-2722
LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec16
|
| 2716 |
case ViewportPercentageHeight: |
2710 |
case ViewportPercentageHeight: |
| 2717 |
case ViewportPercentageMin: |
2711 |
case ViewportPercentageMin: |
| 2718 |
case ViewportPercentageMax: |
2712 |
case ViewportPercentageMax: |
| 2719 |
return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, 0, view())); |
2713 |
return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, 0)); |
| 2720 |
default: |
2714 |
default: |
| 2721 |
return intrinsicLogicalHeight(); |
2715 |
return intrinsicLogicalHeight(); |
| 2722 |
} |
2716 |
} |
|
Lines 2783-2792
void RenderBox::computeBlockDirectionMargins(const RenderBlock* containingBlock,
a/Source/WebCore/rendering/RenderBox.cpp_sec17
|
| 2783 |
// Margins are calculated with respect to the logical width of |
2777 |
// Margins are calculated with respect to the logical width of |
| 2784 |
// the containing block (8.3) |
2778 |
// the containing block (8.3) |
| 2785 |
LayoutUnit cw = containingBlockLogicalWidthForContent(); |
2779 |
LayoutUnit cw = containingBlockLogicalWidthForContent(); |
| 2786 |
RenderView* renderView = view(); |
|
|
| 2787 |
RenderStyle* containingBlockStyle = containingBlock->style(); |
2780 |
RenderStyle* containingBlockStyle = containingBlock->style(); |
| 2788 |
marginBefore = minimumValueForLength(style()->marginBeforeUsing(containingBlockStyle), cw, renderView); |
2781 |
marginBefore = minimumValueForLength(style()->marginBeforeUsing(containingBlockStyle), cw); |
| 2789 |
marginAfter = minimumValueForLength(style()->marginAfterUsing(containingBlockStyle), cw, renderView); |
2782 |
marginAfter = minimumValueForLength(style()->marginAfterUsing(containingBlockStyle), cw); |
| 2790 |
} |
2783 |
} |
| 2791 |
|
2784 |
|
| 2792 |
void RenderBox::computeAndSetBlockDirectionMargins(const RenderBlock* containingBlock) |
2785 |
void RenderBox::computeAndSetBlockDirectionMargins(const RenderBlock* containingBlock) |
|
Lines 3112-3118
void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec18
|
| 3112 |
bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto(); |
3105 |
bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto(); |
| 3113 |
bool logicalLeftIsAuto = logicalLeft.isAuto(); |
3106 |
bool logicalLeftIsAuto = logicalLeft.isAuto(); |
| 3114 |
bool logicalRightIsAuto = logicalRight.isAuto(); |
3107 |
bool logicalRightIsAuto = logicalRight.isAuto(); |
| 3115 |
RenderView* renderView = view(); |
|
|
| 3116 |
LayoutUnit& marginLogicalLeftValue = style()->isLeftToRightDirection() ? computedValues.m_margins.m_start : computedValues.m_margins.m_end; |
3108 |
LayoutUnit& marginLogicalLeftValue = style()->isLeftToRightDirection() ? computedValues.m_margins.m_start : computedValues.m_margins.m_end; |
| 3117 |
LayoutUnit& marginLogicalRightValue = style()->isLeftToRightDirection() ? computedValues.m_margins.m_end : computedValues.m_margins.m_start; |
3109 |
LayoutUnit& marginLogicalRightValue = style()->isLeftToRightDirection() ? computedValues.m_margins.m_end : computedValues.m_margins.m_start; |
| 3118 |
|
3110 |
|
|
Lines 3132-3141
void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec19
|
| 3132 |
// NOTE: It is not necessary to solve for 'right' in the over constrained |
3124 |
// NOTE: It is not necessary to solve for 'right' in the over constrained |
| 3133 |
// case because the value is not used for any further calculations. |
3125 |
// case because the value is not used for any further calculations. |
| 3134 |
|
3126 |
|
| 3135 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3127 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3136 |
computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth, renderView)); |
3128 |
computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth)); |
| 3137 |
|
3129 |
|
| 3138 |
const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue + computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth, renderView) + bordersPlusPadding); |
3130 |
const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue + computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth) + bordersPlusPadding); |
| 3139 |
|
3131 |
|
| 3140 |
// Margins are now the only unknown |
3132 |
// Margins are now the only unknown |
| 3141 |
if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) { |
3133 |
if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) { |
|
Lines 3156-3171
void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec20
|
| 3156 |
} |
3148 |
} |
| 3157 |
} else if (marginLogicalLeft.isAuto()) { |
3149 |
} else if (marginLogicalLeft.isAuto()) { |
| 3158 |
// Solve for left margin |
3150 |
// Solve for left margin |
| 3159 |
marginLogicalRightValue = valueForLength(marginLogicalRight, containerRelativeLogicalWidth, renderView); |
3151 |
marginLogicalRightValue = valueForLength(marginLogicalRight, containerRelativeLogicalWidth); |
| 3160 |
marginLogicalLeftValue = availableSpace - marginLogicalRightValue; |
3152 |
marginLogicalLeftValue = availableSpace - marginLogicalRightValue; |
| 3161 |
} else if (marginLogicalRight.isAuto()) { |
3153 |
} else if (marginLogicalRight.isAuto()) { |
| 3162 |
// Solve for right margin |
3154 |
// Solve for right margin |
| 3163 |
marginLogicalLeftValue = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth, renderView); |
3155 |
marginLogicalLeftValue = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); |
| 3164 |
marginLogicalRightValue = availableSpace - marginLogicalLeftValue; |
3156 |
marginLogicalRightValue = availableSpace - marginLogicalLeftValue; |
| 3165 |
} else { |
3157 |
} else { |
| 3166 |
// Over-constrained, solve for left if direction is RTL |
3158 |
// Over-constrained, solve for left if direction is RTL |
| 3167 |
marginLogicalLeftValue = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth, renderView); |
3159 |
marginLogicalLeftValue = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); |
| 3168 |
marginLogicalRightValue = valueForLength(marginLogicalRight, containerRelativeLogicalWidth, renderView); |
3160 |
marginLogicalRightValue = valueForLength(marginLogicalRight, containerRelativeLogicalWidth); |
| 3169 |
|
3161 |
|
| 3170 |
// Use the containing block's direction rather than the parent block's |
3162 |
// Use the containing block's direction rather than the parent block's |
| 3171 |
// per CSS 2.1 reference test abspos-non-replaced-width-margin-000. |
3163 |
// per CSS 2.1 reference test abspos-non-replaced-width-margin-000. |
|
Lines 3215-3222
void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec21
|
| 3215 |
// because the value is not used for any further calculations. |
3207 |
// because the value is not used for any further calculations. |
| 3216 |
|
3208 |
|
| 3217 |
// Calculate margins, 'auto' margins are ignored. |
3209 |
// Calculate margins, 'auto' margins are ignored. |
| 3218 |
marginLogicalLeftValue = minimumValueForLength(marginLogicalLeft, containerRelativeLogicalWidth, renderView); |
3210 |
marginLogicalLeftValue = minimumValueForLength(marginLogicalLeft, containerRelativeLogicalWidth); |
| 3219 |
marginLogicalRightValue = minimumValueForLength(marginLogicalRight, containerRelativeLogicalWidth, renderView); |
3211 |
marginLogicalRightValue = minimumValueForLength(marginLogicalRight, containerRelativeLogicalWidth); |
| 3220 |
|
3212 |
|
| 3221 |
const LayoutUnit availableSpace = containerLogicalWidth - (marginLogicalLeftValue + marginLogicalRightValue + bordersPlusPadding); |
3213 |
const LayoutUnit availableSpace = containerLogicalWidth - (marginLogicalLeftValue + marginLogicalRightValue + bordersPlusPadding); |
| 3222 |
|
3214 |
|
|
Lines 3224-3230
void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec22
|
| 3224 |
// Use rule/case that applies. |
3216 |
// Use rule/case that applies. |
| 3225 |
if (logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { |
3217 |
if (logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { |
| 3226 |
// RULE 1: (use shrink-to-fit for width, and solve of left) |
3218 |
// RULE 1: (use shrink-to-fit for width, and solve of left) |
| 3227 |
LayoutUnit logicalRightValue = valueForLength(logicalRight, containerLogicalWidth, renderView); |
3219 |
LayoutUnit logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); |
| 3228 |
|
3220 |
|
| 3229 |
// FIXME: would it be better to have shrink-to-fit in one step? |
3221 |
// FIXME: would it be better to have shrink-to-fit in one step? |
| 3230 |
LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; |
3222 |
LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; |
|
Lines 3234-3240
void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec23
|
| 3234 |
logicalLeftValue = availableSpace - (computedValues.m_extent + logicalRightValue); |
3226 |
logicalLeftValue = availableSpace - (computedValues.m_extent + logicalRightValue); |
| 3235 |
} else if (!logicalLeftIsAuto && logicalWidthIsAuto && logicalRightIsAuto) { |
3227 |
} else if (!logicalLeftIsAuto && logicalWidthIsAuto && logicalRightIsAuto) { |
| 3236 |
// RULE 3: (use shrink-to-fit for width, and no need solve of right) |
3228 |
// RULE 3: (use shrink-to-fit for width, and no need solve of right) |
| 3237 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3229 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3238 |
|
3230 |
|
| 3239 |
// FIXME: would it be better to have shrink-to-fit in one step? |
3231 |
// FIXME: would it be better to have shrink-to-fit in one step? |
| 3240 |
LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; |
3232 |
LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; |
|
Lines 3243-3258
void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt
a/Source/WebCore/rendering/RenderBox.cpp_sec24
|
| 3243 |
computedValues.m_extent = min(max(preferredMinWidth, availableWidth), preferredWidth); |
3235 |
computedValues.m_extent = min(max(preferredMinWidth, availableWidth), preferredWidth); |
| 3244 |
} else if (logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) { |
3236 |
} else if (logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) { |
| 3245 |
// RULE 4: (solve for left) |
3237 |
// RULE 4: (solve for left) |
| 3246 |
computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth, renderView)); |
3238 |
computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth)); |
| 3247 |
logicalLeftValue = availableSpace - (computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth, renderView)); |
3239 |
logicalLeftValue = availableSpace - (computedValues.m_extent + valueForLength(logicalRight, containerLogicalWidth)); |
| 3248 |
} else if (!logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { |
3240 |
} else if (!logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { |
| 3249 |
// RULE 5: (solve for width) |
3241 |
// RULE 5: (solve for width) |
| 3250 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3242 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3251 |
computedValues.m_extent = availableSpace - (logicalLeftValue + valueForLength(logicalRight, containerLogicalWidth, renderView)); |
3243 |
computedValues.m_extent = availableSpace - (logicalLeftValue + valueForLength(logicalRight, containerLogicalWidth)); |
| 3252 |
} else if (!logicalLeftIsAuto && !logicalWidthIsAuto && logicalRightIsAuto) { |
3244 |
} else if (!logicalLeftIsAuto && !logicalWidthIsAuto && logicalRightIsAuto) { |
| 3253 |
// RULE 6: (no need solve for right) |
3245 |
// RULE 6: (no need solve for right) |
| 3254 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3246 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3255 |
computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth, renderView)); |
3247 |
computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing(valueForLength(logicalWidth, containerLogicalWidth)); |
| 3256 |
} |
3248 |
} |
| 3257 |
} |
3249 |
} |
| 3258 |
|
3250 |
|
|
Lines 3445-3451
void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Len
a/Source/WebCore/rendering/RenderBox.cpp_sec25
|
| 3445 |
bool logicalHeightIsAuto = logicalHeightLength.isAuto(); |
3437 |
bool logicalHeightIsAuto = logicalHeightLength.isAuto(); |
| 3446 |
bool logicalTopIsAuto = logicalTop.isAuto(); |
3438 |
bool logicalTopIsAuto = logicalTop.isAuto(); |
| 3447 |
bool logicalBottomIsAuto = logicalBottom.isAuto(); |
3439 |
bool logicalBottomIsAuto = logicalBottom.isAuto(); |
| 3448 |
RenderView* renderView = view(); |
|
|
| 3449 |
|
3440 |
|
| 3450 |
// Height is never unsolved for tables. |
3441 |
// Height is never unsolved for tables. |
| 3451 |
if (isTable()) { |
3442 |
if (isTable()) { |
|
Lines 3465-3474
void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Len
a/Source/WebCore/rendering/RenderBox.cpp_sec26
|
| 3465 |
// NOTE: It is not necessary to solve for 'bottom' in the over constrained |
3456 |
// NOTE: It is not necessary to solve for 'bottom' in the over constrained |
| 3466 |
// case because the value is not used for any further calculations. |
3457 |
// case because the value is not used for any further calculations. |
| 3467 |
|
3458 |
|
| 3468 |
logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight, renderView)); |
3459 |
logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight)); |
| 3469 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3460 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3470 |
|
3461 |
|
| 3471 |
const LayoutUnit availableSpace = containerLogicalHeight - (logicalTopValue + logicalHeightValue + valueForLength(logicalBottom, containerLogicalHeight, renderView) + bordersPlusPadding); |
3462 |
const LayoutUnit availableSpace = containerLogicalHeight - (logicalTopValue + logicalHeightValue + valueForLength(logicalBottom, containerLogicalHeight) + bordersPlusPadding); |
| 3472 |
|
3463 |
|
| 3473 |
// Margins are now the only unknown |
3464 |
// Margins are now the only unknown |
| 3474 |
if (marginBefore.isAuto() && marginAfter.isAuto()) { |
3465 |
if (marginBefore.isAuto() && marginAfter.isAuto()) { |
|
Lines 3478-3493
void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Len
a/Source/WebCore/rendering/RenderBox.cpp_sec27
|
| 3478 |
computedValues.m_margins.m_after = availableSpace - computedValues.m_margins.m_before; // account for odd valued differences |
3469 |
computedValues.m_margins.m_after = availableSpace - computedValues.m_margins.m_before; // account for odd valued differences |
| 3479 |
} else if (marginBefore.isAuto()) { |
3470 |
} else if (marginBefore.isAuto()) { |
| 3480 |
// Solve for top margin |
3471 |
// Solve for top margin |
| 3481 |
computedValues.m_margins.m_after = valueForLength(marginAfter, containerRelativeLogicalWidth, renderView); |
3472 |
computedValues.m_margins.m_after = valueForLength(marginAfter, containerRelativeLogicalWidth); |
| 3482 |
computedValues.m_margins.m_before = availableSpace - computedValues.m_margins.m_after; |
3473 |
computedValues.m_margins.m_before = availableSpace - computedValues.m_margins.m_after; |
| 3483 |
} else if (marginAfter.isAuto()) { |
3474 |
} else if (marginAfter.isAuto()) { |
| 3484 |
// Solve for bottom margin |
3475 |
// Solve for bottom margin |
| 3485 |
computedValues.m_margins.m_before = valueForLength(marginBefore, containerRelativeLogicalWidth, renderView); |
3476 |
computedValues.m_margins.m_before = valueForLength(marginBefore, containerRelativeLogicalWidth); |
| 3486 |
computedValues.m_margins.m_after = availableSpace - computedValues.m_margins.m_before; |
3477 |
computedValues.m_margins.m_after = availableSpace - computedValues.m_margins.m_before; |
| 3487 |
} else { |
3478 |
} else { |
| 3488 |
// Over-constrained, (no need solve for bottom) |
3479 |
// Over-constrained, (no need solve for bottom) |
| 3489 |
computedValues.m_margins.m_before = valueForLength(marginBefore, containerRelativeLogicalWidth, renderView); |
3480 |
computedValues.m_margins.m_before = valueForLength(marginBefore, containerRelativeLogicalWidth); |
| 3490 |
computedValues.m_margins.m_after = valueForLength(marginAfter, containerRelativeLogicalWidth, renderView); |
3481 |
computedValues.m_margins.m_after = valueForLength(marginAfter, containerRelativeLogicalWidth); |
| 3491 |
} |
3482 |
} |
| 3492 |
} else { |
3483 |
} else { |
| 3493 |
/*--------------------------------------------------------------------*\ |
3484 |
/*--------------------------------------------------------------------*\ |
|
Lines 3516-3523
void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Len
a/Source/WebCore/rendering/RenderBox.cpp_sec28
|
| 3516 |
// because the value is not used for any further calculations. |
3507 |
// because the value is not used for any further calculations. |
| 3517 |
|
3508 |
|
| 3518 |
// Calculate margins, 'auto' margins are ignored. |
3509 |
// Calculate margins, 'auto' margins are ignored. |
| 3519 |
computedValues.m_margins.m_before = minimumValueForLength(marginBefore, containerRelativeLogicalWidth, renderView); |
3510 |
computedValues.m_margins.m_before = minimumValueForLength(marginBefore, containerRelativeLogicalWidth); |
| 3520 |
computedValues.m_margins.m_after = minimumValueForLength(marginAfter, containerRelativeLogicalWidth, renderView); |
3511 |
computedValues.m_margins.m_after = minimumValueForLength(marginAfter, containerRelativeLogicalWidth); |
| 3521 |
|
3512 |
|
| 3522 |
const LayoutUnit availableSpace = containerLogicalHeight - (computedValues.m_margins.m_before + computedValues.m_margins.m_after + bordersPlusPadding); |
3513 |
const LayoutUnit availableSpace = containerLogicalHeight - (computedValues.m_margins.m_before + computedValues.m_margins.m_after + bordersPlusPadding); |
| 3523 |
|
3514 |
|
|
Lines 3525-3547
void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Len
a/Source/WebCore/rendering/RenderBox.cpp_sec29
|
| 3525 |
if (logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) { |
3516 |
if (logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) { |
| 3526 |
// RULE 1: (height is content based, solve of top) |
3517 |
// RULE 1: (height is content based, solve of top) |
| 3527 |
logicalHeightValue = contentLogicalHeight; |
3518 |
logicalHeightValue = contentLogicalHeight; |
| 3528 |
logicalTopValue = availableSpace - (logicalHeightValue + valueForLength(logicalBottom, containerLogicalHeight, renderView)); |
3519 |
logicalTopValue = availableSpace - (logicalHeightValue + valueForLength(logicalBottom, containerLogicalHeight)); |
| 3529 |
} else if (!logicalTopIsAuto && logicalHeightIsAuto && logicalBottomIsAuto) { |
3520 |
} else if (!logicalTopIsAuto && logicalHeightIsAuto && logicalBottomIsAuto) { |
| 3530 |
// RULE 3: (height is content based, no need solve of bottom) |
3521 |
// RULE 3: (height is content based, no need solve of bottom) |
| 3531 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3522 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3532 |
logicalHeightValue = contentLogicalHeight; |
3523 |
logicalHeightValue = contentLogicalHeight; |
| 3533 |
} else if (logicalTopIsAuto && !logicalHeightIsAuto && !logicalBottomIsAuto) { |
3524 |
} else if (logicalTopIsAuto && !logicalHeightIsAuto && !logicalBottomIsAuto) { |
| 3534 |
// RULE 4: (solve of top) |
3525 |
// RULE 4: (solve of top) |
| 3535 |
logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight, renderView)); |
3526 |
logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight)); |
| 3536 |
logicalTopValue = availableSpace - (logicalHeightValue + valueForLength(logicalBottom, containerLogicalHeight, renderView)); |
3527 |
logicalTopValue = availableSpace - (logicalHeightValue + valueForLength(logicalBottom, containerLogicalHeight)); |
| 3537 |
} else if (!logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) { |
3528 |
} else if (!logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) { |
| 3538 |
// RULE 5: (solve of height) |
3529 |
// RULE 5: (solve of height) |
| 3539 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3530 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3540 |
logicalHeightValue = max<LayoutUnit>(0, availableSpace - (logicalTopValue + valueForLength(logicalBottom, containerLogicalHeight, renderView))); |
3531 |
logicalHeightValue = max<LayoutUnit>(0, availableSpace - (logicalTopValue + valueForLength(logicalBottom, containerLogicalHeight))); |
| 3541 |
} else if (!logicalTopIsAuto && !logicalHeightIsAuto && logicalBottomIsAuto) { |
3532 |
} else if (!logicalTopIsAuto && !logicalHeightIsAuto && logicalBottomIsAuto) { |
| 3542 |
// RULE 6: (no need solve of bottom) |
3533 |
// RULE 6: (no need solve of bottom) |
| 3543 |
logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight, renderView)); |
3534 |
logicalHeightValue = adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeightLength, containerLogicalHeight)); |
| 3544 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3535 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3545 |
} |
3536 |
} |
| 3546 |
} |
3537 |
} |
| 3547 |
computedValues.m_extent = logicalHeightValue; |
3538 |
computedValues.m_extent = logicalHeightValue; |
|
Lines 3619-3632
void RenderBox::computePositionedLogicalWidthReplaced(LogicalExtentComputedValue
a/Source/WebCore/rendering/RenderBox.cpp_sec30
|
| 3619 |
\*-----------------------------------------------------------------------*/ |
3610 |
\*-----------------------------------------------------------------------*/ |
| 3620 |
LayoutUnit logicalLeftValue = 0; |
3611 |
LayoutUnit logicalLeftValue = 0; |
| 3621 |
LayoutUnit logicalRightValue = 0; |
3612 |
LayoutUnit logicalRightValue = 0; |
| 3622 |
RenderView* renderView = view(); |
|
|
| 3623 |
|
3613 |
|
| 3624 |
if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) { |
3614 |
if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) { |
| 3625 |
// 'left' and 'right' cannot be 'auto' due to step 3 |
3615 |
// 'left' and 'right' cannot be 'auto' due to step 3 |
| 3626 |
ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto())); |
3616 |
ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto())); |
| 3627 |
|
3617 |
|
| 3628 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3618 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3629 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth, renderView); |
3619 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); |
| 3630 |
|
3620 |
|
| 3631 |
LayoutUnit difference = availableSpace - (logicalLeftValue + logicalRightValue); |
3621 |
LayoutUnit difference = availableSpace - (logicalLeftValue + logicalRightValue); |
| 3632 |
if (difference > 0) { |
3622 |
if (difference > 0) { |
|
Lines 3649-3687
void RenderBox::computePositionedLogicalWidthReplaced(LogicalExtentComputedValue
a/Source/WebCore/rendering/RenderBox.cpp_sec31
|
| 3649 |
* that value. |
3639 |
* that value. |
| 3650 |
\*-----------------------------------------------------------------------*/ |
3640 |
\*-----------------------------------------------------------------------*/ |
| 3651 |
} else if (logicalLeft.isAuto()) { |
3641 |
} else if (logicalLeft.isAuto()) { |
| 3652 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth, renderView); |
3642 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); |
| 3653 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth, renderView); |
3643 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth); |
| 3654 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth, renderView); |
3644 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); |
| 3655 |
|
3645 |
|
| 3656 |
// Solve for 'left' |
3646 |
// Solve for 'left' |
| 3657 |
logicalLeftValue = availableSpace - (logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias); |
3647 |
logicalLeftValue = availableSpace - (logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias); |
| 3658 |
} else if (logicalRight.isAuto()) { |
3648 |
} else if (logicalRight.isAuto()) { |
| 3659 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth, renderView); |
3649 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); |
| 3660 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth, renderView); |
3650 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth); |
| 3661 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3651 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3662 |
|
3652 |
|
| 3663 |
// Solve for 'right' |
3653 |
// Solve for 'right' |
| 3664 |
logicalRightValue = availableSpace - (logicalLeftValue + marginLogicalLeftAlias + marginLogicalRightAlias); |
3654 |
logicalRightValue = availableSpace - (logicalLeftValue + marginLogicalLeftAlias + marginLogicalRightAlias); |
| 3665 |
} else if (marginLogicalLeft.isAuto()) { |
3655 |
} else if (marginLogicalLeft.isAuto()) { |
| 3666 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth, renderView); |
3656 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth); |
| 3667 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3657 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3668 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth, renderView); |
3658 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); |
| 3669 |
|
3659 |
|
| 3670 |
// Solve for 'margin-left' |
3660 |
// Solve for 'margin-left' |
| 3671 |
marginLogicalLeftAlias = availableSpace - (logicalLeftValue + logicalRightValue + marginLogicalRightAlias); |
3661 |
marginLogicalLeftAlias = availableSpace - (logicalLeftValue + logicalRightValue + marginLogicalRightAlias); |
| 3672 |
} else if (marginLogicalRight.isAuto()) { |
3662 |
} else if (marginLogicalRight.isAuto()) { |
| 3673 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth, renderView); |
3663 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); |
| 3674 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3664 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3675 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth, renderView); |
3665 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); |
| 3676 |
|
3666 |
|
| 3677 |
// Solve for 'margin-right' |
3667 |
// Solve for 'margin-right' |
| 3678 |
marginLogicalRightAlias = availableSpace - (logicalLeftValue + logicalRightValue + marginLogicalLeftAlias); |
3668 |
marginLogicalRightAlias = availableSpace - (logicalLeftValue + logicalRightValue + marginLogicalLeftAlias); |
| 3679 |
} else { |
3669 |
} else { |
| 3680 |
// Nothing is 'auto', just calculate the values. |
3670 |
// Nothing is 'auto', just calculate the values. |
| 3681 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth, renderView); |
3671 |
marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); |
| 3682 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth, renderView); |
3672 |
marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRelativeLogicalWidth); |
| 3683 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth, renderView); |
3673 |
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); |
| 3684 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth, renderView); |
3674 |
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); |
| 3685 |
// If the containing block is right-to-left, then push the left position as far to the right as possible |
3675 |
// If the containing block is right-to-left, then push the left position as far to the right as possible |
| 3686 |
if (containerDirection == RTL) { |
3676 |
if (containerDirection == RTL) { |
| 3687 |
int totalLogicalWidth = computedValues.m_extent + logicalLeftValue + logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias; |
3677 |
int totalLogicalWidth = computedValues.m_extent + logicalLeftValue + logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias; |
|
Lines 3743-3749
void RenderBox::computePositionedLogicalHeightReplaced(LogicalExtentComputedValu
a/Source/WebCore/rendering/RenderBox.cpp_sec32
|
| 3743 |
|
3733 |
|
| 3744 |
Length logicalTop = style()->logicalTop(); |
3734 |
Length logicalTop = style()->logicalTop(); |
| 3745 |
Length logicalBottom = style()->logicalBottom(); |
3735 |
Length logicalBottom = style()->logicalBottom(); |
| 3746 |
RenderView* renderView = view(); |
|
|
| 3747 |
|
3736 |
|
| 3748 |
/*-----------------------------------------------------------------------*\ |
3737 |
/*-----------------------------------------------------------------------*\ |
| 3749 |
* 1. The used value of 'height' is determined as for inline replaced |
3738 |
* 1. The used value of 'height' is determined as for inline replaced |
|
Lines 3787-3794
void RenderBox::computePositionedLogicalHeightReplaced(LogicalExtentComputedValu
a/Source/WebCore/rendering/RenderBox.cpp_sec33
|
| 3787 |
// 'top' and 'bottom' cannot be 'auto' due to step 2 and 3 combined. |
3776 |
// 'top' and 'bottom' cannot be 'auto' due to step 2 and 3 combined. |
| 3788 |
ASSERT(!(logicalTop.isAuto() || logicalBottom.isAuto())); |
3777 |
ASSERT(!(logicalTop.isAuto() || logicalBottom.isAuto())); |
| 3789 |
|
3778 |
|
| 3790 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3779 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3791 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight, renderView); |
3780 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); |
| 3792 |
|
3781 |
|
| 3793 |
LayoutUnit difference = availableSpace - (logicalTopValue + logicalBottomValue); |
3782 |
LayoutUnit difference = availableSpace - (logicalTopValue + logicalBottomValue); |
| 3794 |
// NOTE: This may result in negative values. |
3783 |
// NOTE: This may result in negative values. |
|
Lines 3800-3838
void RenderBox::computePositionedLogicalHeightReplaced(LogicalExtentComputedValu
a/Source/WebCore/rendering/RenderBox.cpp_sec34
|
| 3800 |
* for that value. |
3789 |
* for that value. |
| 3801 |
\*-----------------------------------------------------------------------*/ |
3790 |
\*-----------------------------------------------------------------------*/ |
| 3802 |
} else if (logicalTop.isAuto()) { |
3791 |
} else if (logicalTop.isAuto()) { |
| 3803 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth, renderView); |
3792 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth); |
| 3804 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth, renderView); |
3793 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth); |
| 3805 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight, renderView); |
3794 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); |
| 3806 |
|
3795 |
|
| 3807 |
// Solve for 'top' |
3796 |
// Solve for 'top' |
| 3808 |
logicalTopValue = availableSpace - (logicalBottomValue + marginBeforeAlias + marginAfterAlias); |
3797 |
logicalTopValue = availableSpace - (logicalBottomValue + marginBeforeAlias + marginAfterAlias); |
| 3809 |
} else if (logicalBottom.isAuto()) { |
3798 |
} else if (logicalBottom.isAuto()) { |
| 3810 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth, renderView); |
3799 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth); |
| 3811 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth, renderView); |
3800 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth); |
| 3812 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3801 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3813 |
|
3802 |
|
| 3814 |
// Solve for 'bottom' |
3803 |
// Solve for 'bottom' |
| 3815 |
// NOTE: It is not necessary to solve for 'bottom' because we don't ever |
3804 |
// NOTE: It is not necessary to solve for 'bottom' because we don't ever |
| 3816 |
// use the value. |
3805 |
// use the value. |
| 3817 |
} else if (marginBefore.isAuto()) { |
3806 |
} else if (marginBefore.isAuto()) { |
| 3818 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth, renderView); |
3807 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth); |
| 3819 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3808 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3820 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight, renderView); |
3809 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); |
| 3821 |
|
3810 |
|
| 3822 |
// Solve for 'margin-top' |
3811 |
// Solve for 'margin-top' |
| 3823 |
marginBeforeAlias = availableSpace - (logicalTopValue + logicalBottomValue + marginAfterAlias); |
3812 |
marginBeforeAlias = availableSpace - (logicalTopValue + logicalBottomValue + marginAfterAlias); |
| 3824 |
} else if (marginAfter.isAuto()) { |
3813 |
} else if (marginAfter.isAuto()) { |
| 3825 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth, renderView); |
3814 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth); |
| 3826 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3815 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3827 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight, renderView); |
3816 |
logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); |
| 3828 |
|
3817 |
|
| 3829 |
// Solve for 'margin-bottom' |
3818 |
// Solve for 'margin-bottom' |
| 3830 |
marginAfterAlias = availableSpace - (logicalTopValue + logicalBottomValue + marginBeforeAlias); |
3819 |
marginAfterAlias = availableSpace - (logicalTopValue + logicalBottomValue + marginBeforeAlias); |
| 3831 |
} else { |
3820 |
} else { |
| 3832 |
// Nothing is 'auto', just calculate the values. |
3821 |
// Nothing is 'auto', just calculate the values. |
| 3833 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth, renderView); |
3822 |
marginBeforeAlias = valueForLength(marginBefore, containerRelativeLogicalWidth); |
| 3834 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth, renderView); |
3823 |
marginAfterAlias = valueForLength(marginAfter, containerRelativeLogicalWidth); |
| 3835 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView); |
3824 |
logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); |
| 3836 |
// NOTE: It is not necessary to solve for 'bottom' because we don't ever |
3825 |
// NOTE: It is not necessary to solve for 'bottom' because we don't ever |
| 3837 |
// use the value. |
3826 |
// use the value. |
| 3838 |
} |
3827 |
} |