Bug 1382531 - Part 1: rewrite crashtest for data: URI is unique opaque origin. r=smaug
authorYoshi Huang <allstars.chh@mozilla.com>
Thu, 20 Jul 2017 14:33:15 +0800
changeset 419490 808600f024419fe90f24c9ace7c7cf65a4e31855
parent 419489 661014562d027e9040c8ca0bb6245b9de1614779
child 419491 49eda81bca010b3547f176538ed24d99f4115cb7
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1382531
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1382531 - Part 1: rewrite crashtest for data: URI is unique opaque origin. r=smaug
docshell/base/crashtests/432114-2.html
docshell/base/crashtests/file_432114-2.xhtml
dom/base/crashtests/504224.html
dom/base/crashtests/593302-1.html
dom/base/crashtests/851353-1.html
dom/base/crashtests/file_504224.html
dom/smil/crashtests/590425-1.html
editor/libeditor/crashtests/336081-1.xhtml
editor/libeditor/crashtests/382527-1.html
editor/libeditor/crashtests/382778-1.html
gfx/tests/crashtests/1343666.html
gfx/tests/crashtests/372094-1.xhtml
gfx/tests/crashtests/empty.html
js/xpconnect/crashtests/732870.html
js/xpconnect/crashtests/751995.html
js/xpconnect/crashtests/753162.html
js/xpconnect/crashtests/806751.html
js/xpconnect/crashtests/851418.html
js/xpconnect/crashtests/898939.html
layout/base/crashtests/606432-1.html
layout/base/crashtests/645572-1.html
layout/generic/crashtests/324318-1.html
layout/generic/crashtests/empty.html
layout/generic/crashtests/file_324318-1.html
layout/style/crashtests/592698-1.html
parser/htmlparser/tests/crashtests/445171-1-inner.svg
parser/htmlparser/tests/crashtests/file_445171-1.html
--- a/docshell/base/crashtests/432114-2.html
+++ b/docshell/base/crashtests/432114-2.html
@@ -4,13 +4,18 @@
 </head>
 <body>
 <script>
   window.addEventListener("DOMNodeRemoved", function() {
     setTimeout(function() {
       document.documentElement.removeAttribute("class");
     }, 0);
   });
+  var iframe = document.getElementById("content");
+  iframe.onload=function() {
+    dump("iframe onload\n");
+    console.log("iframe onload");
+  };
 </script>
-<iframe id="content" src="data:application/xhtml+xml;charset=utf-8,%3Chtml%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3E%0A%3Cframeset%20contenteditable%3D%22true%22/%3E%0A%3Cscript%3E%0Afunction%20doExecCommand%28%29%7B%0Adocument.execCommand%28%27formatBlock%27%2C%20false%2C%20%27p%27%29%3B%0A%7D%0AsetTimeout%28doExecCommand%2C100%29%3B%0Awindow.addEventListener%28%27DOMNodeRemoved%27%2C%20function%28%29%20%7Bwindow.frameElement.parentNode.removeChild%28window.frameElement%29%3B%7D%2C%20true%29%3B%0A%3C/script%3E%0A%3C/html%3E" style="width:1000px;height: 200px;"></iframe>
+<iframe id="content" src="file_432114-2.xhtml" style="width:1000px;height: 200px;"></iframe>
 
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/docshell/base/crashtests/file_432114-2.xhtml
@@ -0,0 +1,1 @@
+<html xmlns='http://www.w3.org/1999/xhtml'><frameset contenteditable='true'/><script>function doExecCommand(){dump("doExecCommand\n");document.execCommand('formatBlock', false, 'p');}setTimeout(doExecCommand,100); window.addEventListener('DOMNodeRemoved', function() {window.frameElement.parentNode.removeChild(window.frameElement);}, true);</script></html>
--- a/dom/base/crashtests/504224.html
+++ b/dom/base/crashtests/504224.html
@@ -1,22 +1,23 @@
 <html class="reftest-wait">
 <head>
 <title>Crash [@ nsFocusManager::GetCommonAncestor], part 2</title>
 </head>
 <body>
