Commit 50fbb5b1 authored by rwlbuis@webkit.org's avatar rwlbuis@webkit.org

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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154628 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cdc57e72
2013-08-26 Rob Buis <rwlbuis@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 <robert@webkit.org>
Avoid painting every non-edge collapsed border twice over
......@@ -50,6 +50,17 @@ shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).fill",
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'
......@@ -91,6 +102,18 @@ shouldBeEqualToString("document.defaultView.getComputedStyle(rect, null).stroke"
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).
......
......@@ -15,6 +15,10 @@ PASS document.defaultView.getComputedStyle(rect, null).fill is null
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 null
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)"
......
......@@ -13,7 +13,7 @@ PASS - "stroke-width" property for "rect5" element at 1s saw something close to:
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
......
2013-08-26 Rob Buis <rwlbuis@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 <zdobersek@igalia.com>
Prettify generated build guards in HTMLElementFactory.cpp
......@@ -1000,7 +1000,7 @@ String CSSPrimitiveValue::customCssText() const
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);
......
......@@ -89,10 +89,10 @@ String SVGPaint::customCssText() const
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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment