Bug 1511569 [wpt PR 14316] - Test document.URL of <iframe src="javascript:...">, a=testonly
authorJeffrey Yasskin <jyasskin@gmail.com>
Thu, 31 Jan 2019 12:12:37 +0000
changeset 457747 6f5b6857d05659dddc0fa555824569fa4f5f52b5
parent 457746 3d56dbd3bb6e44afea8a5d2b8bd794edf3412330
child 457748 1c526e778f8c771acfa63261df043bf7534ec0d1
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1511569, 14316
milestone67.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 1511569 [wpt PR 14316] - Test document.URL of <iframe src="javascript:...">, a=testonly Automatic update from web-platform-tests Test document.URL of <iframe src="javascript:..."> The document.URL should be about:blank. Follows https://github.com/whatwg/html/pull/4205. -- wpt-commits: ed74c4f67f0529a7439f7b656ef0a35049873b9e wpt-pr: 14316
testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm
--- a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm
@@ -13,17 +13,18 @@
 
 <script>
 var test = async_test();
 var results = {};
 var expected = {
     ifr1:{url:"about:blank", sameDom: true},
     ifr2:{url:"about:blank", sameDom: true},
     ifr3:{url: location.href.replace(/\/[^\/]*$/, '/'), sameDom: true },
-    ifr4:{url:"about:blank", sameDom: true}
+    ifr4:{url:"about:blank", sameDom: true},
+    ifr5:{url:"about:blank", sameDom: true}
 }
 
 var js_url = 'javascript:"<html><script>var sameDom = false; try{var cn = top.document.body.className;sameDom = true;}catch(e){}; parent.postMessage( {url: document.URL, name: name, sameDom: sameDom}, \'*\')<\/script><body><p>JS-generated document</p></body></<html>";'
 window.addEventListener('message', function(e){
     var ifr = e.data.name;
     results[ifr] = e.data;
     test.step(function(){
         assert_equals(results[ifr].url, expected[ifr].url);
@@ -41,13 +42,20 @@ document.body.appendChild(ifr);
 window.onload = function () {
     for (var i = 0, frame, frames = document.getElementsByTagName('iframe'); frame = frames[i]; i++) {
         try{
             frame.src = js_url;
         }catch(e){
             results[frame.name] = 'Exception on setting!';
         }
     };
+
+    // An iframe with an initial src of a javascript: URL should also have a
+    // document URL of about:blank.
+    var ifr = document.createElement('iframe');
+    ifr.name = 'ifr5';
+    ifr.src = js_url;
+    document.body.appendChild(ifr);
 }
 
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>