Title: [86978] trunk
Revision
86978
Author
[email protected]
Date
2011-05-20 12:53:13 -0700 (Fri, 20 May 2011)

Log Message

2011-05-20  Rob Buis  <[email protected]>

        Reviewed by Dirk Schulze.

        Use test from ietestcenter fails
        https://bugs.webkit.org/show_bug.cgi?id=60844

        When an id changes on an in-document element, we need to check whether the id
        is part of the pending elements. Since this is the same thing as happens in
        insertedIntoDocument, split out the common code into buildPendingResourcesIfNeeded.

        Test: svg/W3C-SVG-1.1-SE/struct-use-14-f.svg

        * svg/SVGStyledElement.cpp:
        (WebCore::SVGStyledElement::svgAttributeChanged):
        (WebCore::SVGStyledElement::insertedIntoDocument):
        (WebCore::SVGStyledElement::buildPendingResourcesIfNeeded):
        * svg/SVGStyledElement.h:
2011-05-20  Rob Buis  <[email protected]>

        Reviewed by Dirk Schulze.

        Use test from ietestcenter fails
        https://bugs.webkit.org/show_bug.cgi?id=60844

        * platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.png: Added.
        * platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt: Added.
        * svg/W3C-SVG-1.1-SE/struct-use-14-f.svg: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (86977 => 86978)


--- trunk/LayoutTests/ChangeLog	2011-05-20 19:43:42 UTC (rev 86977)
+++ trunk/LayoutTests/ChangeLog	2011-05-20 19:53:13 UTC (rev 86978)
@@ -1,3 +1,14 @@
+2011-05-20  Rob Buis  <[email protected]>
+
+        Reviewed by Dirk Schulze.
+
+        Use test from ietestcenter fails
+        https://bugs.webkit.org/show_bug.cgi?id=60844
+
+        * platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.png: Added.
+        * platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt: Added.
+        * svg/W3C-SVG-1.1-SE/struct-use-14-f.svg: Added.
+
 2011-05-20  Simon Fraser  <[email protected]>
 
         Reviewed by Sam Weinig.

Added: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt (0 => 86978)


--- trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt	2011-05-20 19:53:13 UTC (rev 86978)
@@ -0,0 +1,23 @@
+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 (0,0) size 100x100
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+        RenderSVGContainer {g} at (0,0) size 100x100
+          RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
+      RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
+      RenderSVGContainer {use} at (0,0) size 100x100
+        RenderSVGContainer {g} at (0,0) size 100x100
+          RenderSVGPath {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.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.3 $"
+    RenderSVGPath {rect} at (0,0) size 480x360 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
+    RenderSVGContainer {g} at (0,0) size 480x24
+      RenderSVGPath {rect} at (0,0) size 480x22 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [x=1.00] [y=1.00] [width=478.00] [height=20.00]
+      RenderSVGText {text} at (207,-1) size 66x24 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 66x24
+          chunk 1 (middle anchor) text run 1 at (207.00,18.00) startOffset 0 endOffset 5 width 66.00: "DRAFT"

Added: trunk/LayoutTests/svg/W3C-SVG-1.1-SE/struct-use-14-f.svg (0 => 86978)


--- trunk/LayoutTests/svg/W3C-SVG-1.1-SE/struct-use-14-f.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/W3C-SVG-1.1-SE/struct-use-14-f.svg	2011-05-20 19:53:13 UTC (rev 86978)
@@ -0,0 +1,70 @@
+<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="CM" author="Microsoft" status="reviewed" version="$Revision: 1.3 $" testname="$RCSfile: struct-use-14-f.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href=""
+      <p>
+        Test that the 'use' element's 'xlink:href' attribute referencing dynamically set 'id' attributes is supported.
+      </p>
+      <p>
+        The test defines a 'use' element with its 'xlink:href' attribute set to 'pass' which is an invalid element id. A green 'rect' element has its 'id'
+        attribute set to 'pass' via 'setAttribute'. The referenced 'rect' is a child of a 'defs' element so that it does not render, and it is wrapped with a 'g'
+        element in order to obtain a DOM reference to it.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
+      <p>
+        Run the test. No interaction required. 
+      </p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
+      <p>
+        The test is passed if there is a green square visible on the page, and no red.
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: struct-use-14-f.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">
+    <defs>
+        <g id="test">
+            <rect width="100" height="100" fill="green"/>
+        </g>
+    </defs>
+    <rect width="100" height="100" fill="red"/>
+    <use xlink:href=""
+    <script type="text/_javascript_"><![CDATA[
+        try
+        {
+            var test = document.getElementById("test");
+            var rect = test.firstChild.nextSibling;
+
+            rect.setAttribute("id", "pass");
+        }
+        catch(ex)
+        {
+            alert("ERROR: " + ex.message);
+        }]]>
+    </script>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.3 $</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 (86977 => 86978)


--- trunk/Source/WebCore/ChangeLog	2011-05-20 19:43:42 UTC (rev 86977)
+++ trunk/Source/WebCore/ChangeLog	2011-05-20 19:53:13 UTC (rev 86978)
@@ -1,3 +1,22 @@
+2011-05-20  Rob Buis  <[email protected]>
+
+        Reviewed by Dirk Schulze.
+
+        Use test from ietestcenter fails
+        https://bugs.webkit.org/show_bug.cgi?id=60844
+
+        When an id changes on an in-document element, we need to check whether the id
+        is part of the pending elements. Since this is the same thing as happens in
+        insertedIntoDocument, split out the common code into buildPendingResourcesIfNeeded.
+
+        Test: svg/W3C-SVG-1.1-SE/struct-use-14-f.svg
+
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::svgAttributeChanged):
+        (WebCore::SVGStyledElement::insertedIntoDocument):
+        (WebCore::SVGStyledElement::buildPendingResourcesIfNeeded):
+        * svg/SVGStyledElement.h:
+
 2011-05-20  Abhishek Arya  <[email protected]>
 
         Reviewed by Kent Tamura.

Modified: trunk/Source/WebCore/svg/SVGStyledElement.cpp (86977 => 86978)


--- trunk/Source/WebCore/svg/SVGStyledElement.cpp	2011-05-20 19:43:42 UTC (rev 86977)
+++ trunk/Source/WebCore/svg/SVGStyledElement.cpp	2011-05-20 19:53:13 UTC (rev 86978)
@@ -336,6 +336,8 @@
         // Notify resources about id changes, this is important as we cache resources by id in SVGDocumentExtensions
         if (object && object->isSVGResourceContainer())
             object->toRenderSVGResourceContainer()->idChanged();
+        if (inDocument())
+            buildPendingResourcesIfNeeded();
     }
 
     // Invalidate all SVGElementInstances associated with us
@@ -362,7 +364,11 @@
 {
     SVGElement::insertedIntoDocument();
     updateRelativeLengthsInformation();
+    buildPendingResourcesIfNeeded();
+}
 
+void SVGStyledElement::buildPendingResourcesIfNeeded() const
+{
     Document* document = this->document();
     if (!needsPendingResourceHandling() || !document)
         return;

Modified: trunk/Source/WebCore/svg/SVGStyledElement.h (86977 => 86978)


--- trunk/Source/WebCore/svg/SVGStyledElement.h	2011-05-20 19:43:42 UTC (rev 86977)
+++ trunk/Source/WebCore/svg/SVGStyledElement.h	2011-05-20 19:53:13 UTC (rev 86978)
@@ -87,6 +87,8 @@
 private:
     virtual bool isStyled() const { return true; }
 
+    void buildPendingResourcesIfNeeded() const;
+
     HashSet<SVGStyledElement*> m_elementsWithRelativeLengths;
 
     // Animated property declarations
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to