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

Intent to ship: IntersectionObserver API

290 views
Skip to first unread message

Tobias Schneider

unread,
Mar 15, 2017, 1:31:06 AM3/15/17
to Mozilla
As of March 14 I intend to turn the IntersectionObserver API on by default
on all platforms. It has been developed behind the
dom.IntersectionObserver.enabled
preference. Chrome is already shipping it since 51.

Manual QA and fuzzing was successfully completed (
https://wiki.mozilla.org/QA/IntersectionObserver). A telemetry experiment
run for 7 days, enabling the feature for 10% of our nightly (54 and 55)
user population. No crashes or stability issues related to this feature
occurred during that time.

*Bug to turn on by default*: https://bugzilla.mozilla.org/show_bug.cgi?id=
1321865
*Link to standard*: https://wicg.github.io/IntersectionObserver/

Michael de Boer

unread,
Mar 15, 2017, 8:16:48 AM3/15/17
to Tobias Schneider, Mozilla dev-platform mailing list mailing list
Hi Tobias,

Very exciting! This is a _very_ welcome addition to the family of Web APIs, IMHO.

I’m curious about the performance characteristics for consumers of this API: how does it scale in respect to
1. The amount of observers active on a single page and
2. Size of the page in raw DOM node count, e.g. the single-page WHATWG HTML5 spec?

Thanks,

Mike.
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

Ehsan Akhgari

unread,
Mar 15, 2017, 9:51:09 AM3/15/17
to Michael de Boer, Tobias Schneider, Mozilla dev-platform mailing list mailing list
On 2017-03-15 8:14 AM, Michael de Boer wrote:
> Hi Tobias,
>
> Very exciting! This is a _very_ welcome addition to the family of Web APIs, IMHO.
>
> I’m curious about the performance characteristics for consumers of this API: how does it scale in respect to
> 1. The amount of observers active on a single page and
> 2. Size of the page in raw DOM node count, e.g. the single-page WHATWG HTML5 spec?

Can you please share some Gecko Profiler links to profiles showing the
performance of our implementation in the various scenarios above?

Also can you please describe the architecture around how this feature
works and how it may impact the performance of the browser, and which
threads may be expected to be blocked at various stages to do work?

Boris Zbarsky

unread,
Mar 15, 2017, 12:13:27 PM3/15/17
to
On 3/15/17 1:30 AM, Tobias Schneider wrote:
> As of March 14 I intend to turn the IntersectionObserver API on by default
> on all platforms.

This is really exciting stuff!

Some questions (largely based on the intent to ship/implement templates,
fwiw):

1) Is there devtools support for this (e.g. to be able to see what
intersection observers are registered where)? If not, are there at
least bugs tracking it?

2) How stable is the spec? Do we have any signals from IE or Safari on
where they stand wrt it? Are there plans to add web platform tests for
this stuff, instead of our mochitest? It would be good to have some
idea of how actual interop with Chrome looks, and with a wpt we could
check that pretty easily.

3) Has there been a security review? The reason I ask is that the
definition at
https://wicg.github.io/IntersectionObserver/#intersectionobserver-intersection-root
means the intersection root can be in a different-origin document, and
then there are operations that use it, so it would be good to carefully
check for cross-origin information leaks. Do we have good tests for the
various cross-origin scenarios? I do see some cross-origin testing in
dom/base/test/test_intersectionobservers.html, which is good.

-Boris

Tobias Schneider

unread,
Mar 15, 2017, 1:32:56 PM3/15/17
to Boris Zbarsky, Mozilla
1) No there isn't any yet. Good idea to file a bug for it tho.

2.1) Its was quite a living spec over the time I implemented things, but
stuff seams to stabilize now.
https://bugzilla.mozilla.org/show_bug.cgi?id=1243846 is tracking bug for
spec changes that we haven't addressed yet.

