Title: [154628] trunk
Revision
154628
Author
rwlb...@webkit.org
Date
2013-08-26 12:03:46 -0700 (Mon, 26 Aug 2013)

Log Message

Computed style of fill/stroke properties incorrect on references
https://bugs.webkit.org/show_bug.cgi?id=114761

Reviewed by Darin Adler.

Source/WebCore:

The computed style of the fill and stroke properties did not include
the url() function. Added the url() string to output.

Updated existing tests to cover the issue.

* css/CSSPrimitiveValue.cpp: Cleanup.
(WebCore::CSSPrimitiveValue::customCssText):
* svg/SVGPaint.cpp: Added "url("
(WebCore::SVGPaint::customCssText):

LayoutTests:

Add tests to verify that url function is included for references.

* svg/css/script-tests/svg-attribute-parser-mode.js:
* svg/css/svg-attribute-parser-mode-expected.txt:
* transitions/svg-transitions-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (154627 => 154628)


--- trunk/LayoutTests/ChangeLog	2013-08-26 19:01:23 UTC (rev 154627)
+++ trunk/LayoutTests/ChangeLog	2013-08-26 19:03:46 UTC (rev 154628)
@@ -1,3 +1,16 @@
+2013-08-26  Rob Buis  <rwlb...@webkit.org>
+
+        Computed style of fill/stroke properties incorrect on references
+        https://bugs.webkit.org/show_bug.cgi?id=114761
+
+        Reviewed by Darin Adler.
+
+        Add tests to verify that url function is included for references.
+
+        * svg/css/script-tests/svg-attribute-parser-mode.js:
+        * svg/css/svg-attribute-parser-mode-expected.txt:
+        * transitions/svg-transitions-expected.txt:
+
 2013-08-26  Robert Hogan  <rob...@webkit.org>
 
         Avoid painting every non-edge collapsed border twice over

Modified: trunk/LayoutTests/svg/css/script-tests/svg-attribute-parser-mode.js (154627 => 154628)


--- trunk/LayoutTests/svg/css/script-tests/svg-attribute-parser-mode.js	2013-08-26 19:01:23 UTC (rev 154627)
+++ trunk/LayoutTests/svg/css/script-tests/svg-attribute-parser-mode.js	2013-08-26 19:03:46 UTC (rev 154628)
@@ -50,8 +50,19 @@
 rect.setAttribute("fill", "green");
 shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).fill", "#008000");
 
+rect.setAttribute("fill", "url(#reference)");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).fill", "url(#reference)");
+// Reset to green.
+rect.setAttribute("fill", "green");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).fill", "#008000");
 
+rect.setAttribute("fill", "url(#reference) green");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).fill", "url(#reference) #008000");
+// Reset to green.
+rect.setAttribute("fill", "green");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).fill", "#008000");
 
+
 // Testing 'stroke'
 // The default stroke value should be 'none'.
 shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).stroke", "none");
@@ -91,7 +102,19 @@
 rect.setAttribute("stroke", "green");
 shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).stroke", "#008000");
 
+rect.setAttribute("stroke", "url(#reference)");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).stroke", "url(#reference)");
+// Reset to green.
+rect.setAttribute("stroke", "green");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).stroke", "#008000");
 
+rect.setAttribute("stroke", "url(#reference) green");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).stroke", "url(#reference) #008000");
+// Reset to green.
+rect.setAttribute("stroke", "green");
+shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).stroke", "#008000");
+
+
 // Testing 'color'
 // The default for color is rgb(0, 0, 0).
 shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).color", "rgb(0, 0, 0)");

Modified: trunk/LayoutTests/svg/css/svg-attribute-parser-mode-expected.txt (154627 => 154628)


--- trunk/LayoutTests/svg/css/svg-attribute-parser-mode-expected.txt	2013-08-26 19:01:23 UTC (rev 154627)
+++ trunk/LayoutTests/svg/css/svg-attribute-parser-mode-expected.txt	2013-08-26 19:03:46 UTC (rev 154628)
@@ -15,6 +15,10 @@
 PASS document.defaultView.getComputedStyle(rect, null).fill is "#008000"
 PASS document.defaultView.getComputedStyle(rect, null).fill is "#000000"
 PASS document.defaultView.getComputedStyle(rect, null).fill is "#008000"
+PASS document.defaultView.getComputedStyle(rect, null).fill is "url(#reference)"
+PASS document.defaultView.getComputedStyle(rect, null).fill is "#008000"
+PASS document.defaultView.getComputedStyle(rect, null).fill is "url(#reference) #008000"
+PASS document.defaultView.getComputedStyle(rect, null).fill is "#008000"
 PASS document.defaultView.getComputedStyle(rect, null).stroke is "none"
 PASS document.defaultView.getComputedStyle(rect, null).stroke is "#008000"
 PASS document.defaultView.getComputedStyle(rect, null).stroke is null
