Title: [113546] trunk
- Revision
- 113546
- Author
- [email protected]
- Date
- 2012-04-07 07:31:52 -0700 (Sat, 07 Apr 2012)
Log Message
Remove dead code in SVGCSSParser
https://bugs.webkit.org/show_bug.cgi?id=83404
Reviewed by Nikolas Zimmermann.
Source/WebCore:
Remove code that was there to create a SVGColor representation for color, but was never reached. Since
SVGColor is deprecated now (also see bug 15012), this code has lost any potential. Should SVGColor come
back in SVG2 we can revisit this.
Add a test to confirm for SVG we follow the CSS3 handling of color="currentColor". This is something the
removed code never dealt with, but the existing code in CSSParser.cpp handles, make sure we stick to this
behaviour in the future using this test.
Test: svg/custom/currentColor-on-color.html
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
LayoutTests:
Test that we support color="currentColor" in SVG. This follows from the CSS3 spec, see
http://www.w3.org/TR/css3-color/#currentcolor. This matches FF behaviour.
* svg/custom/currentColor-on-color-expected.txt: Added.
* svg/custom/currentColor-on-color.html: Added.
* svg/custom/script-tests/currentColor-on-color.js: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (113545 => 113546)
--- trunk/LayoutTests/ChangeLog 2012-04-07 13:13:55 UTC (rev 113545)
+++ trunk/LayoutTests/ChangeLog 2012-04-07 14:31:52 UTC (rev 113546)
@@ -1,3 +1,17 @@
+2012-04-07 Rob Buis <[email protected]>
+
+ Remove dead code in SVGCSSParser
+ https://bugs.webkit.org/show_bug.cgi?id=83404
+
+ Reviewed by Nikolas Zimmermann.
+
+ Test that we support color="currentColor" in SVG. This follows from the CSS3 spec, see
+ http://www.w3.org/TR/css3-color/#currentcolor. This matches FF behaviour.
+
+ * svg/custom/currentColor-on-color-expected.txt: Added.
+ * svg/custom/currentColor-on-color.html: Added.
+ * svg/custom/script-tests/currentColor-on-color.js: Added.
+
2012-04-07 Csaba Osztrogonác <[email protected]>
[Qt] Unreviewed Easter gardening, skip new failing tests to paint the bots green.
Added: trunk/LayoutTests/svg/custom/currentColor-on-color-expected.txt (0 => 113546)
--- trunk/LayoutTests/svg/custom/currentColor-on-color-expected.txt (rev 0)
+++ trunk/LayoutTests/svg/custom/currentColor-on-color-expected.txt 2012-04-07 14:31:52 UTC (rev 113546)
@@ -0,0 +1,10 @@
+This test checks the currentColor value on the color property
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(rectElement).color is "rgb(0, 128, 0)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/svg/custom/currentColor-on-color.html (0 => 113546)
--- trunk/LayoutTests/svg/custom/currentColor-on-color.html (rev 0)
+++ trunk/LayoutTests/svg/custom/currentColor-on-color.html 2012-04-07 14:31:52 UTC (rev 113546)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/svg/custom/script-tests/currentColor-on-color.js (0 => 113546)
--- trunk/LayoutTests/svg/custom/script-tests/currentColor-on-color.js (rev 0)
+++ trunk/LayoutTests/svg/custom/script-tests/currentColor-on-color.js 2012-04-07 14:31:52 UTC (rev 113546)
@@ -0,0 +1,21 @@
+description("This test checks the currentColor value on the color property");
+
+// Setup a real SVG document, as we want to access CSS style information.
+var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+svgElement.setAttribute("width", "150");
+svgElement.setAttribute("height", "50");
+
+var gElement = document.createElementNS("http://www.w3.org/2000/svg", "g");
+gElement.setAttribute("style", "color: green");
+svgElement.appendChild(gElement);
+
+var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+rectElement.setAttribute("color", "currentColor");
+rectElement.setAttribute("fill", "currentColor");
+gElement.appendChild(rectElement);
+
+document.getElementById("description").appendChild(svgElement);
+
+shouldBeEqualToString("getComputedStyle(rectElement).color", "rgb(0, 128, 0)");
+
+successfullyParsed = true;
Modified: trunk/Source/WebCore/ChangeLog (113545 => 113546)
--- trunk/Source/WebCore/ChangeLog 2012-04-07 13:13:55 UTC (rev 113545)
+++ trunk/Source/WebCore/ChangeLog 2012-04-07 14:31:52 UTC (rev 113546)
@@ -1,3 +1,23 @@
+2012-04-07 Rob Buis <[email protected]>
+
+ Remove dead code in SVGCSSParser
+ https://bugs.webkit.org/show_bug.cgi?id=83404
+
+ Reviewed by Nikolas Zimmermann.
+
+ Remove code that was there to create a SVGColor representation for color, but was never reached. Since
+ SVGColor is deprecated now (also see bug 15012), this code has lost any potential. Should SVGColor come
+ back in SVG2 we can revisit this.
+
+ Add a test to confirm for SVG we follow the CSS3 handling of color="currentColor". This is something the
+ removed code never dealt with, but the existing code in CSSParser.cpp handles, make sure we stick to this
+ behaviour in the future using this test.
+
+ Test: svg/custom/currentColor-on-color.html
+
+ * css/SVGCSSParser.cpp:
+ (WebCore::CSSParser::parseSVGValue):
+
2012-04-07 Nikolas Zimmermann <[email protected]>
FrameData constructor zeroes all fields, causing ImageOrientation to be 0
Modified: trunk/Source/WebCore/css/SVGCSSParser.cpp (113545 => 113546)
--- trunk/Source/WebCore/css/SVGCSSParser.cpp 2012-04-07 13:13:55 UTC (rev 113545)
+++ trunk/Source/WebCore/css/SVGCSSParser.cpp 2012-04-07 14:31:52 UTC (rev 113546)
@@ -201,17 +201,6 @@
}
break;
- case CSSPropertyColor: // <color> | inherit
- if ((id >= CSSValueAqua && id <= CSSValueWindowtext) ||
- (id >= CSSValueAliceblue && id <= CSSValueYellowgreen))
- parsedValue = SVGColor::createFromString(value->string);
- else
- parsedValue = parseSVGColor();
-
- if (parsedValue)
- m_valueList->next();
- break;
-
case CSSPropertyStopColor: // TODO : icccolor
case CSSPropertyFloodColor:
case CSSPropertyLightingColor:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes