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

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

Issue 1219153003: Unify handling of <color> for SVG/non-SVG properties (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 6 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 | « LayoutTests/svg/dom/rgb-color-parser-expected.txt ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29c660e30ba771b0d339df77d4e8c0e124cbd314..9e8d9ad1d90e463d49061a0c9aee00a7e6c10d1f 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -520,32 +520,30 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
if (!list->item(0)->isPrimitiveValue())
return;
- CSSPrimitiveValue* pValue = toCSSPrimitiveValue(list->item(0));
- if (!pValue->isURI())
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(list->item(0));
+ if (!primitiveValue->isURI())
return;
- url = pValue->getStringValue();
+ url = primitiveValue->getStringValue();
value = list->item(1);
}
if (value->isPrimitiveValue()) {
- CSSPrimitiveValue* pValue = toCSSPrimitiveValue(value);
- Color c;
- SVGPaintType ptype = SVG_PAINTTYPE_RGBCOLOR;
- if (pValue->isRGBColor()) {
- c = pValue->getRGBA32Value();
- ptype = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
- } else if (pValue->getValueID() == CSSValueCurrentcolor) {
- c = state.style()->color();
- ptype = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
- } else if (pValue->getValueID() == CSSValueNone) {
- ptype = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
- } else if (pValue->isURI()) {
- ptype = SVG_PAINTTYPE_URI;
- url = pValue->getStringValue();
+ 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()) {
+ 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;
} else {
- return;
+ color = StyleBuilderConverter::convertColor(state, primitiveValue);
+ paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
}
- {{set_value(property)}}(ptype, c, url,
+ {{set_value(property)}}(paintType, color, url,
state.applyPropertyToRegularStyle(),
state.applyPropertyToVisitedLinkStyle());
}
« no previous file with comments | « LayoutTests/svg/dom/rgb-color-parser-expected.txt ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698