Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1670327] Fix more IntersectionObserver issues. #26215

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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>
25 changes: 25 additions & 0 deletions intersection-observer/not-in-containing-block-chain.tentative.html
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 4 additions & 0 deletions intersection-observer/target-in-different-window.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down