Bug 1390777 - Use srcdoc to replace src=data:xxx whenever possible. draft
authorHenry Chang <hchang@mozilla.com>
Thu, 17 Aug 2017 16:00:29 +0800
changeset 648095 6cfc1d5b9f308a1a34915be5e6f4d51d41c78d2a
parent 647817 63ca686c3f1e870649b6d9c559973d100573aec2
child 726705 8d2aecd43a38dc7de1a77d2950594aaf40ef718e
push id74624
push userhchang@mozilla.com
push dateThu, 17 Aug 2017 08:01:11 +0000
bugs1390777
milestone57.0a1
Bug 1390777 - Use srcdoc to replace src=data:xxx whenever possible. MozReview-Commit-ID: 1FeRTmZv46N
dom/html/test/file_fullscreen-api.html
dom/html/test/file_fullscreen-plugins.html
--- a/dom/html/test/file_fullscreen-api.html
+++ b/dom/html/test/file_fullscreen-api.html
@@ -32,17 +32,17 @@ function is(a, b, msg) {
 
 /*
 <html>
   <body onload='document.body.requestFullscreen();'>
   <iframe id='inner-frame'></iframe>
   </body>
 </html>
 */
-var iframeContents = "data:text/html;charset=utf-8,<html><body onload%3D'parent.SimpleTest.waitForFocus(function(){document.body.requestFullscreen();});'><iframe id%3D'inner-frame'><%2Fiframe><%2Fbody><%2Fhtml>";
+var iframeContents = "<html><body onload='parent.SimpleTest.waitForFocus(function(){document.body.requestFullscreen();});'><iframe id='inner-frame'></iframe></body></html>";
 
 var iframe = null;
 var outOfDocElement = null;
 var inDocElement = null;
 var container = null;
 var button = null;
 
 
@@ -74,17 +74,17 @@ function enter1(event) {
 function exit1(event) {
   is(event.target, document, "Event target should be full-screen document #2");
   ok(!document.fullscreen, "Document should not be in fullscreen");
   is(document.fullscreenElement, null, "Full-screen element should be null.");
   iframe = document.createElement("iframe");
   iframe.allowFullscreen = true;
   addFullscreenChangeContinuation("enter", enter2);
   document.body.appendChild(iframe);
-  iframe.src = iframeContents;
+  iframe.srcdoc = iframeContents;
 }
 
 function enter2(event) {
   is(event.target, document, "Event target should be full-screen document #3");
   is(document.fullscreenElement, iframe,
      "Full-screen element should be iframe element.");
   is(iframe.contentDocument.fullscreenElement, iframe.contentDocument.body,
      "Full-screen element in subframe should be body");
--- a/dom/html/test/file_fullscreen-plugins.html
+++ b/dom/html/test/file_fullscreen-plugins.html
@@ -39,17 +39,17 @@ Test plugins with DOM full-screen API:
 
 
 <!-- iframe contents:
 
 <html><body><embed id='windowed-plugin' type='application/x-test' style='width:200px;height:100px;' wmode='window'></embed></body></html>
 
 -->
 
-<iframe id="subdoc-plugin" src="data:text/html;charset=utf-8,<html><body><embed id%3D'windowed-plugin' type%3D'application%2Fx-test' style%3D'width%3A200px%3Bheight%3A100px%3B' wmode%3D'window'><%2Fembed><%2Fbody><%2Fhtml>%0D%0A"></iframe>
+<iframe id="subdoc-plugin" srcdoc="<html><body><embed id='windowed-plugin' type='application/x-test' style='width:200px;height:100px;' wmode='window'></embed></body></html>"></iframe>
 
 <script type="application/javascript">
 
 /** Test for Bug 545812 **/
 
 function ok(condition, msg) {
   opener.ok(condition, "[plugins] " + msg);
 }