Title: [89490] trunk
Revision
89490
Author
[email protected]
Date
2011-06-22 15:42:01 -0700 (Wed, 22 Jun 2011)

Log Message

2011-06-22  Rob Buis  <[email protected]>

        Reviewed by Nikolas Zimmermann.

        SVG1.1SE test with pointer-events and invalid gradient fill fails
        https://bugs.webkit.org/show_bug.cgi?id=63109

        * platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.png: Added.
        * platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt: Added.
        * svg/W3C-SVG-1.1-SE/interact-pointer-03-t.svg: Added.
        * svg/custom/pointer-events-invalid-fill-expected.txt: Added.
        * svg/custom/pointer-events-invalid-fill.svg: Added.
2011-06-22  Rob Buis  <[email protected]>

        Reviewed by Nikolas Zimmermann.

        SVG1.1SE test with pointer-events and invalid gradient fill fails
        https://bugs.webkit.org/show_bug.cgi?id=63109

        Properly detect fill/stroke properties of type SVG_PAINTTYPE_URI_NONE, store it in SVGPaint
        and don't apply the paint if the uri lookup fails.

        Tests: svg/W3C-SVG-1.1-SE/interact-pointer-03-t.svg
               svg/custom/pointer-events-invalid-fill.svg

        * css/SVGCSSParser.cpp:
        (WebCore::CSSParser::parseSVGValue):
        * rendering/svg/RenderSVGResource.cpp:
        (WebCore::requestPaintingResource):
        * svg/SVGPaint.h:
        (WebCore::SVGPaint::createURIAndNone):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89489 => 89490)


--- trunk/LayoutTests/ChangeLog	2011-06-22 22:35:38 UTC (rev 89489)
+++ trunk/LayoutTests/ChangeLog	2011-06-22 22:42:01 UTC (rev 89490)
@@ -1,3 +1,16 @@
+2011-06-22  Rob Buis  <[email protected]>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG1.1SE test with pointer-events and invalid gradient fill fails
+        https://bugs.webkit.org/show_bug.cgi?id=63109
+
+        * platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.png: Added.
+        * platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt: Added.
+        * svg/W3C-SVG-1.1-SE/interact-pointer-03-t.svg: Added.
+        * svg/custom/pointer-events-invalid-fill-expected.txt: Added.
+        * svg/custom/pointer-events-invalid-fill.svg: Added.
+
 2011-06-22  Matthew Delaney  <[email protected]>
 
         Reviewed by Adam Roben.

Added: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt (0 => 89490)


--- trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt	2011-06-22 22:42:01 UTC (rev 89490)
@@ -0,0 +1,20 @@
+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 (10,28) size 297x125
+      RenderSVGText {text} at (10,28) size 297x15 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 297x15
+          chunk 1 text run 1 at (10.00,40.00) startOffset 0 endOffset 56 width 297.00: "Test pointer-events=\"painted\" with paint server fallback"
+      RenderSVGPath {rect} at (10,80) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=10.00] [y=80.00] [width=50.00] [height=50.00]
+      RenderSVGPath {rect} at (10,80) size 50x50 [x=10.00] [y=80.00] [width=50.00] [height=50.00]
+      RenderSVGContainer {g} at (10,137) size 257x16
+        RenderSVGText {text} at (10,137) size 257x16 contains 1 chunk(s)
+          RenderSVGInlineText {#text} at (0,0) size 257x16
+            chunk 1 text run 1 at (10.00,150.00) startOffset 0 endOffset 44 width 257.00: "Move the pointing device over the rectangle."
+    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.4 $"
+    RenderSVGPath {rect} at (0,0) size 480x360 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]

Added: trunk/LayoutTests/svg/W3C-SVG-1.1-SE/interact-pointer-03-t.svg (0 => 89490)


