Title: [108832] trunk
Revision
108832
Author
[email protected]
Date
2012-02-24 11:39:01 -0800 (Fri, 24 Feb 2012)

Log Message

SVG should be supported in Dashboard compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=78322
<rdar://problem/5861278>

Reviewed by Dean Jackson.

Enable SVG elements inside Dashboard, more or less reverting r21418.

Tests: http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html
       svg/custom/embedded-svg-allowed-in-dashboard.xml
       svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html
       svg/custom/manually-parsed-svg-allowed-in-dashboard.html
       svg/custom/svg-allowed-in-dashboard-object.html

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* dom/Document.cpp:
(WebCore::Document::importNode):
* dom/make_names.pl:
(printFactoryCppFile):

Change tests that ensured that SVG didn't work in Dashboard to instead test that it does!

* http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard-expected.txt: Added.
* http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html: Renamed from LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard.html.
* http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard-expected.txt: Removed.
* svg/custom/embedded-svg-allowed-in-dashboard-expected.txt: Added.
* svg/custom/embedded-svg-allowed-in-dashboard.xml: Renamed from LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard.xml.
* svg/custom/embedded-svg-disallowed-in-dashboard-expected.txt: Removed.
* svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard-expected.txt: Added.
* svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html: Renamed from LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard.html.
* svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard-expected.txt: Removed.
* svg/custom/manually-parsed-svg-allowed-in-dashboard-expected.txt: Added.
* svg/custom/manually-parsed-svg-allowed-in-dashboard.html: Renamed from LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard.html.
* svg/custom/manually-parsed-svg-disallowed-in-dashboard-expected.txt: Removed.
* svg/custom/svg-allowed-in-dashboard-object-expected.txt: Added.
* svg/custom/svg-allowed-in-dashboard-object.html: Renamed from LayoutTests/svg/custom/svg-disallowed-in-dashboard-object.html.
* svg/custom/svg-disallowed-in-dashboard-object-expected.txt: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (108831 => 108832)


--- trunk/LayoutTests/ChangeLog	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/ChangeLog	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,3 +1,29 @@
+2012-02-24  Tim Horton  <[email protected]>
+
+        SVG should be supported in Dashboard compatibility mode
+        https://bugs.webkit.org/show_bug.cgi?id=78322
+        <rdar://problem/5861278>
+
+        Reviewed by Dean Jackson.
+
+        Change tests that ensured that SVG didn't work in Dashboard to instead test that it does!
+
+        * http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard-expected.txt: Added.
+        * http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html: Renamed from LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard.html.
+        * http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard-expected.txt: Removed.
+        * svg/custom/embedded-svg-allowed-in-dashboard-expected.txt: Added.
+        * svg/custom/embedded-svg-allowed-in-dashboard.xml: Renamed from LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard.xml.
+        * svg/custom/embedded-svg-disallowed-in-dashboard-expected.txt: Removed.
+        * svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard-expected.txt: Added.
+        * svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html: Renamed from LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard.html.
+        * svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard-expected.txt: Removed.
+        * svg/custom/manually-parsed-svg-allowed-in-dashboard-expected.txt: Added.
+        * svg/custom/manually-parsed-svg-allowed-in-dashboard.html: Renamed from LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard.html.
+        * svg/custom/manually-parsed-svg-disallowed-in-dashboard-expected.txt: Removed.
+        * svg/custom/svg-allowed-in-dashboard-object-expected.txt: Added.
+        * svg/custom/svg-allowed-in-dashboard-object.html: Renamed from LayoutTests/svg/custom/svg-disallowed-in-dashboard-object.html.
+        * svg/custom/svg-disallowed-in-dashboard-object-expected.txt: Removed.
+
 2012-02-24  Min Qin  <[email protected]>
 
         Expose a setting to exempt media playback from user gesture requirement after a user gesture is initiated on loading/playing a media

Added: trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard-expected.txt (0 => 108832)


--- trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,6 @@
+Test to make sure we can use XHR to create usable SVG in dashboard compatibility mode. This cannot be tested manually.
+
+Received doc of type: [object Document]
+PASS: Managed to insert SVG element into tree
+Imported node of type: [object SVGCircleElement]
+

Added: trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html (0 => 108832)


--- trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,78 @@
+<!doctype html>
+<html>
+<head>
+<title>Test to ensure SVG is enabled in Dashboard compatibility mode</title>
+<script>
+    var rq;
+
+    function loadSVG()
+    {
+        url = '';
+
+        rq = false;
+    
+        try {
+          if (window.XMLHttpRequest) {
+            rq = new XMLHttpRequest();
+            rq.overrideMimeType('text/svg+xml');
+            rq._onreadystatechange_ = processReqChange;
+            rq.open('GET', url, true);
+            rq.send();
+          }
+        } catch (ex) {
+            rq = false;
+            alert(ex);
+        }
+    }
+    
+    function debug(str) {
+        var c = document.getElementById('console')
+        c.appendChild(document.createTextNode(str + '\n'));
+    }
+
+    function processReqChange()
+    {
+        if (rq.readyState == 4) {
+            try {
+                var svgDoc = rq.responseXML;
+                if (rq.status == 200) {
+                    debug("Received doc of type: " + svgDoc);
+                    // Import SVG element into tree.
+                    var importedNode = null;
+                    try {
+                        importedNode = document.importNode(svgDoc.getElementById('svgCircle'), true);
+                    } catch(e) {
+                    }
+            
+                    if (importedNode) {
+                        debug("PASS: Managed to insert SVG element into tree");
+                        debug("Imported node of type: " + importedNode);
+                        document.getElementById('targetDiv').appendChild(importedNode);
+                    } else {
+                        debug("FAIL: Could not insert SVG element into tree");
+                    }
+                } else {
+                    debug('FAIL: Unable to load SVG document: ' + rq.statusText);
+                }
+            } catch (e) {
+            }
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }
+    }
+</script>
+</head>
+
+<body _onload_="loadSVG()">
+<p>Test to make sure we can use XHR to create usable SVG in dashboard compatibility mode.  This cannot be tested manually.</p>
+<div id="targetDiv"></div>
+<pre id="console"></pre>
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.setUseDashboardCompatibilityMode(true);
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+</script>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard-expected.txt (108831 => 108832)


--- trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard-expected.txt	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,5 +0,0 @@
-Test to make sure we can't use XHR to create usable SVG in dashboard compatibility mode. This cannot be tested manually.
-
-Received doc of type: [object Document]
-PASS: Could not insert SVG element into tree
-

Deleted: trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard.html (108831 => 108832)


--- trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard.html	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,80 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>Test to ensure SVG is disabled in Dashboard compatibility mode</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<script language="_javascript_" type="text/_javascript_">
-
-    var rq;
-
-    function loadSVG()
-    {
-        url = '';
-
-        rq = false;
-    
-        try {
-          if (window.XMLHttpRequest) {
-            rq = new XMLHttpRequest();
-            rq.overrideMimeType('text/svg+xml');
-            rq._onreadystatechange_ = processReqChange;
-            rq.open('GET', url, true);
-            rq.send();
-          }
-        } catch (ex) {
-            rq = false;
-            alert(ex);
-        }
-    }
-    
-    function debug(str) {
-        var c = document.getElementById('console')
-        c.appendChild(document.createTextNode(str + '\n'));
-    }
-
-    function processReqChange()
-    {
-        if (rq.readyState == 4) {
-            try {
-                var svgDoc = rq.responseXML;
-                if (rq.status == 200) {
-                    debug("Received doc of type: " + svgDoc);
-                    // Import SVG element into tree.
-                    var importedNode = null;
-                    try {
-                        importedNode = document.importNode(svgDoc.getElementById('svgCircle'), true);
-                    } catch(e) {
-                    }
-            
-                    if (importedNode) {
-                        debug("FAIL: Managed to insert SVG element into tree");
-                        debug("Imported node of type: " + importedNode);
-                        document.getElementById('targetDiv').appendChild(importedNode);
-                    } else {
-                        debug("PASS: Could not insert SVG element into tree");
-                    }
-                } else {
-                    debug('FAIL: Unable to load SVG document: ' + rq.statusText);
-                }
-            } catch (e) {
-            }
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
-        }
-    }
-</script>
-</head>
-
-<body _onLoad_="loadSVG();">
-<p>Test to make sure we can't use XHR to create usable SVG in dashboard compatibility mode.  This cannot be tested manually.</p>
-<div id="targetDiv"></div>
-<pre id="console"></pre>
-<script>
-    if (window.layoutTestController) {
-        layoutTestController.setUseDashboardCompatibilityMode(true);
-        layoutTestController.dumpAsText();
-        layoutTestController.waitUntilDone();
-    }
-</script>
-</body>
-</html>