2.2) No signals from Safari that I know of. IE seems to have it implemented
in their preview (
https://developer.microsoft.com/en-us/microsoft-edge/platform/status/intersectionobserver/
).

2.3) Platform tests are in the process of being upstreamed by Google (
https://github.com/w3c/web-platform-tests/pull/4384). Will include them
asap.

3) Yeah, we have some tests in place. But there wasn't an official security
review yet. Who to be the person best to talk to?

Tobias Schneider

unread,
Mar 15, 2017, 2:00:17 PM3/15/17
to Mozilla
As of March 14 I intend to turn the IntersectionObserver API on by default

Boris Zbarsky

unread,
Mar 15, 2017, 2:38:58 PM3/15/17
to
On 3/15/17 1:32 PM, Tobias Schneider wrote:
> 1) No there isn't any yet. Good idea to file a bug for it tho.

OK. Please make sure this happens.

> 2.1) Its was quite a living spec over the time I implemented things, but
> stuff seams to stabilize now.
> https://bugzilla.mozilla.org/show_bug.cgi?id=1243846 is tracking bug for
> spec changes that we haven't addressed yet.

Do we plan to address those before shipping? The bug you linked to is
marked "resolved fixed", but I assume you mean the unfixed bugs blocking it?

> 2.2) No signals from Safari that I know of. IE seems to have it implemented
> in their preview (
> https://developer.microsoft.com/en-us/microsoft-edge/platform/status/intersectionobserver/
> ).

Again, do we have indications of how interoperable that is with our
implementation?

> 2.3) Platform tests are in the process of being upstreamed by Google (
> https://github.com/w3c/web-platform-tests/pull/4384).

That seems to be in limbo for well over a month now. jgraham just poked
it in hopes of at least getting automated testing going so we find out
whether Firefox passes the tests... but that will test release, afaik.
Have you checked whether we pass these tests?

> 3) Yeah, we have some tests in place. But there wasn't an official security
> review yet. Who to be the person best to talk to?

I wish it didn't take me an hour of trying and failing to answer this
question.

Maybe try rbarnes and dveditz, and ask them to create some pages on
wiki.mozilla.org that would actually be findable and not explicitly
marked out of date? :(

-Boris

Markus Stange

unread,
Mar 15, 2017, 6:27:05 PM3/15/17
to
On 2017-03-15 1:32 PM, Tobias Schneider wrote:
> 2.2) No signals from Safari that I know of.

Simon Fraser has implemented part of it in
https://bugs.webkit.org/show_bug.cgi?id=159475 , but things appear to
have stalled. He also filed quite a few spec bugs in the process:
https://github.com/WICG/IntersectionObserver/issues?utf8=%E2%9C%93&q=is%3Aissue%20author%3Asmfr%20

-Markus

Anne van Kesteren

unread,
Mar 16, 2017, 3:39:51 AM3/16/17
to Boris Zbarsky, dev-platform
On Wed, Mar 15, 2017 at 7:38 PM, Boris Zbarsky <bzba...@mit.edu> wrote:
> On 3/15/17 1:32 PM, Tobias Schneider wrote:
>> 2.3) Platform tests are in the process of being upstreamed by Google (
>> https://github.com/w3c/web-platform-tests/pull/4384).
>
> That seems to be in limbo for well over a month now. jgraham just poked it
> in hopes of at least getting automated testing going so we find out whether
> Firefox passes the tests... but that will test release, afaik. Have you
> checked whether we pass these tests?

They would be run against Nightly.


--
https://annevankesteren.nl/

Patrick Brosset

unread,
Mar 16, 2017, 4:52:42 AM3/16/17
to dev-platform
>
> 1) Is there devtools support for this (e.g. to be able to see what
> intersection observers are registered where)? If not, are there at least
> bugs tracking it?


I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1347849 for this.
MutationObserver would be a good one to add support for too!

On Thu, Mar 16, 2017 at 8:39 AM, Anne van Kesteren <ann...@annevk.nl> wrote:

> On Wed, Mar 15, 2017 at 7:38 PM, Boris Zbarsky <bzba...@mit.edu> wrote:
> > On 3/15/17 1:32 PM, Tobias Schneider wrote:
> >> 2.3) Platform tests are in the process of being upstreamed by Google (
> >> https://github.com/w3c/web-platform-tests/pull/4384).
> >
> > That seems to be in limbo for well over a month now. jgraham just poked
> it
> > in hopes of at least getting automated testing going so we find out
> whether
> > Firefox passes the tests... but that will test release, afaik. Have you
> > checked whether we pass these tests?
>
> They would be run against Nightly.
>
>
> --
> https://annevankesteren.nl/

Tobias Schneider

unread,
Mar 24, 2017, 10:32:45 AM3/24/17
to Patrick Brosset, dev-platform
We just successfully run another experiment, enabling the
IntersectionObserver API for 50% of our Nightly user population. No related
stability issues reported. Also, find a Gecko profile using an Intersection
Observer per element (109192 total) on the single page version of the HTML5
spec here:
https://www.dropbox.com/s/cm55ixrvk7bqaxu/SinglePageHTML5SpecIntersectionObserver.sps.json.zip?dl=0
.

On Thu, Mar 16, 2017 at 1:52 AM, Patrick Brosset <pbro...@mozilla.com>
wrote:

> >
> > 1) Is there devtools support for this (e.g. to be able to see what
> > intersection observers are registered where)? If not, are there at least
> > bugs tracking it?
>
>
> I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1347849 for this.
> MutationObserver would be a good one to add support for too!
>
> On Thu, Mar 16, 2017 at 8:39 AM, Anne van Kesteren <ann...@annevk.nl>
> wrote:
>
> > On Wed, Mar 15, 2017 at 7:38 PM, Boris Zbarsky <bzba...@mit.edu> wrote:
> > > On 3/15/17 1:32 PM, Tobias Schneider wrote:
> > >> 2.3) Platform tests are in the process of being upstreamed by Google (
> > >> https://github.com/w3c/web-platform-tests/pull/4384).
> > >
> > > That seems to be in limbo for well over a month now. jgraham just
> poked
> > it
> > > in hopes of at least getting automated testing going so we find out
> > whether
> > > Firefox passes the tests... but that will test release, afaik. Have you
> > > checked whether we pass these tests?
> >
> > They would be run against Nightly.
> >
> >
> > --
> > https://annevankesteren.nl/

Tobias Schneider

unread,
Apr 5, 2017, 5:22:24 PM4/5/17
to Patrick Brosset, dev-platform
Out final experiment on 100% of our Nightly user population just finished.
We enabled the API for 110605 users. Out of that we only had 2 reported
crashes related to the Intersection Observer API. Both were causes by
Add-ons using the API in XUL documents. We already addressed this issue in
https://bugzilla.mozilla.org/show_bug.cgi?id=1353529. I think its safe to
go ahead and finally enabling this feature by default.

On Fri, Mar 24, 2017 at 7:32 AM, Tobias Schneider <tschn...@mozilla.com>
wrote:

> We just successfully run another experiment, enabling the
> IntersectionObserver API for 50% of our Nightly user population. No related
> stability issues reported. Also, find a Gecko profile using an Intersection
> Observer per element (109192 total) on the single page version of the HTML5
> spec here: https://www.dropbox.com/s/cm55ixrvk7bqaxu/
> SinglePageHTML5SpecIntersectionObserver.sps.json.zip?dl=0.
>
> On Thu, Mar 16, 2017 at 1:52 AM, Patrick Brosset <pbro...@mozilla.com>
> wrote:
>
>> >
>> > 1) Is there devtools support for this (e.g. to be able to see what
>> > intersection observers are registered where)? If not, are there at
>> least
>> > bugs tracking it?
>>
>>
>> I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1347849 for this.
>> MutationObserver would be a good one to add support for too!
>>
>> On Thu, Mar 16, 2017 at 8:39 AM, Anne van Kesteren <ann...@annevk.nl>
>> wrote:
>>
>> > On Wed, Mar 15, 2017 at 7:38 PM, Boris Zbarsky <bzba...@mit.edu>
>> wrote:
>> > > On 3/15/17 1:32 PM, Tobias Schneider wrote:
>> > >> 2.3) Platform tests are in the process of being upstreamed by Google
>> (
>> > >> https://github.com/w3c/web-platform-tests/pull/4384).
>> > >
>> > > That seems to be in limbo for well over a month now. jgraham just
>> poked
>> > it
>> > > in hopes of at least getting automated testing going so we find out
>> > whether
>> > > Firefox passes the tests... but that will test release, afaik. Have
>> you
>> > > checked whether we pass these tests?
>> >
>> > They would be run against Nightly.
>> >
>> >
>> > --
>> > https://annevankesteren.nl/

Jet Villegas

unread,
Apr 5, 2017, 5:31:54 PM4/5/17
to Tobias Schneider, dev-platform, Patrick Brosset
Thanks, Tobias. If all goes well, please request uplift to FF 54 for
this after a few days in Nightly 55 to unblock bugs like:
https://bugzilla.mozilla.org/show_bug.cgi?id=1131937#c28

--Jet

On Wed, Apr 5, 2017 at 2:21 PM, Tobias Schneider <tschn...@mozilla.com> wrote:
> Out final experiment on 100% of our Nightly user population just finished.
> We enabled the API for 110605 users. Out of that we only had 2 reported
> crashes related to the Intersection Observer API. Both were causes by
> Add-ons using the API in XUL documents. We already addressed this issue in
> https://bugzilla.mozilla.org/show_bug.cgi?id=1353529. I think its safe to
> go ahead and finally enabling this feature by default.
>
> On Fri, Mar 24, 2017 at 7:32 AM, Tobias Schneider <tschn...@mozilla.com>
> wrote:
>
>> We just successfully run another experiment, enabling the
>> IntersectionObserver API for 50% of our Nightly user population. No related
>> stability issues reported. Also, find a Gecko profile using an Intersection
>> Observer per element (109192 total) on the single page version of the HTML5
>> spec here: https://www.dropbox.com/s/cm55ixrvk7bqaxu/
>> SinglePageHTML5SpecIntersectionObserver.sps.json.zip?dl=0.
>>
>> On Thu, Mar 16, 2017 at 1:52 AM, Patrick Brosset <pbro...@mozilla.com>
>> wrote:
>>
>>> >
>>> > 1) Is there devtools support for this (e.g. to be able to see what
>>> > intersection observers are registered where)? If not, are there at
>>> least
>>> > bugs tracking it?
>>>
>>>
>>> I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1347849 for this.
>>> MutationObserver would be a good one to add support for too!
>>>
>>> On Thu, Mar 16, 2017 at 8:39 AM, Anne van Kesteren <ann...@annevk.nl>
>>> wrote:
>>>
>>> > On Wed, Mar 15, 2017 at 7:38 PM, Boris Zbarsky <bzba...@mit.edu>
>>> wrote:
>>> > > On 3/15/17 1:32 PM, Tobias Schneider wrote:
>>> > >> 2.3) Platform tests are in the process of being upstreamed by Google
>>> (
>>> > >> https://github.com/w3c/web-platform-tests/pull/4384).
>>> > >
>>> > > That seems to be in limbo for well over a month now. jgraham just
>>> poked
>>> > it
>>> > > in hopes of at least getting automated testing going so we find out
>>> > whether
>>> > > Firefox passes the tests... but that will test release, afaik. Have
>>> you
>>> > > checked whether we pass these tests?
>>> >
>>> > They would be run against Nightly.
>>> >
>>> >
>>> > --
>>> > https://annevankesteren.nl/
0 new messages