-
Notifications
You must be signed in to change notification settings - Fork 532
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
Spec doesn't reflect reality wrt explicit roots. #457
Comments
Similar issue with step 2.2:
<!doctype html>
<style>
div {
width: 100px;
height: 100px;
background: blue;
margin: 10px
}
</style>
<div id="root"></div>
<script>
let doc = document.implementation.createHTMLDocument("");
let target = doc.createElement("div");
doc.body.appendChild(target);
new IntersectionObserver(
function() {
console.log(arguments);
},
{ root: document.querySelector("#root") }
).observe(target);
</script> |
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
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
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
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
My preference would be to make the blink/webkit behavior official. I think it's useful to send the "not intersecting" notification when a target is removed from the containing block chain. @emilio What do you think? |
Yes, I tend to agree. I aligned Gecko with WebKit/Blink in https://bugzilla.mozilla.org/show_bug.cgi?id=1670327. |
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 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1670327 gecko-commit: 2906a77771b3abcc15c2859052c0d170b263133d gecko-reviewers: 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 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1670327 gecko-commit: 2906a77771b3abcc15c2859052c0d170b263133d gecko-reviewers: hiro
This test-case:
In Gecko it doesn't queue any entry. I believe this is correct per https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo:
I don't think that matches Blink or WebKit though, which just report a non-intersecting entry. I think it's also a bug in the spec, because per that reasoning
display: none
elements etc wouldn't get reported even if they're dom descendants of the root.cc @szager-chromium
The text was updated successfully, but these errors were encountered: