Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to prototype: Document as explicit root of an intersection observer

75 views
Skip to first unread message

Frédéric Wang

unread,
Feb 24, 2020, 3:51:28 AM2/24/20
to
Summary: This is an enhancement to the IntersectionObserver API.
Currently, it is possible to use the top level document (implicit root)
or to specify an Element (e.g. {root: document.scrollingElement}). None
of these options provides a way to specify a root corresponding to the
bounding box of an iframe's window. This proposal is about allowing an
explicit Document root, in order to cover that case.

Original intent-to thread:
https://groups.google.com/forum/#!searchin/mozilla.dev.platform/intersectionobserver/mozilla.dev.platform/YdKTMvQygl0/cl2vdYt3BgAJ

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1617154
https://bugzilla.mozilla.org/show_bug.cgi?id=1381574 (meta bug)

Standard:
https://w3c.github.io/IntersectionObserver (specification)
https://github.com/w3c/IntersectionObserver/issues/372 (public discussion)

Platform coverage: All

Preference: dom.IntersectionObserverExplicitDocumentRoot.enabled

DevTools bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1617526
https://bugzilla.mozilla.org/show_bug.cgi?id=1347849

Other browsers:
* WebKit:
intent emailed
https://lists.webkit.org/pipermail/webkit-dev/2020-February/031087.html
considering https://bugs.webkit.org/show_bug.cgi?id=208047
* Blink:
intent emailed
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/6dOOw2vu1is
shipped since version 81
https://chromium-review.googlesource.com/c/chromium/src/+/2015676

web-platform-tests:
https://w3c-test.org/intersection-observer/document-scrolling-element-root.html

Secure contexts: Same as IntersectionObserver
Is this feature enabled by default in sandboxed iframes: Same as
IntersectionObserver

As mentioned in the original intent-to thread, the root can be in a
different-origin document so there is some security aspect to consider
here. AFAIK, the proposal does not make the situation worse though. I
can't find any conclusion on the security aspect in the original
intent-to thread, so I guess someone more knowledgeable than me on this
should comment.

--
Frédéric Wang
0 new messages