Bug 1461947 [wpt PR 11030] - Add regression test for https://crbug.com/843523., a=testonly
authorarthursonzogni <arthursonzogni@chromium.org>
Wed, 06 Jun 2018 15:03:55 +0000
changeset 422165 07d83b88f14c04a441d97508fb326c704166a38d
parent 422164 80db9a7fe102c1165f7e75a024f0c7c41efbfc1e
child 422166 8d5c326135ff646f87807a876033cdbf65f137fb
push id34122
push userebalazs@mozilla.com
push dateMon, 11 Jun 2018 09:37:00 +0000
treeherdermozilla-central@9941eb8c3b29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1461947, 11030, 843523, 1057507, 1061456, 561916
milestone62.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 1461947 [wpt PR 11030] - Add regression test for https://crbug.com/843523., a=testonly Automatic update from web-platform-testsAdd regression test for https://crbug.com/843523. Test that document.querySelector(":target") works when called in the window.load event. This test is a subset of dom/nodes/Element-matches.html, the difference is that this test is more lightweight. It causes the window.load event to be sent earlier. There is a race condition. Currently, it will only work when FrameLoader::ProcessFragment is called before Document::ImplicitClose(). Probable fix: https://chromium-review.googlesource.com/c/chromium/src/+/1057507 Bug: 843523 Change-Id: Ibf7b0d7621b18c3dfefaaa323bbd335d86ce0652 Reviewed-on: https://chromium-review.googlesource.com/1061456 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#561916} -- wpt-commits: f73282e06fe91bd60e188f39887332c63e80a419 wpt-pr: 11030
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/dom/nodes/query-target-in-load-event.html
testing/web-platform/tests/dom/nodes/query-target-in-load-event.part.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -271016,16 +271016,21 @@
      {}
     ]
    ],
    "dom/nodes/productions.js": [
     [
      {}
     ]
    ],
+   "dom/nodes/query-target-in-load-event.part.html": [
+    [
+     {}
+    ]
+   ],
    "dom/nodes/selectors.js": [
     [
      {}
     ]
    ],
    "dom/ranges/Range-mutations.js": [
     [
      {}
@@ -326274,16 +326279,22 @@
     ]
    ],
    "dom/nodes/prepend-on-Document.html": [
     [
      "/dom/nodes/prepend-on-Document.html",
      {}
     ]
    ],
+   "dom/nodes/query-target-in-load-event.html": [
+    [
+     "/dom/nodes/query-target-in-load-event.html",
+     {}
+    ]
+   ],
    "dom/nodes/remove-unscopable.html": [
     [
      "/dom/nodes/remove-unscopable.html",
      {}
     ]
    ],
    "dom/nodes/rootNode.html": [
     [
@@ -554897,16 +554908,24 @@
   "dom/nodes/prepend-on-Document.html": [
    "5b4234a0f4b7c2f7cea65a247fd95bae2c5ca1aa",
    "testharness"
   ],
   "dom/nodes/productions.js": [
    "95e8bb10f9689dd94bf569de9ea3f555a6e9c6e2",
    "support"
   ],
+  "dom/nodes/query-target-in-load-event.html": [
+   "7cb88ea1331d59d3940e287538b49f9a5373be32",
+   "testharness"
+  ],
+  "dom/nodes/query-target-in-load-event.part.html": [
+   "f14a3463d2860c78b677f6f28b2f47e6942af125",
+   "support"
+  ],
   "dom/nodes/remove-unscopable.html": [
    "3825b5adbbd61c2eee537956079ec671e0d31911",
    "testharness"
   ],
   "dom/nodes/rootNode.html": [
    "9e57a68d7e39fcee75bdfb737de93bd6b6236b3a",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/query-target-in-load-event.html
@@ -0,0 +1,13 @@
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<iframe></iframe>
+
+<script>
+  let test = async_test('document.querySelector(":target") must work when called in the window.load event');
+  let iframe = document.querySelector("iframe");
+  window.addEventListener("message", test.step_func_done(event => {
+    assert_equals(event.data, "PASS");
+  }));
+  iframe.src = "./query-target-in-load-event.part.html#target";
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/query-target-in-load-event.part.html
@@ -0,0 +1,10 @@
+<!-- Used by ./query-target-in-load-event.html -->
+<script>
+  window.onload = function() {
+    let target = document.querySelector(":target");
+    let expected = document.querySelector("#target");
+    window.parent.postMessage(target == expected ? "PASS" : "FAIL", "*");
+  };
+</script>
+
+<div id="target"></div>