-<iframe src="data:text/html;charset=utf-8,%3Chtml%3E%3Chead%3E%3C/head%3E%0A%3Cbody%20onunload%3D%22window.frameElement.parentNode.removeChild%28window.frameElement%29%22%20tabindex%3D%221%22%3E%0A%3Cscript%3E%0Adocument.body.focus%28%29%3B%0A%3C/script%3E%0A%3C/body%3E%0A%3C/html%3E" id="content"></iframe>
+<iframe src="file_504224.html" id="content"></iframe>
 <script>
 var src=document.getElementById('src');
 setInterval(function() {
   if (!document.getElementById('content')) {
     var x=document.createElement('iframe');
     x.src=src;
     x.id = 'content';
     document.body.appendChild(x);
     setTimeout(function() { window.focus(); document.documentElement.removeAttribute('class'); }, 100);
-  } else
+  } else {
     window.frames[0].location.reload();
+  }
 }, 500);
 </script>
 </body>
 </html>
 
--- a/dom/base/crashtests/593302-1.html
+++ b/dom/base/crashtests/593302-1.html
@@ -19,11 +19,11 @@
         s.id = i;
         return s;
       }
 
       function remove(n)    { n.remove(); }
     </script>
   </head>
   <body onload="boom();">
-    <iframe id="iframe" src="data:text/html,S"></iframe>
+    <iframe id="iframe" srcdoc="<html>S</html>"></iframe>
   </body>
 </html>
--- a/dom/base/crashtests/851353-1.html
+++ b/dom/base/crashtests/851353-1.html
@@ -15,11 +15,11 @@
             }
 
             doc.open();
             setTimeout(runnable, 0);
         }
     </script>
 </head>
 <body onload='start()'>
-    <iframe src="data:text/html,<meta charset=UTF-8><body><video src=http://localhost:8080/ controls=true loop=true autoplay=true autobuffer=false></video>"></iframe>
+    <iframe srcdoc="<body><video src=http://localhost:8080/ controls=true loop=true autoplay=true autobuffer=false></video>"></iframe>
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/dom/base/crashtests/file_504224.html
@@ -0,0 +1,7 @@
+<html><head></head>
+  <body onunload="window.frameElement.parentNode.removeChild(window.frameElement)" tabindex="1">
+  <script>
+document.body.focus();
+  </script>
+  </body>
+</html>
--- a/dom/smil/crashtests/590425-1.html
+++ b/dom/smil/crashtests/590425-1.html
@@ -13,12 +13,12 @@ function boom()
   document.documentElement.removeAttribute("class");
 }
 
 </script>
 </head>
 
 <body onload="boom()">
 
-<iframe id="frame" src="data:text/html,%3Cbody%3E%3Csvg id=s%3E"></iframe>
+<iframe id="frame" srcdoc="<body><svg id=s>"></iframe>
 
 </body>
 </html>
--- a/editor/libeditor/crashtests/336081-1.xhtml
+++ b/editor/libeditor/crashtests/336081-1.xhtml
@@ -34,19 +34,19 @@ function init()
 }
 
 ]]>
 </script>
 </head>
 
 <body onload="init()">
 
-<iframe src="data:text/html," style="width: 95%; height: 500px;"/>
+<iframe srcdoc="<html></html>" style="width: 95%; height: 500px;"/>
 
 <div id="rootish">
 <div id="out1"/>
 <div id="in1"/>
 <div id="in2"/>
 <div id="out2"/>
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>
--- a/editor/libeditor/crashtests/382527-1.html
+++ b/editor/libeditor/crashtests/382527-1.html
@@ -2,17 +2,17 @@
 <html class="reftest-wait">
 <head>
 <script>
 
 
 function init1()
 {
   targetIframe = document.createElementNS('http://www.w3.org/1999/xhtml', 'iframe');
-  targetIframe.src = "data:text/html,";
+  targetIframe.srcdoc = "<html></html>";
   targetIframe.setAttribute("style", "width: 300px; height: 200px; border: 1px dotted green;");
   targetIframe.addEventListener("load", init2);
   document.body.appendChild(targetIframe);
 }
 
 
 function init2()
 {
--- a/editor/libeditor/crashtests/382778-1.html
+++ b/editor/libeditor/crashtests/382778-1.html
@@ -2,17 +2,17 @@
 <html class="reftest-wait">
 <head>
 <script>
 
 function init1()
 {
   // Create an html:iframe in HTML mode (so designMode can be used 320092)
   targetIframe = document.createElementNS('http://www.w3.org/1999/xhtml', 'iframe');
-  targetIframe.src = "data:text/html,";
+  targetIframe.srcdoc = "<html></html>";
   targetIframe.setAttribute("style", "width: 700px; height: 500px; border: 1px dotted green;");
   targetIframe.addEventListener("load", init2);
   document.body.appendChild(targetIframe);
 }
 
 
 function init2()
 {
--- a/gfx/tests/crashtests/1343666.html
+++ b/gfx/tests/crashtests/1343666.html
@@ -4,17 +4,17 @@
 <script>
 
 function f()
 {
     finish();
 }
 
 window.onload = function() {
-  let a = window.open("data:text/plain,test", null, "width=300,height=300");
+  let a = window.open("empty.html", null, "width=300,height=300");
   setTimeout(function(){
     a.close();
     a.addEventListener("vrdisplayconnect", function(){});
     window.close();
     document.documentElement.removeAttribute("class");
   }, 0);
 };
 
--- a/gfx/tests/crashtests/372094-1.xhtml
+++ b/gfx/tests/crashtests/372094-1.xhtml
@@ -28,18 +28,18 @@ function boom()
 }
 
 ]]>
 </script>
 </head>
 
 <body onload="init()">
 
-<iframe src="data:text/html," style="width: 95%; height: 500px;"/>
+  <iframe srcdoc="<html></html>" style="width: 95%; height: 500px;"/>
 
 <div id="rootish">
   <div>Foo</div>
   <div id="bar">Bar</div>
   <div><select><option id="baz">baz</option></select></div>
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>
new file mode 100644
--- /dev/null
+++ b/gfx/tests/crashtests/empty.html
@@ -0,0 +1,1 @@
+test
--- a/js/xpconnect/crashtests/732870.html
+++ b/js/xpconnect/crashtests/732870.html
@@ -13,11 +13,11 @@ function boom()
   frameDoc.close();
   document.documentElement.removeAttribute("class");
 }
 
 </script>
 </head>
 
 <body onload="boom();">
-<iframe id="f" src="data:text/html,1"></iframe>
+<iframe id="f" srcdoc="<html>1</html>"></iframe>
 </body>
 </html>
--- a/js/xpconnect/crashtests/751995.html
+++ b/js/xpconnect/crashtests/751995.html
@@ -27,10 +27,10 @@ function boom()
   frameDoc().write("2");
 
   // All done.
   document.documentElement.removeAttribute("class");
 }
 
 </script>
 </head>
-<body onload="boom();"><iframe id="f" src="data:text/html,1"></iframe></body>
+<body onload="boom();"><iframe id="f" srcdoc="1"></iframe></body>
 </html>
--- a/js/xpconnect/crashtests/753162.html
+++ b/js/xpconnect/crashtests/753162.html
@@ -14,10 +14,10 @@ function boom()
   };
   frameDoc.addEventListener("DOMAttrModified", f);
   frameDoc.write("<html d>");
 }
 
 </script>
 </head>
 
-<body onload="boom();"><iframe id="f" src="data:text/html,1"></iframe></body>
+<body onload="boom();"><iframe id="f" srcdoc="1"></iframe></body>
 </html>
--- a/js/xpconnect/crashtests/806751.html
+++ b/js/xpconnect/crashtests/806751.html
@@ -16,11 +16,11 @@ function boom()
 function finish() {
   document.documentElement.removeAttribute('class');
 }
 
 </script>
 </head>
 
 <body onload="boom();">
-<iframe id="frame" src="data:text/html,1"></iframe>
+<iframe id="frame" srcdoc="1"></iframe>
 </body>
 </html>
--- a/js/xpconnect/crashtests/851418.html
+++ b/js/xpconnect/crashtests/851418.html
@@ -13,11 +13,11 @@ function boom()
   frameRoot.onload;
   document.documentElement.removeAttribute("class");
 }
 
 </script>
 </head>
 
 <body onload="boom();">
-<iframe id="f" src="data:text/html,1"></iframe>
+<iframe id="f" srcdoc="1"></iframe>
 </body>
 </html>
--- a/js/xpconnect/crashtests/898939.html
+++ b/js/xpconnect/crashtests/898939.html
@@ -8,11 +8,11 @@ function boom()
 {
   document.documentElement.appendChild(document.getElementById("f").contentDocument.getElementById("m"));
   document.documentElement.removeAttribute("class");
 }
 
 </script>
 </head>
 <body onload="boom();">
