Adding reftest for null rootElement
authorjwatt@jwatt.org
Mon, 26 Mar 2007 08:35:35 -0700
changeset 104 cdc3f1d3d82d887326f1863e581ddebed67a37ae
parent 103 726e34033b2fcb3cdbaf4cc187411684f17573ba
child 105 abd67b388ee2b3ab763d1d0c9e65c1a409b04fad
push idunknown
push userunknown
push dateunknown
milestone1.9a4pre
Adding reftest for null rootElement
layout/reftests/svg/reftest.list
layout/reftests/svg/rootElement-null-01.svg
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -1,9 +1,10 @@
 
 == foreignObject-display-01.svg pass.svg
 == getElementById-a-element-01.svg pass.svg
 == opacity-and-gradient-01.svg pass.svg
 == pseudo-classes-01.svg pass.svg
 == pseudo-classes-02.svg pseudo-classes-02-ref.svg
 == rect-with-rx-or-ry-01.svg rect-with-rx-or-ry-01-ref.svg
+== rootElement-null-01.svg pass.svg
 == stroke-width-percentage-01.svg pass.svg
 == text-in-link-01.svg text-in-link-01-ref.svg
new file mode 100755
--- /dev/null
+++ b/layout/reftests/svg/rootElement-null-01.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
+     onload="handleLoad(evt);">
+
+  <title>Testcase for accessing null rootContent</title>
+
+  <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=365611 -->
+
+  <script type="application/ecmascript">
+  <![CDATA[
+
+function handleLoad(event)
+{
+  var root = document.removeChild(document.rootElement);
+  if (document.rootElement == null) { // this shouldn't crash
+    document.appendChild(root);
+    document.getElementById('rect').setAttribute('fill', 'lime');
+  }
+}
+
+  ]]>
+  </script>
+
+  <rect id="rect" width="100%" height="100%" fill="red"/>
+
+</svg>