--- trunk/LayoutTests/svg/W3C-SVG-1.1-SE/interact-pointer-03-t.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/W3C-SVG-1.1-SE/interact-pointer-03-t.svg	2011-06-22 22:42:01 UTC (rev 89490)
@@ -0,0 +1,81 @@
+<svg id="svg-root" width="100%" height="100%"
+  viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
+  xmlns:xlink="http://www.w3.org/1999/xlink">
+  <!--======================================================================-->
+  <!--=  Copyright 2008 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =""
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
+    template-version="1.4" reviewer="DAS" author="CM" status="accepted"
+    version="$Revision: 1.4 $" testname="$RCSfile: interact-pointer-03-t.svg,v $">
+
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href=""
+      <p>
+        This tests that the "painted" keyword for the pointer-events property
+        does not cause pointer events to be captured when a shape's fill falls
+        back to "none" because a referenced paint server was not available.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
+      <p>
+        After loading the test, a rectangle will be displayed.
+        Move the pointer over the rectangle, and it will change color
+        to indicate whether the test was passed.
+      </p>
+    </d:operatorScript>
+
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
+      <p>
+        If the rectangle turns green once the pointing device is moved over it,
+        the test was passed.  If instead it turns red (or remains black),
+        then the test failed.  If the rectangle was initially red when
+        the document was loaded, then that also indicates that the test failed.
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: interact-pointer-03-t.svg,v $</title>
+  <defs>
+    <font-face
+      font-family="SVGFreeSansASCII"
+      unicode-range="U+0-7F">
+
+      <font-face-src>
+        <font-face-uri xlink:href=""
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+
+    <text x='10' y='40' font-size='12'>Test pointer-events="painted" with paint server fallback</text>
+
+    <rect id='r1' x='10' y='80' width='50' height='50' _onmouseover_='report(true)'/>
+    <rect id='r2' x='10' y='80' width='50' height='50' clip-path='url(#c)' fill='url(#invalid) none' pointer-events='painted' _onmouseover_='report(false)'/>
+
+    <g id='g'>
+      <text id='t' x='10' y='150' font-size='13'>Move the pointing device over the rectangle.</text>
+    </g>
+
+    <script>
+      function report(pass) {
+        var color = pass ? 'green' : 'red';
+        document.getElementById('r1').setAttribute('fill', color);
+        document.getElementById('t').firstChild.nodeValue = pass ? "You've passed!" : "You've failed.";
+      }
+    </script>
+
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none"
+      fill="black">$Revision: 1.4 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
+  <!-- comment out this watermark once the test is approved --><!--
+  <g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>

Added: trunk/LayoutTests/svg/custom/pointer-events-invalid-fill-expected.txt (0 => 89490)


--- trunk/LayoutTests/svg/custom/pointer-events-invalid-fill-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/pointer-events-invalid-fill-expected.txt	2011-06-22 22:42:01 UTC (rev 89490)
@@ -0,0 +1,4 @@
+Test pointer-events="painted" with paint server fallback
+You've passed!
+$Revision: 1.4 $
+

Added: trunk/LayoutTests/svg/custom/pointer-events-invalid-fill.svg (0 => 89490)


--- trunk/LayoutTests/svg/custom/pointer-events-invalid-fill.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/pointer-events-invalid-fill.svg	2011-06-22 22:42:01 UTC (rev 89490)
@@ -0,0 +1,91 @@
+<svg id="svg-root" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"
+  xmlns:xlink="http://www.w3.org/1999/xlink" _onload_="runTest()">
+  <!--======================================================================-->
+  <!--=  Copyright 2008 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =""
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
+    template-version="1.4" reviewer="DAS" author="CM" status="accepted"
+    version="$Revision: 1.4 $" testname="$RCSfile: interact-pointer-03-t.svg,v $">
+
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href=""
+      <p>
+        This tests that the "painted" keyword for the pointer-events property
+        does not cause pointer events to be captured when a shape's fill falls
+        back to "none" because a referenced paint server was not available.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
+      <p>
+        After loading the test, a rectangle will be displayed.
+        Move the pointer over the rectangle, and it will change color
+        to indicate whether the test was passed.
+      </p>
+    </d:operatorScript>
+
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
+      <p>
+        If the rectangle turns green once the pointing device is moved over it,
+        the test was passed.  If instead it turns red (or remains black),
+        then the test failed.  If the rectangle was initially red when
+        the document was loaded, then that also indicates that the test failed.
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: interact-pointer-03-t.svg,v $</title>
+  <defs>
+    <font-face
+      font-family="SVGFreeSansASCII"
+      unicode-range="U+0-7F">
+
+      <font-face-src>
+        <font-face-uri xlink:href=""
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+
+    <text x='10' y='40' font-size='12'>Test pointer-events="painted" with paint server fallback</text>
+
+    <rect id='r1' x='10' y='80' width='50' height='50' _onmouseover_='report(true)'/>
+    <rect id='r2' x='10' y='80' width='50' height='50' clip-path='url(#c)' fill='url(#invalid) none' pointer-events='painted' _onmouseover_='report(false)'/>
+
+    <g id='g'>
+      <text id='t' x='10' y='150' font-size='13'>Move the pointing device over the rectangle.</text>
+    </g>
+
+    <script>
+      if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+      }
+      function runTest() {
+        if (window.eventSender) {
+          eventSender.mouseMoveTo(30, 100);
+        }
+      }
+      function report(pass) {
+        var color = pass ? 'green' : 'red';
+        document.getElementById('r1').setAttribute('fill', color);
+        document.getElementById('t').firstChild.nodeValue = pass ? "You've passed!" : "You've failed.";
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }
+    </script>
+
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none"
+      fill="black">$Revision: 1.4 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
+  <!-- comment out this watermark once the test is approved --><!--
+  <g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (89489 => 89490)


--- trunk/Source/WebCore/ChangeLog	2011-06-22 22:35:38 UTC (rev 89489)
+++ trunk/Source/WebCore/ChangeLog	2011-06-22 22:42:01 UTC (rev 89490)
@@ -1,3 +1,23 @@
+2011-06-22  Rob Buis  <[email protected]>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG1.1SE test with pointer-events and invalid gradient fill fails
+        https://bugs.webkit.org/show_bug.cgi?id=63109
+
+        Properly detect fill/stroke properties of type SVG_PAINTTYPE_URI_NONE, store it in SVGPaint
+        and don't apply the paint if the uri lookup fails.
+
+        Tests: svg/W3C-SVG-1.1-SE/interact-pointer-03-t.svg
+               svg/custom/pointer-events-invalid-fill.svg
+
+        * css/SVGCSSParser.cpp:
+        (WebCore::CSSParser::parseSVGValue):
+        * rendering/svg/RenderSVGResource.cpp:
+        (WebCore::requestPaintingResource):
+        * svg/SVGPaint.h:
+        (WebCore::SVGPaint::createURIAndNone):
+
 2011-06-22  Cary Clark  <[email protected]>
 
         Reviewed by Darin Fisher.

Modified: trunk/Source/WebCore/css/SVGCSSParser.cpp (89489 => 89490)


--- trunk/Source/WebCore/css/SVGCSSParser.cpp	2011-06-22 22:35:38 UTC (rev 89489)
+++ trunk/Source/WebCore/css/SVGCSSParser.cpp	2011-06-22 22:42:01 UTC (rev 89490)
@@ -186,9 +186,13 @@
                 parsedValue = SVGPaint::createColor(RenderTheme::defaultTheme()->systemColor(id));
             else if (value->unit == CSSPrimitiveValue::CSS_URI) {
                 RGBA32 c = Color::transparent;
-                if (m_valueList->next() && parseColorFromValue(m_valueList->current(), c)) {
-                    parsedValue = SVGPaint::createURIAndColor(value->string, c);
-                } else
+                if (m_valueList->next()) {
+                    if (parseColorFromValue(m_valueList->current(), c))
+                        parsedValue = SVGPaint::createURIAndColor(value->string, c);
+                    else if (m_valueList->current()->id == CSSValueNone)
+                        parsedValue = SVGPaint::createURIAndNone(value->string);
+                }
+                if (!parsedValue)
                     parsedValue = SVGPaint::createURI(value->string);
             } else
                 parsedValue = parseSVGPaint();

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp (89489 => 89490)


--- trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp	2011-06-22 22:35:38 UTC (rev 89489)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp	2011-06-22 22:42:01 UTC (rev 89490)
@@ -108,7 +108,7 @@
     // If no resources are associated with the given renderer, return the color resource.
     SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object);
     if (!resources) {
-        if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
+        if (paintType == SVGPaint::SVG_PAINTTYPE_URI_NONE || !inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
             return 0;
 
         colorResource->setColor(color);

Modified: trunk/Source/WebCore/svg/SVGPaint.h (89489 => 89490)


--- trunk/Source/WebCore/svg/SVGPaint.h	2011-06-22 22:35:38 UTC (rev 89489)
+++ trunk/Source/WebCore/svg/SVGPaint.h	2011-06-22 22:42:01 UTC (rev 89490)
@@ -79,6 +79,12 @@
         return paint.release();
     }
 
+    static PassRefPtr<SVGPaint> createURIAndNone(const String& uri)
+    {
+        RefPtr<SVGPaint> paint = adoptRef(new SVGPaint(SVG_PAINTTYPE_URI_NONE, uri));
+        return paint.release();
+    }
+
     const SVGPaintType& paintType() const { return m_paintType; }
     String uri() const { return m_uri; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to