@@ -27,6 +31,10 @@
 PASS document.defaultView.getComputedStyle(rect, null).stroke is "#008000"
 PASS document.defaultView.getComputedStyle(rect, null).stroke is "none"
 PASS document.defaultView.getComputedStyle(rect, null).stroke is "#008000"
+PASS document.defaultView.getComputedStyle(rect, null).stroke is "url(#reference)"
+PASS document.defaultView.getComputedStyle(rect, null).stroke is "#008000"
+PASS document.defaultView.getComputedStyle(rect, null).stroke is "url(#reference) #008000"
+PASS document.defaultView.getComputedStyle(rect, null).stroke is "#008000"
 PASS document.defaultView.getComputedStyle(rect, null).color is "rgb(0, 0, 0)"
 PASS document.defaultView.getComputedStyle(rect, null).color is "rgb(0, 128, 0)"
 PASS document.defaultView.getComputedStyle(rect, null).color is "rgb(0, 0, 0)"

Modified: trunk/LayoutTests/transitions/svg-transitions-expected.txt (154627 => 154628)


--- trunk/LayoutTests/transitions/svg-transitions-expected.txt	2013-08-26 19:01:23 UTC (rev 154627)
+++ trunk/LayoutTests/transitions/svg-transitions-expected.txt	2013-08-26 19:03:46 UTC (rev 154628)
@@ -13,7 +13,7 @@
 PASS - "stroke-dasharray" property for "rect5" element at 1s saw something close to: 20
 PASS - "stroke-width" property for "rect6" element at 1s saw something close to: 15
 PASS - "stroke-dasharray" property for "rect6" element at 1s saw something close to: 15,15,20,12.5,17.5,17.5
-FAIL - "fill" property for "rect7" element at 1s expected: 0,0,127 but saw: #invalid #0000ff
+FAIL - "fill" property for "rect7" element at 1s expected: 0,0,127 but saw: url(#invalid) #0000ff
 PASS - "stroke-dasharray" property for "rect7" element at 1s saw something close to: none
 PASS - "stop-color" property for "stop1" element at 1s saw something close to: 127,127,0
 PASS - "stop-opacity" property for "stop1" element at 1s saw something close to: 0.75

Modified: trunk/Source/WebCore/ChangeLog (154627 => 154628)


--- trunk/Source/WebCore/ChangeLog	2013-08-26 19:01:23 UTC (rev 154627)
+++ trunk/Source/WebCore/ChangeLog	2013-08-26 19:03:46 UTC (rev 154628)
@@ -1,3 +1,20 @@
+2013-08-26  Rob Buis  <rwlb...@webkit.org>
+
+        Computed style of fill/stroke properties incorrect on references
+        https://bugs.webkit.org/show_bug.cgi?id=114761
+
+        Reviewed by Darin Adler.
+
+        The computed style of the fill and stroke properties did not include
+        the url() function. Added the url() string to output.
+
+        Updated existing tests to cover the issue.
+
+        * css/CSSPrimitiveValue.cpp: Cleanup.
+        (WebCore::CSSPrimitiveValue::customCssText):
+        * svg/SVGPaint.cpp: Added "url("
+        (WebCore::SVGPaint::customCssText):
+
 2013-08-26  Zan Dobersek  <zdober...@igalia.com>
 
         Prettify generated build guards in HTMLElementFactory.cpp

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (154627 => 154628)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2013-08-26 19:01:23 UTC (rev 154627)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2013-08-26 19:03:46 UTC (rev 154628)
@@ -1000,7 +1000,7 @@
             text = quoteCSSStringIfNeeded(m_value.string);
             break;
         case CSS_URI:
-            text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")";
+            text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ')';
             break;
         case CSS_VALUE_ID:
             text = valueName(m_value.valueID);

Modified: trunk/Source/WebCore/svg/SVGPaint.cpp (154627 => 154628)


--- trunk/Source/WebCore/svg/SVGPaint.cpp	2013-08-26 19:01:23 UTC (rev 154627)
+++ trunk/Source/WebCore/svg/SVGPaint.cpp	2013-08-26 19:03:46 UTC (rev 154628)
@@ -89,10 +89,10 @@
         String color = SVGColor::customCssText();
         if (color.isEmpty())
             return m_uri;
-        return m_uri + ' ' + color;
+        return "url(" + m_uri + ") " + color;
     }
     case SVG_PAINTTYPE_URI:
-        return m_uri;
+        return "url(" + m_uri + ')';
     };
 
     ASSERT_NOT_REACHED();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to