Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: third_party/WebKit/Source/core/css/BasicShapeFunctions.cpp

Issue 2382653006: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Make check-webkit-style happy Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4876bd5455de45a8cff4478a8770c2a79112ff07..6411ee0b725c4b6b7c62a50dd10d17614918ba68 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"
@@ -43,35 +44,34 @@ static CSSValue* valueForCenterCoordinate(
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::create(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::create(CSSValueClosestSide);
case BasicShapeRadius::FarthestSide:
- return CSSPrimitiveValue::createIdentifier(CSSValueFarthestSide);
+ return CSSIdentifierValue::create(CSSValueFarthestSide);
}
ASSERT_NOT_REACHED();
@@ -178,11 +178,10 @@ static BasicShapeCenterCoordinate convertToCenterCoordinate(
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 {
@@ -213,12 +212,12 @@ static BasicShapeCenterCoordinate convertToCenterCoordinate(
static BasicShapeRadius cssValueToBasicShapeRadius(
const StyleResolverState& state,
- const CSSPrimitiveValue* radius) {
+ 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:
@@ -229,7 +228,7 @@ static BasicShapeRadius cssValueToBasicShapeRadius(
}
}
- return BasicShapeRadius(convertToLength(state, radius));
+ return BasicShapeRadius(convertToLength(state, toCSSPrimitiveValue(radius)));
}
PassRefPtr<BasicShape> basicShapeForValue(const StyleResolverState& state,
« no previous file with comments | « third_party/WebKit/Source/core/css/BUILD.gn ('k') | third_party/WebKit/Source/core/css/CSSBasicShapeValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698