w3c / IntersectionObserver

Intersection Observer
https://www.w3.org/TR/intersection-observer/
Other
3.62k stars 526 forks source link

rootMargin definition uses outdated HTML Standard definition #429

Closed domfarolino closed 3 years ago

domfarolino commented 4 years ago

https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-rootmargin:

Offsets applied to the root intersection rectangle, effectively growing or shrinking the box that is used to calculate intersections. Note that rootMargin is only applied for targets which belong to the same unit of related similar-origin browsing contexts as the intersection root.

The HTML Standard mentions that the unit-of-related-similar-origin-browsing-contexts definition has been removed. I'm not sure if there is an equivalent definition that this spec could reference instead, maybe @domenic would know?

domenic commented 4 years ago

It's a little hard to figure out what this was originally trying to say, since DOM elements never "belonged to" URSOBCs. In particular I'm wondering if this is trying to translate any implementation-specific notions, such as process, or thread, into spec language? Which could be problematic.

Anyway, my guess as to a reasonable replacement would be the element's relevant agent, which would contain all DOM elements which can access others synchronously, or could potentially do so after document.domain is set.

szager-chromium commented 3 years ago

"Unit of related similar origin browsing contexts" referred to the connected graph of nested browsing contexts that all belong to the same origin. I think browsing context scope origin can be used instead:

https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-group

annevk commented 3 years ago

Note #161 which this should probably be duped into as that has more relevant discussion.