| 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 d17561ad8751214aed2d19a20d6d1a16fe34bc93..42e6910abe394302e6d82ca1586472a2dd3b2d55 100644
|
| --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
|
| @@ -2037,6 +2037,19 @@ ComputedStyleCSSValueMapping::getVariables(const ComputedStyle& style) {
|
| return nullptr;
|
| }
|
|
|
| +static bool widthOrHeightPropertyAppliesToObject(const LayoutObject& object) {
|
| + // According to
|
| + // http://www.w3.org/TR/CSS2/visudet.html#the-width-property and
|
| + // http://www.w3.org/TR/CSS2/visudet.html#the-height-property, the "width" or
|
| + // "height" property does not apply to non-atomic inline elements.
|
| + if (!object.isAtomicInlineLevel() && object.isInline())
|
| + return false;
|
| +
|
| + // Non-root SVG should be treated as non-atomic inline no matter how we
|
| + // implement it internally (e.g. LayoutSVGBlock is based on LayoutBlockFlow).
|
| + return !object.isSVGChild();
|
| +}
|
| +
|
| const CSSValue* ComputedStyleCSSValueMapping::get(
|
| CSSPropertyID propertyID,
|
| const ComputedStyle& style,
|
| @@ -2532,10 +2545,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
|
|
|
| case CSSPropertyHeight:
|
| if (layoutObject) {
|
| - // According to
|
| - // http://www.w3.org/TR/CSS2/visudet.html#the-height-property, the
|
| - // "height" property does not apply for non-atomic inline elements.
|
| - if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline())
|
| + if (!widthOrHeightPropertyAppliesToObject(*layoutObject))
|
| return CSSIdentifierValue::create(CSSValueAuto);
|
| return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), style);
|
| }
|
| @@ -2893,10 +2903,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
|
| CSSPrimitiveValue::UnitType::Number);
|
| case CSSPropertyWidth:
|
| if (layoutObject) {
|
| - // According to
|
| - // http://www.w3.org/TR/CSS2/visudet.html#the-width-property,
|
| - // the "width" property does not apply for non-atomic inline elements.
|
| - if (!layoutObject->isAtomicInlineLevel() && layoutObject->isInline())
|
| + if (!widthOrHeightPropertyAppliesToObject(*layoutObject))
|
| return CSSIdentifierValue::create(CSSValueAuto);
|
| return zoomAdjustedPixelValue(sizingBox(layoutObject).width(), style);
|
| }
|
|
|