-<iframe id="f" src="data:text/html;charset=UTF-8,<!DOCTYPE html><body><marquee id=m>"></iframe>
+<iframe id="f" srcdoc="<!DOCTYPE html><body><marquee id=m>"></iframe>
 </body>
 </html>
--- a/layout/base/crashtests/606432-1.html
+++ b/layout/base/crashtests/606432-1.html
@@ -15,10 +15,10 @@ function boom()
 function finish()
 {
   document.documentElement.className = "";
 }
 
 </script>
 </head>
 
-<body onload="setTimeout(boom, 200);"><iframe id="f" src="data:application/xhtml+xml,<html xmlns='http://www.w3.org/1999/xhtml'></html>"></iframe></body>
+<body onload="setTimeout(boom, 200);"><iframe id="f" srcdoc="<html xmlns='http://www.w3.org/1999/xhtml'></html>"></iframe></body>
 </html>
--- a/layout/base/crashtests/645572-1.html
+++ b/layout/base/crashtests/645572-1.html
@@ -13,17 +13,17 @@ function start(){
         tmp.id='ifr42257';
         o230.ownerDocument.documentElement.appendChild(tmp); 
         start_dataiframe11();
         //window.setTimeout('start_dataiframe11()',100);
 }function start_dataiframe11(){
         o232=o230.ownerDocument.getElementById('ifr42257').contentDocument.documentElement;
         o234=o196;
         tmp=o234.ownerDocument.createElement('iframe');
-        tmp.src='data:text/html,' + escape("<q id='element2'><q id='element3'><q id='element4'><dd style id='element6'>");
+        tmp.srcdoc="<q id='element2'><q id='element3'><q id='element4'><dd style id='element6'>";
         tmp.id='ifr22371';
         tmp.addEventListener("load", start_dataiframe12);
         o234.ownerDocument.documentElement.appendChild(tmp);
 }function start_dataiframe12(){
         o239=o234.ownerDocument.getElementById('ifr22371').contentDocument.getElementById('element2');
         o240=o234.ownerDocument.getElementById('ifr22371').contentDocument.getElementById('element3');
         o241=o234.ownerDocument.getElementById('ifr22371').contentDocument.getElementById('element4');
         o243=o234.ownerDocument.getElementById('ifr22371').contentDocument.getElementById('element6');
--- a/layout/generic/crashtests/324318-1.html
+++ b/layout/generic/crashtests/324318-1.html
@@ -19,11 +19,11 @@ function init() {
 }
 
 window.addEventListener("load", init);
 document.documentElement.setAttribute("class", "reftest-wait");
 
 </script>
 
 <frameset resizable="yes" rows="50%,*">
- <frame name="one" src="data:text/html,<table border='1'><tr><td>tdc</td></tr></table>">
- <frame name="two" src="data:text/html,">
+ <frame name="one" src="file_324318-1.html">
+ <frame name="two" src="empty.html">
 </frameset>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/empty.html
@@ -0,0 +1,1 @@
+<html></html>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/file_324318-1.html
@@ -0,0 +1,1 @@
+<table border='1'><tr><td>tdc</td></tr></table>
--- a/layout/style/crashtests/592698-1.html
+++ b/layout/style/crashtests/592698-1.html
@@ -1,12 +1,12 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
   <iframe id="x"
-          src="data:text/html;charset=utf-8,%3Cdiv%20id%3D%22a%22%3Eaaa"></iframe>
+          srcdoc="<div id='a'>aaa"></iframe>
 
   <script>
     window.onload = function() {
       window.frames[0].document.getElementById("a").setAttribute("style",
         '-moz-transition-property: color;' +
         '-moz-transition-duration: 10s;' +
         'transition-property: color;' +
         'transition-duration: 10s; ' +
--- a/parser/htmlparser/tests/crashtests/445171-1-inner.svg
+++ b/parser/htmlparser/tests/crashtests/445171-1-inner.svg
@@ -1,5 +1,5 @@
-<svg xmlns="http://www.w3.org/2000/svg" onload="location = 'data:text/html,&lt;script&gt;parent.done()&lt;/script&gt;';">
+<svg xmlns="http://www.w3.org/2000/svg" onload="location = 'file_445171-1.html'">
 
 <rect x="5" y="5" width="50" height="50" />
 
 </svg>
new file mode 100644
--- /dev/null
+++ b/parser/htmlparser/tests/crashtests/file_445171-1.html
@@ -0,0 +1,1 @@
+<script>parent.done()</script>