| Index: third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp b/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp
|
| index a1c7989088026f29210d1cadb9987342a244dd6a..a6c040d3a8a757e13207eb2593120bd5163c6f6f 100644
|
| --- a/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp
|
| +++ b/third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp
|
| @@ -30,6 +30,7 @@
|
| #include "core/css/BasicShapeFunctions.h"
|
|
|
| #include "core/css/CSSBasicShapeValues.h"
|
| +#include "core/css/CSSIdentifierValue.h"
|
| #include "core/css/CSSPrimitiveValueMappings.h"
|
| #include "core/css/CSSValuePair.h"
|
| #include "core/css/resolver/StyleResolverState.h"
|
| @@ -41,33 +42,33 @@ namespace blink {
|
| static CSSValue* valueForCenterCoordinate(const ComputedStyle& style, const BasicShapeCenterCoordinate& center, EBoxOrient orientation)
|
| {
|
| if (center.getDirection() == BasicShapeCenterCoordinate::TopLeft)
|
| - return CSSPrimitiveValue::create(center.length(), style.effectiveZoom());
|
| + return CSSValue::create(center.length(), style.effectiveZoom());
|
|
|
| CSSValueID keyword = orientation == HORIZONTAL ? CSSValueRight : CSSValueBottom;
|
|
|
| return CSSValuePair::create(
|
| - CSSPrimitiveValue::createIdentifier(keyword),
|
| - CSSPrimitiveValue::create(center.length(), style.effectiveZoom()),
|
| + CSSIdentifierValue::createIdentifier(keyword),
|
| + CSSValue::create(center.length(), style.effectiveZoom()),
|
| CSSValuePair::DropIdenticalValues);
|
| }
|
|
|
| static CSSValuePair* valueForLengthSize(const LengthSize& lengthSize, const ComputedStyle& style)
|
| {
|
| return CSSValuePair::create(
|
| - CSSPrimitiveValue::create(lengthSize.width(), style.effectiveZoom()),
|
| - CSSPrimitiveValue::create(lengthSize.height(), style.effectiveZoom()),
|
| + CSSValue::create(lengthSize.width(), style.effectiveZoom()),
|
| + CSSValue::create(lengthSize.height(), style.effectiveZoom()),
|
| CSSValuePair::KeepIdenticalValues);
|
| }
|
|
|
| -static CSSPrimitiveValue* basicShapeRadiusToCSSValue(const ComputedStyle& style, const BasicShapeRadius& radius)
|
| +static CSSValue* basicShapeRadiusToCSSValue(const ComputedStyle& style, const BasicShapeRadius& radius)
|
| {
|
| switch (radius.type()) {
|
| case BasicShapeRadius::Value:
|
| - return CSSPrimitiveValue::create(radius.value(), style.effectiveZoom());
|
| + return CSSValue::create(radius.value(), style.effectiveZoom());
|
| case BasicShapeRadius::ClosestSide:
|
| - return CSSPrimitiveValue::createIdentifier(CSSValueClosestSide);
|
| + return CSSIdentifierValue::createIdentifier(CSSValueClosestSide);
|
| case BasicShapeRadius::FarthestSide:
|
| - return CSSPrimitiveValue::createIdentifier(CSSValueFarthestSide);
|
| + return CSSIdentifierValue::createIdentifier(CSSValueFarthestSide);
|
| }
|
|
|
| ASSERT_NOT_REACHED();
|
| @@ -153,10 +154,10 @@ static BasicShapeCenterCoordinate convertToCenterCoordinate(const StyleResolverS
|
| CSSValueID keyword = CSSValueTop;
|
| if (!value) {
|
| keyword = CSSValueCenter;
|
| - } else if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->isValueID()) {
|
| - keyword = toCSSPrimitiveValue(value)->getValueID();
|
| + } else if (value->isIdentifierValue()) {
|
| + keyword = toCSSIdentifierValue(value)->getValueID();
|
| } else if (value->isValuePair()) {
|
| - keyword = toCSSPrimitiveValue(toCSSValuePair(value)->first()).getValueID();
|
| + keyword = toCSSIdentifierValue(toCSSValuePair(value)->first()).getValueID();
|
| offset = convertToLength(state, &toCSSPrimitiveValue(toCSSValuePair(value)->second()));
|
| } else {
|
| offset = convertToLength(state, toCSSPrimitiveValue(value));
|
| @@ -184,13 +185,13 @@ static BasicShapeCenterCoordinate convertToCenterCoordinate(const StyleResolverS
|
| return BasicShapeCenterCoordinate(direction, offset);
|
| }
|
|
|
| -static BasicShapeRadius cssValueToBasicShapeRadius(const StyleResolverState& state, const CSSPrimitiveValue* radius)
|
| +static BasicShapeRadius cssValueToBasicShapeRadius(const StyleResolverState& state, const CSSValue* radius)
|
| {
|
| if (!radius)
|
| return BasicShapeRadius(BasicShapeRadius::ClosestSide);
|
|
|
| - if (radius->isValueID()) {
|
| - switch (radius->getValueID()) {
|
| + if (radius->isIdentifierValue()) {
|
| + switch (toCSSIdentifierValue(radius)->getValueID()) {
|
| case CSSValueClosestSide:
|
| return BasicShapeRadius(BasicShapeRadius::ClosestSide);
|
| case CSSValueFarthestSide:
|
| @@ -201,7 +202,7 @@ static BasicShapeRadius cssValueToBasicShapeRadius(const StyleResolverState& sta
|
| }
|
| }
|
|
|
| - return BasicShapeRadius(convertToLength(state, radius));
|
| + return BasicShapeRadius(convertToLength(state, toCSSPrimitiveValue(radius)));
|
| }
|
|
|
| PassRefPtr<BasicShape> basicShapeForValue(const StyleResolverState& state, const CSSValue& basicShapeValue)
|
|
|