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

Unified Diff: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 1306823004: Split out String, URI and CustomIdent from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_attr_values
Patch Set: Fixing tests Created 5 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: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index a45c65b2685e32602ef8224cabe672edfa5d5ba1..9c221e81b11e61aeb356a20d4c4cce4f9c1ff0b7 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -13,6 +13,7 @@
#include "core/css/BasicShapeFunctions.h"
#include "core/css/CSSContentDistributionValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
+#include "core/css/CSSStringValueBase.h"
#include "core/css/CSSValuePair.h"
#include "core/css/resolver/StyleResolverState.h"
@@ -347,7 +348,7 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
int length = list ? list->length() : 0;
for (int i = 0; i < length; ++i) {
const CSSValuePair* pair = toCSSValuePair(list->item(i));
- AtomicString identifier(toCSSPrimitiveValue(pair->first()).getStringValue());
+ AtomicString identifier(toCSSCustomIdentValue(pair->first()).value());
int value = toCSSPrimitiveValue(pair->second()).getIntValue();
CounterDirectives& directives = map.add(identifier, CounterDirectives()).storedValue->value;
{% if action == 'Reset' %}
@@ -504,24 +505,26 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
if (value->isValueList()) {
CSSValueList* list = toCSSValueList(value);
ASSERT(list->length() == 2);
- url = toCSSPrimitiveValue(list->item(0))->getStringValue();
+ url = toCSSURIValue(list->item(0))->value();
value = list->item(1);
}
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
Color color;
SVGPaintType paintType = SVG_PAINTTYPE_RGBCOLOR;
- if (primitiveValue->getValueID() == CSSValueNone) {
- paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
- } else if (primitiveValue->isURI()) {
+ if (value->isURIValue()) {
paintType = SVG_PAINTTYPE_URI;
- url = primitiveValue->getStringValue();
- } else if (primitiveValue->getValueID() == CSSValueCurrentcolor) {
- color = state.style()->color();
- paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
+ url = toCSSURIValue(value)->value();
} else {
- color = StyleBuilderConverter::convertColor(state, primitiveValue);
- paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+ if (primitiveValue->getValueID() == CSSValueNone) {
+ paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
+ } else if (primitiveValue->getValueID() == CSSValueCurrentcolor) {
+ color = state.style()->color();
+ paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
+ } else {
+ color = StyleBuilderConverter::convertColor(state, primitiveValue);
+ paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
+ }
}
{{set_value(property)}}(paintType, color, url,
state.applyPropertyToRegularStyle(),
« no previous file with comments | « no previous file | Source/core/animation/DeferredLegacyStyleInterpolation.cpp » ('j') | Source/core/css/CSSStringValueBase.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698