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

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

Issue 1376573004: Split out Color from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_property
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/ColorInterpolationType.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 917785d4260092ee0c7085d49c8d7f626c05b24a..7bbdbd156fd0fed4bdb8b19c9f6b6d2e516bae22 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -515,17 +515,14 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
if (value->isURIValue()) {
paintType = SVG_PAINTTYPE_URI;
url = toCSSURIValue(value)->value();
+ } else if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone) {
+ paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
+ } else if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueCurrentcolor) {
alancutter (OOO until 2018) 2015/10/07 06:34:25 The old code wasn't checking isPrimitiveValue() so
sashab 2015/10/12 23:04:50 Unfortunately I have to write it this way, otherwi
+ color = state.style()->color();
+ paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
} else {
- 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;
- }
+ color = StyleBuilderConverter::convertColor(state, value);
+ 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/ColorInterpolationType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698