Added: trunk/LayoutTests/svg/custom/embedded-svg-allowed-in-dashboard-expected.txt (0 => 108832)


--- trunk/LayoutTests/svg/custom/embedded-svg-allowed-in-dashboard-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/embedded-svg-allowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,4 @@
+This test is to ensure SVG elements can be created by being embedded in xml documents. It can not be tested manually.
+
+PASS: Successfully embedded SVG in document
+

Added: trunk/LayoutTests/svg/custom/embedded-svg-allowed-in-dashboard.xml (0 => 108832)


--- trunk/LayoutTests/svg/custom/embedded-svg-allowed-in-dashboard.xml	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/embedded-svg-allowed-in-dashboard.xml	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,29 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>Make sure embedded SVG is turned on in dashboard</title>
+    </head>
+    <script>
+         if (window.layoutTestController) {
+             layoutTestController.setUseDashboardCompatibilityMode(true);
+             layoutTestController.dumpAsText();
+         }
+
+         function debug(str) {
+             var c = document.getElementById('console')
+             c.appendChild(document.createTextNode(str + '\n'));
+         }
+    </script>
+    <body>
+        <p>This test is to ensure SVG elements can be created by being embedded in xml documents.  It can not be tested manually.</p>
+        <pre id="console"></pre>
+        <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+             <circle id="svgCircleNode" cx="100" cy="100" r="50" fill="red"/>
+        </svg>
+        <script>
+           if(document.getElementById('svgCircleNode') instanceof SVGElement)
+               debug("PASS: Successfully embedded SVG in document");
+           else
+               debug("FAIL: SVG Elements could not be created");
+        </script>
+    </body>
+</html>

Deleted: trunk/LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard-expected.txt (108831 => 108832)


--- trunk/LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard-expected.txt	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,4 +0,0 @@
-This test is to ensure SVG elements can't be created by being embedded in xml documents. It can not be tested manually.
-
- PASS: SVG Elements could not be created
-

Deleted: trunk/LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard.xml (108831 => 108832)


--- trunk/LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard.xml	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/embedded-svg-disallowed-in-dashboard.xml	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,28 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>Make sure embedded SVG is turned off in dashboard</title>
-    </head>
-    <script>
-         if (window.layoutTestController) {
-             layoutTestController.setUseDashboardCompatibilityMode(true);
-             layoutTestController.dumpAsText();
-         }
-         function debug(str) {
-             var c = document.getElementById('console')
-             c.appendChild(document.createTextNode(str + '\n'));
-         }
-    </script>
-    <body>
-        <p>This test is to ensure SVG elements can't be created by being embedded in xml documents.  It can not be tested manually.</p>
-        <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200">
-             <circle id="svgCircleNode" cx="100" cy="100" r="50" fill="red"/>
-        </svg>
-        <pre id="console"></pre> 
-        <script>
-           if(document.getElementById('svgCircleNode') instanceof SVGElement)
-               debug("FAIL: Successfully embedded SVG in document");
-           else
-               debug("PASS: SVG Elements could not be created");
-        </script>
-    </body>
-</html>

