Unify handling of <color> for SVG/non-SVG properties

Stop resolving system colors and "basic" named colors at parse time, and
instead resolve them when resolving style.
Implementation-wise this means getting rid of
CSSPropertyParser::parseSVGColor in favor of parseColor, and similarly
get rid of convertSVGColor in favor of convertColor on the style
resolver side.

Changes behavior for "basic" color names and system colors (as well as
some proprietary/internal keywords). New behavior matches Gecko.

BUG=370830,505410

Review URL: https://codereview.chromium.org/1219153003

git-svn-id: svn://svn.chromium.org/blink/trunk@198199 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/LayoutTests/fast/css/parse-color-int-or-percent-crash.html b/third_party/WebKit/LayoutTests/fast/css/parse-color-int-or-percent-crash.html
index 9aae922..fc1dac1 100644
--- a/third_party/WebKit/LayoutTests/fast/css/parse-color-int-or-percent-crash.html
+++ b/third_party/WebKit/LayoutTests/fast/css/parse-color-int-or-percent-crash.html
@@ -9,7 +9,7 @@
 
             var colorString = "rgb(00000000000000000000";
             stopElement.style.setProperty("stop-color", colorString);
-            document.body.innerHTML = stopElement.style.stopColor == "rgb(0, 0, 255)" ? "PASS" : "FAIL";
+            document.body.innerHTML = stopElement.style.stopColor == "blue" ? "PASS" : "FAIL";
         </script>
     </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline-expected.txt b/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline-expected.txt
index c6c733f..2baa0a9 100644
--- a/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline-expected.txt
@@ -2,14 +2,14 @@
 
 >>>> Animation with start delay only
 <div class="animation-name" style="transform: translateX(229.22px); width: 444px;"></div>
-<svg class="animation-ui" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(222.22px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="451.44" style="stroke: rgb(0, 0, 0);"></line><path class="animation-keyframe" d="M 0 32 L 0.02 13.35 L 0.94 13.35 L 3.51 13.35 L 7.66 13.35 L 13.28 13.35 L 20.28 13.35 L 28.59 13.35 L 38.10 13.35 L 48.73 13.35 L 60.39 13.35 L 72.99 13.35 L 86.44 13.35 L 100.65 13.35 L 115.54 13.35 L 131.00 13.35 L 146.95 13.35 L 163.31 13.35 L 179.98 13.35 L 196.87 13.35 L 213.90 13.35 L 230.96 13.35 L 247.99 13.35 L 264.88 13.35 L 281.54 13.35 L 297.89 13.35 L 313.83 13.35 L 329.28 13.35 L 344.15 13.35 L 358.34 13.35 L 371.77 13.35 L 384.35 13.35 L 395.99 13.35 L 406.60 13.35 L 416.08 13.35 L 424.36 13.35 L 431.33 13.35 L 436.92 13.35 L 441.03 13.35 L 443.56 13.35 L 444.44 13.35 L 444.44 32 Z" style="transform: translateX(7px); fill: rgb(0, 0, 0);"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle><circle class="animation-endpoint" cx="451.44" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="229.22" style="stroke: rgb(0, 0, 0);"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="7.00" style="stroke: rgb(0, 0, 0); transform: translateX(666.67px);"></line></svg>
+<svg class="animation-ui" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(222.22px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="451.44" style="stroke: black;"></line><path class="animation-keyframe" d="M 0 32 L 0.02 13.35 L 0.94 13.35 L 3.51 13.35 L 7.66 13.35 L 13.28 13.35 L 20.28 13.35 L 28.59 13.35 L 38.10 13.35 L 48.73 13.35 L 60.39 13.35 L 72.99 13.35 L 86.44 13.35 L 100.65 13.35 L 115.54 13.35 L 131.00 13.35 L 146.95 13.35 L 163.31 13.35 L 179.98 13.35 L 196.87 13.35 L 213.90 13.35 L 230.96 13.35 L 247.99 13.35 L 264.88 13.35 L 281.54 13.35 L 297.89 13.35 L 313.83 13.35 L 329.28 13.35 L 344.15 13.35 L 358.34 13.35 L 371.77 13.35 L 384.35 13.35 L 395.99 13.35 L 406.60 13.35 L 416.08 13.35 L 424.36 13.35 L 431.33 13.35 L 436.92 13.35 L 441.03 13.35 L 443.56 13.35 L 444.44 13.35 L 444.44 32 Z" style="transform: translateX(7px); fill: black;"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: black; fill: black;"></circle><circle class="animation-endpoint" cx="451.44" cy="32" r="3.5" style="stroke: black; fill: black;"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="229.22" style="stroke: black;"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="7.00" style="stroke: black; transform: translateX(666.67px);"></line></svg>
 >>>> Animation with start and end delay
 <div class="animation-name" style="transform: translateX(10.28px); width: 600px;"></div>
-<svg class="animation-ui" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(3.28px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="663.81" style="stroke: rgb(0, 0, 0);"></line><path class="animation-keyframe" d="M 0 32 L 0.03 13.35 L 1.39 13.35 L 5.19 13.35 L 11.32 13.35 L 19.62 13.35 L 29.97 13.35 L 42.25 13.35 L 56.31 13.35 L 72.02 13.35 L 89.25 13.35 L 107.87 13.35 L 127.75 13.35 L 148.75 13.35 L 170.74 13.35 L 193.59 13.35 L 217.17 13.35 L 241.34 13.35 L 265.98 13.35 L 290.94 13.35 L 316.10 13.35 L 341.33 13.35 L 366.49 13.35 L 391.44 13.35 L 416.07 13.35 L 440.23 13.35 L 463.79 13.35 L 486.62 13.35 L 508.59 13.35 L 529.57 13.35 L 549.42 13.35 L 568.01 13.35 L 585.21 13.35 L 600.88 13.35 L 614.90 13.35 L 627.13 13.35 L 637.44 13.35 L 645.70 13.35 L 651.76 13.35 L 655.51 13.35 L 656.81 13.35 L 656.81 32 Z" style="transform: translateX(7px); fill: rgb(0, 0, 0);"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle><circle class="animation-endpoint" cx="663.81" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="10.28" style="stroke: rgb(0, 0, 0);"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="13.57" style="stroke: rgb(0, 0, 0); transform: translateX(660.1px);"></line></svg>
+<svg class="animation-ui" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(3.28px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="663.81" style="stroke: black;"></line><path class="animation-keyframe" d="M 0 32 L 0.03 13.35 L 1.39 13.35 L 5.19 13.35 L 11.32 13.35 L 19.62 13.35 L 29.97 13.35 L 42.25 13.35 L 56.31 13.35 L 72.02 13.35 L 89.25 13.35 L 107.87 13.35 L 127.75 13.35 L 148.75 13.35 L 170.74 13.35 L 193.59 13.35 L 217.17 13.35 L 241.34 13.35 L 265.98 13.35 L 290.94 13.35 L 316.10 13.35 L 341.33 13.35 L 366.49 13.35 L 391.44 13.35 L 416.07 13.35 L 440.23 13.35 L 463.79 13.35 L 486.62 13.35 L 508.59 13.35 L 529.57 13.35 L 549.42 13.35 L 568.01 13.35 L 585.21 13.35 L 600.88 13.35 L 614.90 13.35 L 627.13 13.35 L 637.44 13.35 L 645.70 13.35 L 651.76 13.35 L 655.51 13.35 L 656.81 13.35 L 656.81 32 Z" style="transform: translateX(7px); fill: black;"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: black; fill: black;"></circle><circle class="animation-endpoint" cx="663.81" cy="32" r="3.5" style="stroke: black; fill: black;"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="10.28" style="stroke: black;"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="13.57" style="stroke: black; transform: translateX(660.1px);"></line></svg>
 >>>> Animation canceled
 <div class="animation-name" style="transform: translateX(10.28px); width: 600px;"></div>
-<svg class="animation-ui animation-ui-canceled" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(3.28px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="663.81" style="stroke: rgb(0, 0, 0);"></line><path class="animation-keyframe" d="M 0 32 L 0.03 13.35 L 1.39 13.35 L 5.19 13.35 L 11.32 13.35 L 19.62 13.35 L 29.97 13.35 L 42.25 13.35 L 56.31 13.35 L 72.02 13.35 L 89.25 13.35 L 107.87 13.35 L 127.75 13.35 L 148.75 13.35 L 170.74 13.35 L 193.59 13.35 L 217.17 13.35 L 241.34 13.35 L 265.98 13.35 L 290.94 13.35 L 316.10 13.35 L 341.33 13.35 L 366.49 13.35 L 391.44 13.35 L 416.07 13.35 L 440.23 13.35 L 463.79 13.35 L 486.62 13.35 L 508.59 13.35 L 529.57 13.35 L 549.42 13.35 L 568.01 13.35 L 585.21 13.35 L 600.88 13.35 L 614.90 13.35 L 627.13 13.35 L 637.44 13.35 L 645.70 13.35 L 651.76 13.35 L 655.51 13.35 L 656.81 13.35 L 656.81 32 Z" style="transform: translateX(7px); fill: rgb(0, 0, 0);"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle><circle class="animation-endpoint" cx="663.81" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="10.28" style="stroke: rgb(0, 0, 0);"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="13.57" style="stroke: rgb(0, 0, 0); transform: translateX(660.1px);"></line></svg>
+<svg class="animation-ui animation-ui-canceled" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(3.28px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="663.81" style="stroke: black;"></line><path class="animation-keyframe" d="M 0 32 L 0.03 13.35 L 1.39 13.35 L 5.19 13.35 L 11.32 13.35 L 19.62 13.35 L 29.97 13.35 L 42.25 13.35 L 56.31 13.35 L 72.02 13.35 L 89.25 13.35 L 107.87 13.35 L 127.75 13.35 L 148.75 13.35 L 170.74 13.35 L 193.59 13.35 L 217.17 13.35 L 241.34 13.35 L 265.98 13.35 L 290.94 13.35 L 316.10 13.35 L 341.33 13.35 L 366.49 13.35 L 391.44 13.35 L 416.07 13.35 L 440.23 13.35 L 463.79 13.35 L 486.62 13.35 L 508.59 13.35 L 529.57 13.35 L 549.42 13.35 L 568.01 13.35 L 585.21 13.35 L 600.88 13.35 L 614.90 13.35 L 627.13 13.35 L 637.44 13.35 L 645.70 13.35 L 651.76 13.35 L 655.51 13.35 L 656.81 13.35 L 656.81 32 Z" style="transform: translateX(7px); fill: black;"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: black; fill: black;"></circle><circle class="animation-endpoint" cx="663.81" cy="32" r="3.5" style="stroke: black; fill: black;"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="10.28" style="stroke: black;"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="13.57" style="stroke: black; transform: translateX(660.1px);"></line></svg>
 >>>> Animation with step timing function
 <div class="animation-name" style="transform: translateX(7px); width: 666px;"></div>
-<svg class="animation-ui" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(0px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="673.67" style="stroke: rgb(0, 0, 0);"></line><path class="animation-keyframe" d="M 0 32 L 0.03 13.35 L 1.41 13.35 L 5.27 13.35 L 11.49 13.35 L 19.91 13.35 L 30.42 13.35 L 42.88 13.35 L 57.15 13.35 L 73.10 13.35 L 90.59 13.35 L 109.49 13.35 L 129.66 13.35 L 150.98 13.35 L 173.30 13.35 L 196.50 13.35 L 220.43 13.35 L 244.96 13.35 L 269.97 13.35 L 295.31 13.35 L 320.84 13.35 L 346.45 13.35 L 371.98 13.35 L 397.31 13.35 L 422.31 13.35 L 446.83 13.35 L 470.75 13.35 L 493.92 13.35 L 516.22 13.35 L 537.51 13.35 L 557.66 13.35 L 576.53 13.35 L 593.99 13.35 L 609.90 13.35 L 624.13 13.35 L 636.54 13.35 L 647.00 13.35 L 655.38 13.35 L 661.54 13.35 L 665.35 13.35 L 666.67 13.35 L 666.67 32 Z" style="transform: translateX(7px); fill: rgb(0, 0, 0);"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle><circle class="animation-endpoint" cx="673.67" cy="32" r="3.5" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0);"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="7.00" style="stroke: rgb(0, 0, 0);"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="7.00" style="stroke: rgb(0, 0, 0); transform: translateX(666.67px);"></line></svg>
+<svg class="animation-ui" height="80" width="680.67" style="margin-left: -7px; transform: translateX(0px);"><g style="transform: translateX(0px);"><g style="transform: translateX(0px);"><line class="animation-line" x1="7" y1="32" y2="32" x2="673.67" style="stroke: black;"></line><path class="animation-keyframe" d="M 0 32 L 0.03 13.35 L 1.41 13.35 L 5.27 13.35 L 11.49 13.35 L 19.91 13.35 L 30.42 13.35 L 42.88 13.35 L 57.15 13.35 L 73.10 13.35 L 90.59 13.35 L 109.49 13.35 L 129.66 13.35 L 150.98 13.35 L 173.30 13.35 L 196.50 13.35 L 220.43 13.35 L 244.96 13.35 L 269.97 13.35 L 295.31 13.35 L 320.84 13.35 L 346.45 13.35 L 371.98 13.35 L 397.31 13.35 L 422.31 13.35 L 446.83 13.35 L 470.75 13.35 L 493.92 13.35 L 516.22 13.35 L 537.51 13.35 L 557.66 13.35 L 576.53 13.35 L 593.99 13.35 L 609.90 13.35 L 624.13 13.35 L 636.54 13.35 L 647.00 13.35 L 655.38 13.35 L 661.54 13.35 L 665.35 13.35 L 666.67 13.35 L 666.67 32 Z" style="transform: translateX(7px); fill: black;"></path><circle class="animation-endpoint" cx="7.00" cy="32" r="3.5" style="stroke: black; fill: black;"></circle><circle class="animation-endpoint" cx="673.67" cy="32" r="3.5" style="stroke: black; fill: black;"></circle></g><g class="animation-tail-iterations"></g></g><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="7.00" style="stroke: black;"></line><line class="animation-delay-line" x1="7" y1="32" y2="32" x2="7.00" style="stroke: black; transform: translateX(666.67px);"></line></svg>
 
diff --git a/third_party/WebKit/LayoutTests/svg/dom/rgb-color-parser-expected.txt b/third_party/WebKit/LayoutTests/svg/dom/rgb-color-parser-expected.txt
index aa3a2f8..fa2b750 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/rgb-color-parser-expected.txt
+++ b/third_party/WebKit/LayoutTests/svg/dom/rgb-color-parser-expected.txt
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-Parsed as rgb(0, 0, 255): blue
+Parsed as blue: blue
 Parsed as rgb(0, 255, 0): rgb(0, 255, 0)
 Parsed as rgb(255, 255, 0): rgb(100%,100%,0%
 Failed to parse: rgba(100%,100%,0%
@@ -26,9 +26,9 @@
 Parsed as rgb(255, 255, 255): #ffffff
 Parsed as rgb(255, 255, 255): #FFF
 Parsed as rgb(255, 255, 255): #FFFFFF
-Parsed as rgb(0, 128, 0):  green
-Parsed as rgb(0, 128, 0): green 
-Parsed as rgb(0, 128, 0): green
+Parsed as green:  green
+Parsed as green: green 
+Parsed as green: green
 Failed to parse: rgb(.78-2e8e
 Failed to parse: rgb(% 
 Failed to parse: rgb(7
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 29c660e30..9e8d9ad 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -520,32 +520,30 @@
         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());
     }
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.in b/third_party/WebKit/Source/core/css/CSSProperties.in
index c3e618a..5384b91 100644
--- a/third_party/WebKit/Source/core/css/CSSProperties.in
+++ b/third_party/WebKit/Source/core/css/CSSProperties.in
@@ -179,7 +179,7 @@
 flex-shrink interpolable, type_name=float
 flex-wrap
 float type_name=EFloat, name_for_methods=Floating
-flood-color interpolable, svg, converter=convertSVGColor
+flood-color interpolable, svg, converter=convertColor
 flood-opacity interpolable, svg, converter=convertNumberOrPercentage
 glyph-orientation-horizontal inherited, svg, converter=convertGlyphOrientation
 glyph-orientation-vertical inherited, svg, custom_value
@@ -201,7 +201,7 @@
 justify-self runtime_flag=CSSGridLayout, initial=initialSelfAlignment, converter=convertSelfOrDefaultAlignmentData
 left interpolable, initial=initialOffset, converter=convertLengthOrAuto
 letter-spacing interpolable, inherited, initial=initialLetterWordSpacing, converter=convertSpacing
-lighting-color interpolable, svg, converter=convertSVGColor
+lighting-color interpolable, svg, converter=convertColor
 line-height interpolable, inherited, getter=specifiedLineHeight, converter=convertLineHeight
 list-style-image interpolable, inherited, custom_value
 list-style-position inherited
@@ -267,7 +267,7 @@
 shape-rendering inherited, svg
 size custom_all
 speak inherited
-stop-color interpolable, svg, converter=convertSVGColor
+stop-color interpolable, svg, converter=convertColor
 stop-opacity interpolable, svg, converter=convertNumberOrPercentage
 stroke interpolable, inherited, svg, setter=setStrokePaint, custom_all
 stroke-dasharray interpolable, inherited, svg, name_for_methods=StrokeDashArray, converter=convertStrokeDasharray
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index fe36ecb..8ae8434 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -2370,20 +2370,6 @@
     return parseGradientStopColor(value);
 }
 
-// Used to parse <color> for SVG properties.
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseSVGColor(const CSSParserValue* value)
-{
-    CSSValueID id = value->id;
-    if (id == CSSValueCurrentcolor)
-        return cssValuePool().createIdentifierValue(id);
-    if ((id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu)
-        return cssValuePool().createColorValue(LayoutTheme::theme().systemColor(id).rgb());
-    RGBA32 c = Color::transparent;
-    if (!parseColorFromValue(value, c))
-        return nullptr;
-    return cssValuePool().createColorValue(c);
-}
-
 bool CSSPropertyParser::parseFillImage(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value)
 {
     if (valueList->current()->id == CSSValueNone) {
@@ -7850,7 +7836,7 @@
                     if (m_valueList->current()->id == CSSValueNone)
                         parsedValue = cssValuePool().createIdentifierValue(m_valueList->current()->id);
                     else
-                        parsedValue = parseSVGColor(m_valueList->current());
+                        parsedValue = parseColor(m_valueList->current());
                     if (parsedValue) {
                         values->append(parsedValue);
                         parsedValue = values;
@@ -7859,7 +7845,7 @@
                 if (!parsedValue)
                     parsedValue = CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_URI);
             } else {
-                parsedValue = parseSVGColor(m_valueList->current());
+                parsedValue = parseColor(m_valueList->current());
             }
 
             if (parsedValue)
@@ -7870,7 +7856,7 @@
     case CSSPropertyStopColor: // TODO : icccolor
     case CSSPropertyFloodColor:
     case CSSPropertyLightingColor:
-        parsedValue = parseSVGColor(m_valueList->current());
+        parsedValue = parseColor(m_valueList->current());
         if (parsedValue)
             m_valueList->next();
 
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
index 0c9d917..3e3dd56 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
@@ -198,7 +198,6 @@
     PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseTapHighlightColor(const CSSParserValue*);
     PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseGradientStopColor(const CSSParserValue*);
     PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseDeprecatedGradientStopColor(const CSSParserValue*);
-    PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseSVGColor(const CSSParserValue*);
 
     PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseLineHeight();
     bool parseFontSize(bool important);
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
index 989880e2..c0e62fe 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -871,15 +871,6 @@
     return state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, Color(), forVisitedLink);
 }
 
-Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->isRGBColor())
-        return primitiveValue->getRGBA32Value();
-    ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor);
-    return state.style()->color();
-}
-
 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, CSSValue* value)
 {
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
index 65b204f..4664ee2 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
@@ -90,7 +90,6 @@
     template <CSSValueID IdForNone> static AtomicString convertString(StyleResolverState&, CSSValue*);
     static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&, CSSValue*);
     static StyleColor convertStyleColor(StyleResolverState&, CSSValue*, bool forVisitedLink = false);
-    static Color convertSVGColor(StyleResolverState&, CSSValue*);
     static float convertTextStrokeWidth(StyleResolverState&, CSSValue*);
     static TransformOrigin convertTransformOrigin(StyleResolverState&, CSSValue*);