Skip to content

Commit

Permalink
2011-03-01 Nikolas Zimmermann <nzimmermann@rim.com>
Browse files Browse the repository at this point in the history
        Reviewed by Antti Koivisto.

        SVG 1.1 2nd Edition color-prop-05-t.svg exposes bug in 'currentColor' handling
        https://bugs.webkit.org/show_bug.cgi?id=54800

        Add new layout test from the SVG 1.1 2nd Edition test suite, covering currentColor handling.
        Add tests ensuring that mutating a previously shared SVGPaint object makes it unique, so that
        mutations take affect, but don't affect other renderers which shared the SVGPaint object before.

        * platform/mac/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.checksum: Added.
        * platform/mac/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.png: Added.
        * platform/mac/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.txt: Added.
        * platform/mac/svg/custom/SVGPaint-mutate-attribute-expected.checksum: Added.
        * platform/mac/svg/custom/SVGPaint-mutate-attribute-expected.png: Added.
        * platform/mac/svg/custom/SVGPaint-mutate-attribute-expected.txt: Added.
        * platform/mac/svg/custom/SVGPaint-mutate-inline-style-expected.checksum: Added.
        * platform/mac/svg/custom/SVGPaint-mutate-inline-style-expected.png: Added.
        * platform/mac/svg/custom/SVGPaint-mutate-inline-style-expected.txt: Added.
        * svg/W3C-SVG-1.1-SE/color-prop-05-t.svg: Added.
        * svg/animations/animate-color-fill-currentColor-expected.txt: Added.
        * svg/animations/animate-color-fill-currentColor.html: Added.
        * svg/animations/script-tests/animate-color-fill-currentColor.js: Added.
        * svg/custom/SVGPaint-mutate-attribute.svg: Added.
        * svg/custom/SVGPaint-mutate-inline-style.svg: Added.
        * svg/dom/SVGColor-expected.txt: SVGColor mutations now reflected in style/computed style.
        * svg/dom/SVGPaint-expected.txt: Same for SVGPaint.
