-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1670327 - Fix more IntersectionObserver issues. r=hiro
Two spec issues here. w3c/IntersectionObserver#457: I think this is just a spec bug and I've made us match other browsers, but since the tests don't match the spec for now I've added them as .tentative.html w3c/IntersectionObserver#456: I've aligned with WebKit here. There was a (disabled) test for this which tests chrome behavior and which after this patch shouldn't be flaky. This is what was causing the assertion. Differential Revision: https://phabricator.services.mozilla.com/D93166
- Loading branch information
Showing
6 changed files
with
105 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
testing/web-platform/meta/intersection-observer/target-in-different-window.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[target-in-different-window.html] | ||
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1497420 | ||
bug: https://github.com/w3c/IntersectionObserver/issues/456 | ||
[IntersectionObserver with target in a different window.] | ||
expected: FAIL |
27 changes: 27 additions & 0 deletions
27
.../web-platform/tests/intersection-observer/explicit-root-different-document.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
...ing/web-platform/tests/intersection-observer/not-in-containing-block-chain.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
4
testing/web-platform/tests/intersection-observer/target-in-different-window.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters