| Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
|
| index 2d066f050ef336ac5ad7a4cf1a1295273526d5ba..0fe51e79effa1d637a11bbcd2760b197cb644f8c 100644
|
| --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
|
| @@ -207,17 +207,24 @@ static CSSValue* valueForPositionOffset(const ComputedStyle& style, CSSPropertyI
|
| if (opposite.isAuto())
|
| return CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pixels);
|
|
|
| - if (opposite.hasPercent()) {
|
| - LayoutUnit containingBlockSize =
|
| - (propertyID == CSSPropertyLeft || propertyID == CSSPropertyRight) ?
|
| - toLayoutBox(layoutObject)->containingBlockLogicalWidthForContent() :
|
| - toLayoutBox(layoutObject)->containingBlockLogicalHeightForGetComputedStyle();
|
| - return zoomAdjustedPixelValue(-floatValueForLength(opposite, containingBlockSize), style);
|
| + if (opposite.hasPercent() || opposite.isCalculated()) {
|
| + if (layoutObject->isBox()) {
|
| + LayoutUnit containingBlockSize =
|
| + (propertyID == CSSPropertyLeft || propertyID == CSSPropertyRight) ?
|
| + toLayoutBox(layoutObject)->containingBlockLogicalWidthForContent() :
|
| + toLayoutBox(layoutObject)->containingBlockLogicalHeightForGetComputedStyle();
|
| + return zoomAdjustedPixelValue(-floatValueForLength(opposite, containingBlockSize), style);
|
| + }
|
| + // FIXME: fall back to auto for position:relative, display:inline
|
| + return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
|
| }
|
| - return zoomAdjustedPixelValue(-opposite.pixels(), style);
|
| +
|
| + // Length doesn't provide operator -, so multiply by -1.
|
| + opposite *= -1.f;
|
| + return zoomAdjustedPixelValueForLength(opposite, style);
|
| }
|
|
|
| - if (layoutObject->isOutOfFlowPositioned()) {
|
| + if (layoutObject->isOutOfFlowPositioned() && layoutObject->isBox()) {
|
| // For fixed and absolute positioned elements, the top, left, bottom, and right
|
| // are defined relative to the corresponding sides of the containing block.
|
| LayoutBlock* container = layoutObject->containingBlock();
|
|
|