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

Unified Diff: third_party/WebKit/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: Rebase Created 5 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/DeferredLegacyStyleInterpolation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index 024f30d4fd304a6c3a673f6d37e6024a0b2dff05..917785d4260092ee0c7085d49c8d7f626c05b24a 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -12,7 +12,9 @@
#include "CSSValueKeywords.h"
#include "core/css/BasicShapeFunctions.h"
#include "core/css/CSSContentDistributionValue.h"
+#include "core/css/CSSCustomIdentValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
+#include "core/css/CSSURIValue.h"
#include "core/css/CSSValuePair.h"
#include "core/css/resolver/StyleResolverState.h"
@@ -347,7 +349,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 +506,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 | third_party/WebKit/Source/core/animation/DeferredLegacyStyleInterpolation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698