diff --git a/intersection-observer/explicit-root-different-document.tentative.html b/intersection-observer/explicit-root-different-document.tentative.html new file mode 100644 index 00000000000000..15c5e620d5beaa --- /dev/null +++ b/intersection-observer/explicit-root-different-document.tentative.html @@ -0,0 +1,27 @@ +<!doctype html> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<link rel="help" href="https://github.com/w3c/IntersectionObserver/issues/457"> +<style> + div { + width: 100px; + height: 100px; + background: blue; + margin: 10px + } +</style> +<div id="root"></div> +<script> +let t = async_test("IntersectionObserver reports a (non-intersecting) entry if different-document from the doc"); +let doc = document.implementation.createHTMLDocument(""); +let target = doc.createElement("div"); +doc.body.appendChild(target); +new IntersectionObserver( + t.step_func_done(function(records) { + assert_equals(records.length, 1); + assert_false(records[0].isIntersecting); + }), + { root: document.querySelector("#root") } +).observe(target); +</script> diff --git a/intersection-observer/not-in-containing-block-chain.tentative.html b/intersection-observer/not-in-containing-block-chain.tentative.html new file mode 100644 index 00000000000000..4490d0b631ec2e --- /dev/null +++ b/intersection-observer/not-in-containing-block-chain.tentative.html @@ -0,0 +1,25 @@ +<!doctype html> +<meta name="viewport" content="width=device-width,initial-scale=1"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<link rel="help" href="https://github.com/w3c/IntersectionObserver/issues/457"> +<style> + div { + width: 100px; + height: 100px; + background: blue; + margin: 10px + } +</style> +<div id="target"></div> +<div id="root"></div> +<script> +let t = async_test("IntersectionObserver reports a (non-intersecting) entry even if not in the containing block chain"); +new IntersectionObserver( + t.step_func_done(function(records) { + assert_equals(records.length, 1); + assert_false(records[0].isIntersecting); + }), + { root: document.querySelector("#root") } +).observe(document.querySelector("#target")); +</script> diff --git a/intersection-observer/target-in-different-window.html b/intersection-observer/target-in-different-window.html index 645b7ec1908cc2..fcf5ba94372bea 100644 --- a/intersection-observer/target-in-different-window.html +++ b/intersection-observer/target-in-different-window.html @@ -1,5 +1,9 @@ <!DOCTYPE html> <meta name="viewport" content="width=device-width,initial-scale=1"> +<!-- + NOTE(emilio): This tests Chrome's behavior but it's not clear that's what the + spec asks for, see https://github.com/w3c/IntersectionObserver/issues/456 +--> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="./resources/intersection-observer-test-utils.js"></script>