gecko-dev/testing/web-platform/tests/dom/nodes/query-target-in-load-event.part.html
arthursonzogni fc994b4168 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
2018-06-10 09:27:56 +01:00

10 lines
311 B
HTML

<!-- 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>