2011-03-01  Nikolas Zimmermann  <nzimmermann@rim.com>

        Reviewed by Antti Koivisto.

        SVG 1.1 2nd Edition color-prop-05-t.svg exposes bug in 'currentColor' handling
        https://bugs.webkit.org/show_bug.cgi?id=54800

        Wrong handling of currentColor on inherit
        https://bugs.webkit.org/show_bug.cgi?id=38102

        Stop storing RefPtr<SVGPaint> objects in the SVGRenderStyle for fill/stroke. These are the last
        two objects that held references to CSSValues, they're all gone now, aligning better with RenderStyle.
        It's also dangerous, as a SVGPaint object can be shared by multiple SVGRenderStyles (MappedAttribute will
        once create a CSSStyleDeclaration for fill="red" and reuse it where possible), and it was easy to
        accidently mutate the object, affecting multiple styles. Instead store a Color, an URI and a paint
        type in SVGRenderStyle, enough to create a SVGPaint object, if needed (eg for computed styles).

        <g color="green"><rect fill="currentColor"/> already worked fine in trunk, but
        <g fill="currentColor" color="green"><rect color="red"/> procuded a red rectangle.

        In order to fix to bug we have to resolve all currentColor values for SVGPaint objects, in SVGCSSStyleSelector,
        as it's already done for SVGColor objects (stop-color, flood-color, etc.) instead of in RenderSVGResource::fill/strokePaintingResource,
        when trying to use the paint server. The correct "color" value that should be used from the RenderStyle, is directly
        available in CSSStyleSelector: in applyProperty m_style->color() gives the desired value. In CSSStyleSelector it's handled
        exactly this way for non-SVG currentColor properties. Also fix computed styles, which did not resolve currentColor for SVGPaint/SVGColor.

        A previous patch implemented the SVGPaint/SVGColor API. SVG demands these CSSValues to be mutable. Introduce
        CSSMutableValue, which extends CSSValue by a Node pointer, and let SVGPaint/SVGColor inherit from it.
        Mutating a SVGPaint/SVGColor object now takes immediate effect, which is reflected in the inline style / computed style.
        (Note that getPresentationAttribute() already takes care of removing the CSSValue from the mapped attribute cache, so that it's no longer shared.)

        Add several new tests covering the patch.

        Tests: svg/W3C-SVG-1.1-SE/color-prop-05-t.svg
               svg/animations/animate-color-fill-currentColor.html
               svg/custom/SVGPaint-mutate-attribute.svg
               svg/custom/SVGPaint-mutate-inline-style.svg

        * GNUMakefile.am: Add CSSMutableValue.h
        * WebCore.gypi: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * css/CSSMutableStyleDeclaration.cpp: Reset the Node pointer in all CSSMutableValues belonging to this style declaration.
        (WebCore::CSSMutableStyleDeclaration::~CSSMutableStyleDeclaration):
        * css/CSSMutableStyleDeclaration.h: Add destructor.
        * css/CSSMutableValue.h: Added.
        (WebCore::CSSMutableValue::CSSMutableValue):
        (WebCore::CSSMutableValue::~CSSMutableValue):
        (WebCore::CSSMutableValue::isMutableValue):
        (WebCore::CSSMutableValue::node):
        (WebCore::CSSMutableValue::setNode):
        (WebCore::CSSMutableValue::setNeedsStyleRecalc):
        * css/CSSStyleDeclaration.cpp:
        (WebCore::CSSStyleDeclaration::getPropertyCSSValue): Set the Node object of a CSSMutableValue to the Node, this style declaration belongs to.
        * css/CSSValue.h:
        (WebCore::CSSValue::isMutableValue): Return false, default.
        * css/SVGCSSComputedStyleDeclaration.cpp:
        (WebCore::CSSComputedStyleDeclaration::adjustSVGPaintForCurrentColor): Add helper function, resolving currentColor values for SVGPaint objects.
        (WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue): Use currentColorOrValidColor/adjustSVGPaintForCurrentColor to resolve SVGColor/SVGPaint values.
        * css/SVGCSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::applySVGProperty): Store fill/stroke uri, color, paint type seperated in SVGRenderStyle, don't store the full SVGPaint object anymore.
        * rendering/style/SVGRenderStyle.cpp:
        (WebCore::SVGRenderStyle::diff): Adapt to SVGPaint changes.
        * rendering/style/SVGRenderStyle.h: Ditto.
        (WebCore::SVGRenderStyle::initialFillOpacity):
        (WebCore::SVGRenderStyle::initialFillPaintType):
        (WebCore::SVGRenderStyle::initialFillPaintColor):
        (WebCore::SVGRenderStyle::initialFillPaintUri):
        (WebCore::SVGRenderStyle::initialStrokeOpacity):
        (WebCore::SVGRenderStyle::initialStrokePaintType):
        (WebCore::SVGRenderStyle::initialStrokePaintColor):
        (WebCore::SVGRenderStyle::initialStrokePaintUri):
        (WebCore::SVGRenderStyle::initialStrokeMiterLimit):
        (WebCore::SVGRenderStyle::initialStopOpacity):
        (WebCore::SVGRenderStyle::initialFloodOpacity):
        (WebCore::SVGRenderStyle::setFillPaint):
        (WebCore::SVGRenderStyle::setStrokePaint):
        (WebCore::SVGRenderStyle::fillPaintType):
        (WebCore::SVGRenderStyle::fillPaintColor):
        (WebCore::SVGRenderStyle::fillPaintUri):
        (WebCore::SVGRenderStyle::strokePaintType):
        (WebCore::SVGRenderStyle::strokePaintColor):
        (WebCore::SVGRenderStyle::strokePaintUri):
        (WebCore::SVGRenderStyle::hasStroke):
        (WebCore::SVGRenderStyle::hasFill):
        * rendering/style/SVGRenderStyleDefs.cpp: Ditto.
        (WebCore::StyleFillData::StyleFillData):
        (WebCore::StyleFillData::operator==):
        (WebCore::StyleStrokeData::StyleStrokeData):
        (WebCore::StyleStrokeData::operator==):
        * rendering/style/SVGRenderStyleDefs.h: Ditto.
        * rendering/svg/RenderSVGResource.cpp: Ditto.
        (WebCore::requestPaintingResource):
        * rendering/svg/RenderSVGResourceClipper.cpp: Ditto.
        (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
        * rendering/svg/SVGResources.cpp: Ditto.
        (WebCore::paintingResourceFromSVGPaint):
        (WebCore::SVGResources::buildCachedResources):
        * svg/SVGColor.cpp: Call setNeedsStyleRecalc() after mutating the object.
        (WebCore::SVGColor::setRGBColor):
        (WebCore::SVGColor::setRGBColorICCColor):
        (WebCore::SVGColor::setColor):
        * svg/SVGColor.h:
        * svg/SVGPaint.cpp: Ditto.
        (WebCore::SVGPaint::setUri):
        (WebCore::SVGPaint::setPaint):
        * svg/SVGPaint.h:


Canonical link: https://commits.webkit.org/69882@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Nikolas Zimmermann committed Mar 1, 2011
1 parent 97078b0 commit 503165c
Show file tree
Hide file tree
Showing 41 changed files with 668 additions and 122 deletions.
39 changes: 34 additions & 5 deletions LayoutTests/ChangeLog
@@ -1,3 +1,32 @@
2011-03-01 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Antti Koivisto.

SVG 1.1 2nd Edition color-prop-05-t.svg exposes bug in 'currentColor' handling
https://bugs.webkit.org/show_bug.cgi?id=54800

Add new layout test from the SVG 1.1 2nd Edition test suite, covering currentColor handling.
Add tests ensuring that mutating a previously shared SVGPaint object makes it unique, so that
mutations take affect, but don't affect other renderers which shared the SVGPaint object before.

* platform/mac/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.checksum: Added.
* platform/mac/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.png: Added.
* platform/mac/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.txt: Added.
* platform/mac/svg/custom/SVGPaint-mutate-attribute-expected.checksum: Added.
* platform/mac/svg/custom/SVGPaint-mutate-attribute-expected.png: Added.
* platform/mac/svg/custom/SVGPaint-mutate-attribute-expected.txt: Added.
* platform/mac/svg/custom/SVGPaint-mutate-inline-style-expected.checksum: Added.
* platform/mac/svg/custom/SVGPaint-mutate-inline-style-expected.png: Added.
* platform/mac/svg/custom/SVGPaint-mutate-inline-style-expected.txt: Added.
* svg/W3C-SVG-1.1-SE/color-prop-05-t.svg: Added.
* svg/animations/animate-color-fill-currentColor-expected.txt: Added.
* svg/animations/animate-color-fill-currentColor.html: Added.
* svg/animations/script-tests/animate-color-fill-currentColor.js: Added.
* svg/custom/SVGPaint-mutate-attribute.svg: Added.
* svg/custom/SVGPaint-mutate-inline-style.svg: Added.
* svg/dom/SVGColor-expected.txt: SVGColor mutations now reflected in style/computed style.
* svg/dom/SVGPaint-expected.txt: Same for SVGPaint.

2011-03-01 Pavel Feldman <pfeldman@chromium.org>

Not reviewed: fixing flaky snow XMLViewer test on snow leopard.
Expand Down Expand Up @@ -407,11 +436,11 @@

https://bugs.webkit.org/show_bug.cgi?id=55121

[chromium] Recently, French Academy changed the sorting
rules for French in such a way that accents are not weighted
from the end of a word any more. ICU 4.6 / CLDR 1.9
incorporated the change. Canadian French hasn't adopted the
change, yet.
[chromium] Recently, French Academy changed the sorting
rules for French in such a way that accents are not weighted
from the end of a word any more. ICU 4.6 / CLDR 1.9
incorporated the change. Canadian French hasn't adopted the
change, yet.

Chrome is the only port that uses new rules with ICU 4.6. So,
for now, I'm changing the expectation file for Chrome only.
Expand Down
@@ -0,0 +1 @@
e5b8ccf063e8766ee2ae134e0774edb6
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,13 @@
layer at (0,0) size 480x360
RenderView at (0,0) size 480x360
layer at (0,0) size 480x360
RenderSVGRoot {svg} at (0,0) size 480x360
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGContainer {g} at (120,60) size 150x150
RenderSVGContainer {g} at (120,60) size 150x150
RenderSVGPath {rect} at (120,60) size 150x150 [fill={[type=SOLID] [color=#00FF00]}] [x=120.00] [y=60.00] [width=150.00] [height=150.00]
RenderSVGContainer {g} at (10,310) size 231x38
RenderSVGText {text} at (10,310) size 231x38 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 231x38
chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 231.00: "$Revision: 1.8 $"
RenderSVGPath {rect} at (0,0) size 480x360 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
@@ -0,0 +1 @@
bfc73af272d880647c1c12045c4e122b
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (0,0) size 430x100
RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
RenderSVGPath {rect} at (110,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=110.00] [y=0.00] [width=100.00] [height=100.00]
RenderSVGPath {rect} at (220,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=220.00] [y=0.00] [width=100.00] [height=100.00]
RenderSVGPath {rect} at (330,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=330.00] [y=0.00] [width=100.00] [height=100.00]
@@ -0,0 +1 @@
bfc73af272d880647c1c12045c4e122b
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (0,0) size 430x100
RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
RenderSVGPath {rect} at (110,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=110.00] [y=0.00] [width=100.00] [height=100.00]
RenderSVGPath {rect} at (220,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=220.00] [y=0.00] [width=100.00] [height=100.00]
RenderSVGPath {rect} at (330,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=330.00] [y=0.00] [width=100.00] [height=100.00]
60 changes: 60 additions & 0 deletions LayoutTests/svg/W3C-SVG-1.1-SE/color-prop-05-t.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,44 @@
SVG 1.1 dynamic animation tests

Tests animation on 'currentColor'.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".



Initial condition:
PASS document.defaultView.getComputedStyle(rect).getPropertyValue('fill') is "#ff0000"
PASS (fillPaint = document.defaultView.getComputedStyle(rect).getPropertyCSSValue('fill')).toString() is "[object SVGPaint]"
PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR
PASS fillPaint.uri is ""
PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_CURRENTCOLOR
PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]"
PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0

Half-time condition:
PASS document.defaultView.getComputedStyle(rect).getPropertyValue('fill') is "#804000"
PASS (fillPaint = document.defaultView.getComputedStyle(rect).getPropertyCSSValue('fill')).toString() is "[object SVGPaint]"
PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR
PASS fillPaint.uri is ""
PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_CURRENTCOLOR
PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]"
PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 64
PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0

End condition:
PASS document.defaultView.getComputedStyle(rect).getPropertyValue('fill') is "#008000"
PASS (fillPaint = document.defaultView.getComputedStyle(rect).getPropertyCSSValue('fill')).toString() is "[object SVGPaint]"
PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR
PASS fillPaint.uri is ""
PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_CURRENTCOLOR
PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]"
PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS successfullyParsed is true

TEST COMPLETE

15 changes: 15 additions & 0 deletions LayoutTests/svg/animations/animate-color-fill-currentColor.html
@@ -0,0 +1,15 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
<script src="resources/SVGAnimationTestCase.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic animation tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="script-tests/animate-color-fill-currentColor.js"></script>
</body>
</html>
@@ -0,0 +1,74 @@
description("Tests animation on 'currentColor'.");
createSVGTestCase();

// Setup test document
var rect = createSVGElement("rect");
rect.setAttribute("id", "rect");
rect.setAttribute("width", "100px");
rect.setAttribute("height", "100px");
rect.setAttribute("fill", "currentColor");
rect.setAttribute("color", "red");

var animateColor = createSVGElement("animateColor");
animateColor.setAttribute("id", "animateColor");
animateColor.setAttribute("attributeName", "color");
animateColor.setAttribute("from", "red");
animateColor.setAttribute("to", "green");
animateColor.setAttribute("dur", "3s");
animateColor.setAttribute("begin", "click");
animateColor.setAttribute("fill", "freeze");
rect.appendChild(animateColor);
rootSVGElement.appendChild(rect);

function checkFillColor(red, green, blue, hex) {
shouldBeEqualToString("document.defaultView.getComputedStyle(rect).getPropertyValue('fill')", hex);

try {
shouldBeEqualToString("(fillPaint = document.defaultView.getComputedStyle(rect).getPropertyCSSValue('fill')).toString()", "[object SVGPaint]");
shouldBe("fillPaint.paintType", "SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR");
shouldBeEqualToString("fillPaint.uri", "");
shouldBe("fillPaint.colorType", "SVGColor.SVG_COLORTYPE_CURRENTCOLOR");
shouldBeEqualToString("(fillColor = fillPaint.rgbColor).toString()", "[object RGBColor]");
shouldBe("fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "" + red);
shouldBe("fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "" + green);
shouldBe("fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "" + blue);
} catch(e) {
// Opera doesn't support getPropertyCSSValue - no way to compare to their SVGPaint/SVGColor objects :(
}
}

// Setup animation test
function sample1() {
debug("");
debug("Initial condition:");
checkFillColor(255, 0, 0, "#ff0000");
}

function sample2() {
debug("");
debug("Half-time condition:");
checkFillColor(128, 64, 0, "#804000");
}

function sample3() {
debug("");
debug("End condition:");
checkFillColor(0, 128, 0, "#008000");
}

function executeTest() {
const expectedValues = [
// [animationId, time, elementId, sampleCallback]
["animateColor", 0.0, "rect", sample1],
["animateColor", 1.5, "rect", sample2],
["animateColor", 3.0, "rect", sample3]
];

runAnimationTest(expectedValues);
}

// Begin test async
rect.setAttribute("onclick", "executeTest()");
window.setTimeout("triggerUpdate(50, 50)", 0);

var successfullyParsed = true;
25 changes: 25 additions & 0 deletions LayoutTests/svg/custom/SVGPaint-mutate-attribute.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions LayoutTests/svg/custom/SVGPaint-mutate-inline-style.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions LayoutTests/svg/dom/SVGColor-expected.txt
Expand Up @@ -43,7 +43,7 @@ PASS rgbColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 77
PASS rgbColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS rgbColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 77
PASS stopElement.style.stopColor is "#4d004d"
FAIL document.defaultView.getComputedStyle(stopElement).stopColor should be rgb(77, 0, 77). Was rgb(255, 0, 0).
PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(77, 0, 77)"

Test using setColor() and SVG_COLORTYPE_CURRENTCOLOR
PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_CURRENTCOLOR, 'rgb(77,0,77)', 'icc-color(myRGB, 0, 1, 2)') is undefined.
Expand All @@ -54,7 +54,7 @@ PASS rgbColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS rgbColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS rgbColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS stopElement.style.stopColor is "currentColor"
FAIL document.defaultView.getComputedStyle(stopElement).stopColor should be rgb(0, 128, 0). Was rgb(255, 0, 0).
PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(0, 128, 0)"

Test using setColor() and SVG_COLORTYPE_RGBCOLOR
PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_RGBCOLOR, 'rgb(0,77,0)', 'icc-color(myRGB, 0, 1, 2)') is undefined.
Expand All @@ -64,7 +64,7 @@ PASS (rgbColor = stopColor.rgbColor).toString() is "[object RGBColor]"
PASS rgbColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS rgbColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 77
PASS rgbColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
FAIL document.defaultView.getComputedStyle(stopElement).stopColor should be rgb(0, 77, 0). Was rgb(255, 0, 0).
PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(0, 77, 0)"
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
4 changes: 2 additions & 2 deletions LayoutTests/svg/dom/SVGPaint-expected.txt
Expand Up @@ -165,7 +165,7 @@ PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS rectElement.style.fill is "url(#foo) currentColor"
FAIL document.defaultView.getComputedStyle(rectElement).fill should be url(#foo) #00ff00. Was url(#foo) currentColor.
PASS document.defaultView.getComputedStyle(rectElement).fill is "url(#foo) #00ff00"

Test using setPaint() and SVG_PAINTTYPE_URI_RGBCOLOR
PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR, 'url(#test)', 'rgb(77,0,77)', 'icc-color(myRGB, 0, 1, 2)') is undefined.
Expand Down Expand Up @@ -213,7 +213,7 @@ PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS rectElement.style.fill is "currentColor"
FAIL document.defaultView.getComputedStyle(rectElement).fill should be #00ff00. Was currentColor.
PASS document.defaultView.getComputedStyle(rectElement).fill is "#00ff00"

Test using setPaint() and SVG_PAINTTYPE_RGBCOLOR
PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR, 'url(#test)', 'rgb(0,77,0)', 'icc-color(myRGB, 0, 1, 2)') is undefined.
Expand Down

0 comments on commit 503165c

Please sign in to comment.