Added: trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard-expected.txt (0 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,6 @@
+This test makes sure we can add manually parsed SVG to the document when in dashboard compatibility mode. It can not be tested manually.
+
+Parsing of the document isn't prevented and produces a [object Document]
+The circle element is of type [object SVGCircleElement]
+PASS: Managed to insert SVG element into tree
+

Added: trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html (0 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,49 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>Make sure embedded SVG is turned off in dashboard</title>
+    </head>
+    <script>
+        function debug(str) {
+            var c = document.getElementById('console')
+            c.appendChild(document.createTextNode(str + '\n'));
+        }
+        
+        if (window.layoutTestController) {
+            layoutTestController.setUseDashboardCompatibilityMode(true);
+            layoutTestController.dumpAsText();
+        }
+    </script>
+    <body>
+        <p>This test makes sure we can add manually parsed SVG to the document when in dashboard compatibility mode.  It can not be tested manually.</p>
+        <div id="targetDiv"></div>
+        <pre id="console"></pre> 
+        <script>
+            var documentString = '<html xmlns="http://www.w3.org/1999/xhtml">' +
+                                 '<body>' +
+                                 '<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">' +
+                                 '<circle id="svgCircle" cx="50" cy="50" r="50" fill="red"/></svg>' +
+                                 '</body></html>'; 
+
+            // Use DOMParser interface to create a SVGDocument datastructure from SVG content string
+            var parser = new DOMParser();
+            var xhtmlDocument = parser.parseFromString(documentString, "application/xhtml+xml");
+         
+            debug("Parsing of the document isn't prevented and produces a " + xhtmlDocument);
+            debug("The circle element is of type " + xhtmlDocument.getElementById('svgCircle'));
+            
+            // Import SVG element into tree.
+            var importedNode = null;
+            try {
+                importedNode = document.importNode(xhtmlDocument.firstChild, true);
+            } catch(e) {
+            }
+            
+            if (importedNode) {
+                debug("PASS: Managed to insert SVG element into tree");
+                document.getElementById('targetDiv').appendChild(importedNode);
+            } else {
+                debug("FAIL: Could not insert SVG element into tree");
+            }
+        </script>
+    </body>
+</html>

Deleted: trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard-expected.txt (108831 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard-expected.txt	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,6 +0,0 @@
-This test makes sure we can't add manually parsed SVG to the document when in dashboard compatibility mode. It can not be tested manually.
-
-Parsing of the document isn't prevented and produces a [object Document]
-The circle element is of type [object SVGCircleElement]
-PASS: Could not insert SVG element into tree
-

Deleted: trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard.html (108831 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard.html	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,49 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>Make sure embedded SVG is turned off in dashboard</title>
-    </head>
-    <script>
-        function debug(str) {
-            var c = document.getElementById('console')
-            c.appendChild(document.createTextNode(str + '\n'));
-        }
-        
-        if (window.layoutTestController) {
-            layoutTestController.setUseDashboardCompatibilityMode(true);
-            layoutTestController.dumpAsText();
-        }
-    </script>
-    <body>
-        <p>This test makes sure we can't add manually parsed SVG to the document when in dashboard compatibility mode.  It can not be tested manually.</p>
-        <div id="targetDiv"></div>
-        <pre id="console"></pre> 
-        <script>
-            var documentString = '<html xmlns="http://www.w3.org/1999/xhtml">' +
-                                 '<body>' +
-                                 '<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">' +
-                                 '<circle id="svgCircle" cx="50" cy="50" r="50" fill="red"/></svg>' +
-                                 '</body></html>'; 
-
-            // Use DOMParser interface to create a SVGDocument datastructure from SVG content string
-            var parser = new DOMParser();
-            var xhtmlDocument = parser.parseFromString(documentString, "application/xhtml+xml");
-         
-            debug("Parsing of the document isn't prevented and produces a " + xhtmlDocument);
-            debug("The circle element is of type " + xhtmlDocument.getElementById('svgCircle'));
-            
-            // Import SVG element into tree.
-            var importedNode = null;
-            try {
-                importedNode = document.importNode(xhtmlDocument.firstChild, true);
-            } catch(e) {
-            }
-            
-            if (importedNode) {
-                debug("FAIL: Managed to insert SVG element into tree");
-                document.getElementById('targetDiv').appendChild(importedNode);
-            } else {
-                debug("PASS: Could not insert SVG element into tree");
-            }
-        </script>
-    </body>
-</html>

Added: trunk/LayoutTests/svg/custom/manually-parsed-svg-allowed-in-dashboard-expected.txt (0 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-svg-allowed-in-dashboard-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/manually-parsed-svg-allowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,5 @@
+This test makes sure we can add manually parsed SVG to the document when in dashboard compatibility mode. It can not be tested manually.
+
+Parsing of the document isn't prevented and produces a [object SVGDocument]
+PASS: Managed to insert SVG element into tree
+

Added: trunk/LayoutTests/svg/custom/manually-parsed-svg-allowed-in-dashboard.html (0 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-svg-allowed-in-dashboard.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/manually-parsed-svg-allowed-in-dashboard.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,45 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>Make sure embedded SVG is turned on in dashboard</title>
+    </head>
+    <script>
+        function debug(str) {
+            var c = document.getElementById('console')
+            c.appendChild(document.createTextNode(str + '\n'));
+        }
+        
+        if (window.layoutTestController) {
+            layoutTestController.setUseDashboardCompatibilityMode(true);
+            layoutTestController.dumpAsText();
+        }
+    </script>
+    <body>
+        <p>This test makes sure we can add manually parsed SVG to the document when in dashboard compatibility mode.  It can not be tested manually.</p>
+        <div id="targetDiv"></div>
+        <pre id="console"></pre> 
+        <script>
+            var documentString = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">' +
+                                 '<circle cx="50" cy="50" r="50" fill="red"/></svg>';
+
+            // Use DOMParser interface to create a SVGDocument datastructure from SVG content string
+            var parser = new DOMParser();
+            var svgDocument = parser.parseFromString(documentString, "image/svg+xml");
+
+            debug("Parsing of the document isn't prevented and produces a " + svgDocument);
+            
+            // Import SVG element into tree.
+            var importedNode = null;
+            try {
+                importedNode = document.importNode(svgDocument.firstChild, true);
+            } catch(e) {
+            }
+            
+            if (importedNode) {
+                debug("PASS: Managed to insert SVG element into tree");
+                document.getElementById('targetDiv').appendChild(importedNode);
+            } else {
+                debug("FAIL: Could not insert SVG element into tree");
+            }
+        </script>
+    </body>
+</html>

Deleted: trunk/LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard-expected.txt (108831 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard-expected.txt	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,5 +0,0 @@
-This test makes sure we can't add manually parsed SVG to the document when in dashboard compatibility mode. It can not be tested manually.
-
-Parsing of the document isn't prevented and produces a [object SVGDocument]
-PASS: Could not insert SVG element into tree
-

Deleted: trunk/LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard.html (108831 => 108832)


--- trunk/LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard.html	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/manually-parsed-svg-disallowed-in-dashboard.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,45 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>Make sure embedded SVG is turned off in dashboard</title>
-    </head>
-    <script>
-        function debug(str) {
-            var c = document.getElementById('console')
-            c.appendChild(document.createTextNode(str + '\n'));
-        }
-        
-        if (window.layoutTestController) {
-            layoutTestController.setUseDashboardCompatibilityMode(true);
-            layoutTestController.dumpAsText();
-        }
-    </script>
-    <body>
-        <p>This test makes sure we can't add manually parsed SVG to the document when in dashboard compatibility mode.  It can not be tested manually.</p>
-        <div id="targetDiv"></div>
-        <pre id="console"></pre> 
-        <script>
-            var documentString = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">' +
-                                 '<circle cx="50" cy="50" r="50" fill="red"/></svg>';
-
-            // Use DOMParser interface to create a SVGDocument datastructure from SVG content string
-            var parser = new DOMParser();
-            var svgDocument = parser.parseFromString(documentString, "image/svg+xml");
-
-            debug("Parsing of the document isn't prevented and produces a " + svgDocument);
-            
-            // Import SVG element into tree.
-            var importedNode = null;
-            try {
-                importedNode = document.importNode(svgDocument.firstChild, true);
-            } catch(e) {
-            }
-            
-            if (importedNode) {
-                debug("FAIL: Managed to insert SVG element into tree");
-                document.getElementById('targetDiv').appendChild(importedNode);
-            } else {
-                debug("PASS: Could not insert SVG element into tree");
-            }
-        </script>
-    </body>
-</html>

Added: trunk/LayoutTests/svg/custom/svg-allowed-in-dashboard-object-expected.txt (0 => 108832)


--- trunk/LayoutTests/svg/custom/svg-allowed-in-dashboard-object-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/svg-allowed-in-dashboard-object-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,8 @@
+This test makes sure we can open SVG documents in Dashboard compatibility mode. It can not be tested manually.
+
+    
+PASS: Loaded SVG document in <object> tag.
+PASS: Loaded SVG document in <element> tag.
+PASS: Loaded SVG document in <iframe> tag.
+PASS: SVG Documents were loaded
+

Added: trunk/LayoutTests/svg/custom/svg-allowed-in-dashboard-object.html (0 => 108832)


--- trunk/LayoutTests/svg/custom/svg-allowed-in-dashboard-object.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/svg-allowed-in-dashboard-object.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -0,0 +1,70 @@
+<html>
+<body _onload_="runTest()">
+<p>This test makes sure we can open SVG documents in Dashboard compatibility mode.  It can not be tested manually.</p>
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.setUseDashboardCompatibilityMode(true);
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+    
+    function debug(str) {
+        var c = document.getElementById('console')
+        c.appendChild(document.createTextNode(str + '\n'));
+    }
+    
+    function runTest() {
+        try {
+            var failed = false;
+            var svgDoc = null;
+            try {
+                svgDoc = document.getElementById('svgObject').getSVGDocument();
+            } catch (e) {
+                svgDoc = null;
+            }
+            if (svgDoc) {
+                debug("PASS: Loaded SVG document in <object> tag."); 
+                failed = true;
+            } else 
+                debug("FAIL: Did not load SVG document in <object> tag");
+            
+            try {
+                svgDoc = document.getElementById('svgEmbed').getSVGDocument();
+            } catch (e) {
+                svgDoc = null;
+            }
+            if (svgDoc) {
+                debug("PASS: Loaded SVG document in <element> tag."); 
+                failed = true;
+            } else 
+                debug("FAIL: Did not load SVG document in <element> tag");
+            
+            try {
+                svgDoc = document.getElementById('svgIFrame').getSVGDocument();
+            } catch (e) {
+                svgDoc = null;
+            }
+            if (svgDoc) {
+                debug("PASS: Loaded SVG document in <iframe> tag."); 
+                failed = true;
+            } else 
+                debug("FAIL: Did not load SVG document in <iframe> tag");
+            
+            if (failed)
+                debug("PASS: SVG Documents were loaded");
+            else
+                debug("FAIL: SVG Documents were not loaded");
+        } catch (e) {
+            debug("FAIL: Exception thrown: " + e)
+        }
+        if (window.layoutTestController) 
+            layoutTestController.notifyDone();
+    }
+</script>
+    
+   <object id="svgObject" data="" width="100px" height="100px"></object>
+   <embed id="svgEmbed" src="" width="100px" height="100px"></embed>
+   <iframe id="svgIFrame" src="" width="100px" height="100px"></iframe>
+   <pre id="console"></pre>    
+</body>
+</html>

Deleted: trunk/LayoutTests/svg/custom/svg-disallowed-in-dashboard-object-expected.txt (108831 => 108832)


--- trunk/LayoutTests/svg/custom/svg-disallowed-in-dashboard-object-expected.txt	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/svg-disallowed-in-dashboard-object-expected.txt	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,8 +0,0 @@
-This test makes sure we can't open SVG documents in Dashboard compatibility mode. It can not be tested manually.
-
-    
-PASS: Did not load SVG document in <object> tag
-PASS: Did not load SVG document in <element> tag
-PASS: Did not load SVG document in <iframe> tag
-PASS: SVG Documents were not loaded
-

Deleted: trunk/LayoutTests/svg/custom/svg-disallowed-in-dashboard-object.html (108831 => 108832)


--- trunk/LayoutTests/svg/custom/svg-disallowed-in-dashboard-object.html	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/LayoutTests/svg/custom/svg-disallowed-in-dashboard-object.html	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,67 +0,0 @@
-<html>
-<body _onload_="timeOut()">
-<p>This test makes sure we can't open SVG documents in Dashboard compatibility mode.  It can not be tested manually.</p>
-<script>
-    if (window.layoutTestController) {
-        layoutTestController.setUseDashboardCompatibilityMode(true);
-        layoutTestController.dumpAsText();
-    }
-    
-    function debug(str) {
-        var c = document.getElementById('console')
-        c.appendChild(document.createTextNode(str + '\n'));
-    }
-    
-    function timeOut() {
-        try {
-            var failed = false;
-            var svgDoc = null;
-            try {
-                svgDoc = document.getElementById('svgObject').getSVGDocument();
-            } catch (e) {
-                svgDoc = null;
-            }
-            if (svgDoc) {
-                debug("FAIL: Loaded SVG document in <object> tag."); 
-                failed = true;
-            } else 
-                debug("PASS: Did not load SVG document in <object> tag");
-            
-            try {
-                svgDoc = document.getElementById('svgEmbed').getSVGDocument();
-            } catch (e) {
-                svgDoc = null;
-            }
-            if (svgDoc) {
-                debug("FAIL: Loaded SVG document in <element> tag."); 
-                failed = true;
-            } else 
-                debug("PASS: Did not load SVG document in <element> tag");
-            
-            try {
-                svgDoc = document.getElementById('svgIFrame').getSVGDocument();
-            } catch (e) {
-                svgDoc = null;
-            }
-            if (svgDoc) {
-                debug("FAIL: Loaded SVG document in <iframe> tag."); 
-                failed = true;
-            } else 
-                debug("PASS: Did not load SVG document in <iframe> tag");
-            
-            if (failed)
-                debug("FAIL: SVG Documents were loaded");
-            else
-                debug("PASS: SVG Documents were not loaded");
-        } catch (e) {
-            debug("FAIL: Exception thrown: " + e)
-        }
-    }
-</script>
-    
-   <object id="svgObject" data="" width="100px" height="100px"></object>
-   <embed id="svgElement" src="" width="100px" height="100px"></embed>
-   <iframe id="svgIFrame" src="" width="100px" height="100px"></iframe>
-   <pre id="console"></pre>    
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (108831 => 108832)


--- trunk/Source/WebCore/ChangeLog	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/Source/WebCore/ChangeLog	2012-02-24 19:39:01 UTC (rev 108832)
@@ -1,3 +1,26 @@
+2012-02-24  Tim Horton  <[email protected]>
+
+        SVG should be supported in Dashboard compatibility mode
+        https://bugs.webkit.org/show_bug.cgi?id=78322
+        <rdar://problem/5861278>
+
+        Reviewed by Dean Jackson.
+
+        Enable SVG elements inside Dashboard, more or less reverting r21418.
+
+        Tests: http/tests/xmlhttprequest/svg-created-by-xhr-allowed-in-dashboard.html
+               svg/custom/embedded-svg-allowed-in-dashboard.xml
+               svg/custom/manually-parsed-embedded-svg-allowed-in-dashboard.html
+               svg/custom/manually-parsed-svg-allowed-in-dashboard.html
+               svg/custom/svg-allowed-in-dashboard-object.html
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        * dom/Document.cpp:
+        (WebCore::Document::importNode):
+        * dom/make_names.pl:
+        (printFactoryCppFile):
+
 2012-02-24  Min Qin  <[email protected]>
 
         Expose a setting to exempt media playback from user gesture requirement after a user gesture is initiated on loading/playing a media

Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (108831 => 108832)


--- trunk/Source/WebCore/dom/DOMImplementation.cpp	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp	2012-02-24 19:39:01 UTC (rev 108832)
@@ -399,14 +399,9 @@
         return TextDocument::create(frame, url);
 
 #if ENABLE(SVG)
-    if (type == "image/svg+xml") {
-#if ENABLE(DASHBOARD_SUPPORT)    
-        Settings* settings = frame ? frame->settings() : 0;
-        if (!settings || !settings->usesDashboardBackwardCompatibilityMode())
+    if (type == "image/svg+xml")
+        return SVGDocument::create(frame, url);
 #endif
-            return SVGDocument::create(frame, url);
-    }
-#endif
     if (isXMLMIMEType(type))
         return Document::create(frame, url);
 

Modified: trunk/Source/WebCore/dom/Document.cpp (108831 => 108832)


--- trunk/Source/WebCore/dom/Document.cpp	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/Source/WebCore/dom/Document.cpp	2012-02-24 19:39:01 UTC (rev 108832)
@@ -833,11 +833,7 @@
 {
     ec = 0;
     
-    if (!importedNode
-#if ENABLE(SVG) && ENABLE(DASHBOARD_SUPPORT)
-        || (importedNode->isSVGElement() && page() && page()->settings()->usesDashboardBackwardCompatibilityMode())
-#endif
-        ) {
+    if (!importedNode) {
         ec = NOT_SUPPORTED_ERR;
         return 0;
     }

Modified: trunk/Source/WebCore/dom/make_names.pl (108831 => 108832)


--- trunk/Source/WebCore/dom/make_names.pl	2012-02-24 19:35:27 UTC (rev 108831)
+++ trunk/Source/WebCore/dom/make_names.pl	2012-02-24 19:39:01 UTC (rev 108832)
@@ -848,7 +848,7 @@
 END
 ;
 
-if ($parameters{namespace} ne "HTML") {
+if ($parameters{namespace} ne "HTML" and $parameters{namespace} ne "SVG") {
 print F <<END
 #if ENABLE(DASHBOARD_SUPPORT)
     Settings* settings = document->settings();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to