Bug 1364369 - update more files to use srcdoc attr. r=smaug
authorYoshi Huang <allstars.chh@mozilla.com>
Wed, 10 May 2017 14:51:34 +0800
changeset 406681 f7e2f109410ea4cc478b5433e7bbebdb080ba076
parent 406680 5cef191f7d10d22597d4696535e5b8b3426cc18f
child 406682 1e29842a2984d48c940507402053f5c16066196f
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1364369
milestone55.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 1364369 - update more files to use srcdoc attr. r=smaug
dom/base/test/PASS.html
dom/base/test/mochitest.ini
dom/base/test/test_bug622088.html
dom/base/test/test_bug622117.html
dom/base/test/test_bug622246.html
dom/base/test/test_bug626262.html
dom/base/test/test_bug656283.html
dom/base/test/test_bug682592.html
dom/base/test/test_getTranslationNodes.html
dom/base/test/test_gsp-qualified.html
dom/base/test/test_navigator_language.html
dom/base/test/test_reentrant_flush.html
dom/base/test/test_user_select.html
dom/base/test/test_xbl_userdata.xhtml
dom/html/test/test_bug765780.html
dom/html/test/test_documentAll.html
new file mode 100644
--- /dev/null
+++ b/dom/base/test/PASS.html
@@ -0,0 +1,1 @@
+PASS
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -240,16 +240,17 @@ support-files =
   iframe6_bug431701.xml
   iframe7_bug431701.xml
   iframe1_bug426646.html
   iframe2_bug426646.html
   file1_setting_opener.html
   file2_setting_opener.html
   file3_setting_opener.html
   file4_setting_opener.html
+  PASS.html
 
 [test_anchor_area_referrer.html]
 [test_anchor_area_referrer_changing.html]
 [test_anchor_area_referrer_invalid.html]
 [test_anchor_area_referrer_rel.html]
 [test_anonymousContent_api.html]
 [test_anonymousContent_append_after_reflow.html]
 [test_anonymousContent_canvas.html]
--- a/dom/base/test/test_bug622088.html
+++ b/dom/base/test/test_bug622088.html
@@ -7,17 +7,17 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=622088">Mozilla Bug 622088</a>
 <pre id="test">
 
 <iframe id='iframe' src='file_bug622088_inner.html'></iframe>
 
-<iframe id='dataWindow' src="data:text/html,<html><head>
+<iframe id='dataWindow' srcdoc="<html><head>
 <script>function getXHRObject() { return new XMLHttpRequest(); }</script>
 </head><body onload='parent.dataWindowLoaded()'>Hello!!</body></html>"></iframe>
 
 <script class="testbody" type="application/javascript">
 
 // Bug 622088 - Test that XHR gives the referrer corresponding to the
 // dynamic script context.
 
--- a/dom/base/test/test_bug622117.html
+++ b/dom/base/test/test_bug622117.html
@@ -8,33 +8,33 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=622117">Mozilla Bug 622117</a>
 <p id="display">
   <iframe id="testframe"
-          src="data:text/html,<a href='data:text/plain,PASS' onclick='throw 1'>Click me</a>">
+          srcdoc="<a href='PASS.html' onclick='throw 1'>Click me</a>">
   </iframe>
 </p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 622117 **/
 SimpleTest.waitForExplicitFinish();
 
 const PASSURL = "data:text/plain,PASS";
 
 SimpleTest.waitForFocus(function() {
   $("testframe").onload = function() {
-    is(this.contentDocument.documentElement.textContent, "PASS", "Should have loaded link");
+    is(this.contentDocument.documentElement.innerText, "PASS", "Should have loaded link");
     SimpleTest.finish();
   };
 
   var win = $("testframe").contentWindow;
   var a = win.document.getElementsByTagName("a")[0];
   synthesizeMouseAtCenter(a, {}, win);
 });
 </script>
--- a/dom/base/test/test_bug622246.html
+++ b/dom/base/test/test_bug622246.html
@@ -8,33 +8,31 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=622246">Mozilla Bug 622246</a>
 <p id="display">
   <iframe id="testframe"
-          src="data:text/html,<span onclick='this.parentNode.removeChild(this)'><a href='data:text/plain,PASS'>Click me</a></span>">
+          srcdoc="<span onclick='this.parentNode.removeChild(this)'><a href='PASS.html'>Click me</a></span>">
   </iframe>
 </p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 622246 **/
 SimpleTest.waitForExplicitFinish();
 
-const PASSURL = "data:text/plain,PASS";
-
 SimpleTest.waitForFocus(function() {
   $("testframe").onload = function() {
-    is(this.contentDocument.documentElement.textContent, "PASS", "Should have loaded link");
+    is(this.contentDocument.documentElement.innerText, "PASS", "Should have loaded link");
     SimpleTest.finish();
   };
 
   var win = $("testframe").contentWindow;
   var a = win.document.getElementsByTagName("a")[0];
   synthesizeMouseAtCenter(a, {}, win);
 });
 </script>
--- a/dom/base/test/test_bug626262.html
+++ b/dom/base/test/test_bug626262.html
@@ -5,17 +5,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 <head>
   <title>Test for Bug 626262</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=626262">Mozilla Bug 626262</a>
-<p id="display"><iframe id="f" src="data:text/html,1"></iframe></p>
+<p id="display"><iframe id="f" srcdoc="1"></iframe></p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 626262 **/
 SimpleTest.waitForExplicitFinish();
--- a/dom/base/test/test_bug656283.html
+++ b/dom/base/test/test_bug656283.html
@@ -18,33 +18,32 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
 
 /** Test for Bug 656283 **/
 
 SimpleTest.waitForExplicitFinish();
 
 var ifr;
 function test() {
-  // First a test with data documents.
   var d = document.implementation.createHTMLDocument("");
   is(d.activeElement, d.body, "Active element should be body by default! (1)");
  
 
   ifr = document.getElementById("ifr");
   ifr.onload = test2;
-  ifr.src = "data:text/html,1";
+  ifr.srcdoc = "1";
 }
 
 var firstDoc;
 function test2() {
   firstDoc = ifr.contentDocument;
   is(firstDoc.activeElement, firstDoc.body,
      "Active element should be body by default! (2)");
   ifr.onload = test3;
-  ifr.src = "data:text/html,<input>";
+  ifr.srcdoc = "<input>";
 }
 
 function test3() {
   ifr.contentDocument.getElementsByTagName("input")[0].focus();
   is(firstDoc.activeElement, firstDoc.body,
      "Active element should be body by default! (3)");
   ifr.remove();
   is(firstDoc.activeElement, firstDoc.body,
--- a/dom/base/test/test_bug682592.html
+++ b/dom/base/test/test_bug682592.html
@@ -39,37 +39,37 @@ https://bugzilla.mozilla.org/show_bug.cg
 */
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestLongerTimeout(3);
 if (navigator.platform.startsWith("Linux arm")) { /* bugs 982875, 999429 */
   SimpleTest.expectAssertions(0, 4);
 }
 
-var page = `data:text/html;charset=UTF-8,<!DOCTYPE html>
-<html><body><p id="content"></p></body></html>`;
+var page = `<!DOCTYPE html>
+<html><meta charset='UTF-8'><body><p id="content"></p></body></html>`;
 var refFrame = document.getElementById("iframe-ref")
 var testFrame = document.getElementById("iframe-test");
 
 refFrame.addEventListener("load", function() {
   testFrame.addEventListener("load", function() {
     let {done} = tests.next();
     if (!done) {
       ok(compareSnapshots(snapshotWindow(testFrame.contentWindow), 
                           snapshotWindow(refFrame.contentWindow), true)[0], 
          "bidi is not detected correctly");
 
       testFrame.contentWindow.location.reload();
     } else {
       SimpleTest.finish();
     }
   });
-  testFrame.src = page;
+  testFrame.srcdoc = page;
 });
-refFrame.src = page;
+refFrame.srcdoc = page;
 
 var rtl = "עִבְרִית";
 var non8bit =  "ʃ";
 var is8bit = "a";
 
 // concats aStr aNumber of times
 function strMult(aStr, aNumber) {
   if (aNumber === 0) {
--- a/dom/base/test/test_getTranslationNodes.html
+++ b/dom/base/test/test_getTranslationNodes.html
@@ -188,17 +188,17 @@
      expected="div[root]">
   <div>
     Lorem Ipsum
     <noscript>Lorem Ipsum</noscript>
     <style>.dummyClass { color: blue; }</style>
     <script> /* script tag */ </script>
     <code> code </code>
     <iframe id="testiframe"
-            src="data:text/html,<div>Lorem ipsum</div>">
+            srcdoc="<div>Lorem ipsum</div>">
     </iframe>
     <svg>lorem</svg>
     <math>ipsum</math>
   </div>
 </div>
 
 <!-- Test that nesting of inline elements won't produce roots as long as
      the parents are in the list of translation nodes -->
--- a/dom/base/test/test_gsp-qualified.html
+++ b/dom/base/test/test_gsp-qualified.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug 799875</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=799875">Mozilla Bug 799875</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-  <iframe src="data:text/html,<div id='test2'>"></iframe>
+  <iframe srcdoc="<div id='test2'>"></iframe>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 799875 **/
 SimpleTest.waitForExplicitFinish();
 
 addLoadEvent(function() {
--- a/dom/base/test/test_navigator_language.html
+++ b/dom/base/test/test_navigator_language.html
@@ -183,17 +183,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
     genChanges.next();
   });
 
   // Check that there is no crash when a change happen after a window listening
   // to them is killed.
   tests.push(function testThatAddingAnEventDoesNotHaveSideEffects() {
     var frame = document.createElement('iframe');
-    frame.src = 'data:text/html,<script>window.onlanguagechange=function(){}<\/script>';
+    frame.srcdoc = '<script>window.onlanguagechange=function(){}<\/script>';
     document.body.appendChild(frame);
 
     frame.contentWindow.onload = function() {
       document.body.removeChild(frame);
       frame = null;
 
       SpecialPowers.exactGC(function() {
         // This should not crash.
--- a/dom/base/test/test_reentrant_flush.html
+++ b/dom/base/test/test_reentrant_flush.html
@@ -7,17 +7,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug 709256</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=709256">Mozilla Bug 709256</a>
 <p id="display">
 <iframe id="test"
-        style="width: 100px" src="data:text/html,<body style='width: 100%'>">
+        style="width: 100px" srcdoc="<body style='width: 100%'>">
 </iframe>
 </p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
--- a/dom/base/test/test_user_select.html
+++ b/dom/base/test/test_user_select.html
@@ -43,17 +43,17 @@ bbbb</div>
 <div class="non-selectable">x</div>
 <div class="non-selectable">x</div>
 <div class="non-selectable">x</div>
 bbbb</div>
 <div id="testH" style="white-space:pre">aaaa
 <div class="non-selectable">x</div><input>
 bbbbbbb</div>
 
-<iframe id="testD" src="data:text/html,<body>aaaa<span style='-moz-user-select:none'>bbbb</span>cccc"></iframe>
+<iframe id="testD" srcdoc="<body>aaaa<span style='-moz-user-select:none'>bbbb</span>cccc"></iframe>
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function test()
 {
   function clear(w)
   {
--- a/dom/base/test/test_xbl_userdata.xhtml
+++ b/dom/base/test/test_xbl_userdata.xhtml
@@ -23,25 +23,24 @@
 <body>
 <p id="display"></p>
 
 <pre id="test">
 <script class="testbody">
 <![CDATA[
 "use strict";
 
-var url = 'data:text/html;charset=utf-8,' +
-          encodeURIComponent('<div id=t style="-moz-binding:url(' + location + '#xbl)"></div>');
+var url = '<div id=t style="-moz-binding:url(' + location + '#xbl)"></div>';
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(test1);
 
 function test1() {
   var iframe = document.createElement('iframe');
-  iframe.src = url;
+  iframe.srcdoc = url;
   iframe.onload = function() {
     var t = iframe.contentWindow.t;
     is(!!(t.getUserData || t.setUserData), false,
        "getUserData and setUserData should not be visible from the regular content");
     is(t.textContent, "true",
        "getUserData and setUserData should be visible from XBL");
     document.body.removeChild(iframe);
     SimpleTest.finish();
--- a/dom/html/test/test_bug765780.html
+++ b/dom/html/test/test_bug765780.html
@@ -32,15 +32,15 @@ https://bugzilla.mozilla.org/show_bug.cg
 
       SimpleTest.finish();
     }
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=765780">Mozilla Bug 765780</a>
 <!-- Important: iframe needs to not be display: none -->
-<p id="display"><iframe id="f" src="data:text/html,<iframe></iframe>"></iframe> </p>
+<p id="display"><iframe id="f" srcdoc="<iframe></iframe>"></iframe> </p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 </pre>
 </body>
 </html>
--- a/dom/html/test/test_documentAll.html
+++ b/dom/html/test/test_documentAll.html
@@ -17,17 +17,17 @@ Tests for document.all
 <div id="content" style="display: none">
   <a id="id1">A</a>
   <a id="id2">B</a>
   <a id="id2">C</a>
   <a id="id3">D</a>
   <a id="id3">E</a>
   <a id="id3">F</a>
 </div>
-<iframe id="subframe" src="data:text/html,<span id='x'></span>"
+<iframe id="subframe" srcdoc="<span id='x'></span>"
         style="display: none"></iframe>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 p = document.getElementById("content");
 
 // Test that several elements with the same id or name behave correctly
 function testNumSame() {