Contact emails
sza...@chromium.org, m...@chromium.org
oj...@chromium.org, kenji...@chromium.org
Spec
https://github.com/WICG/IntersectionObserver (Tag Review)
Summary
This specification describes an API that can be used to understand the visibility and position of DOM elements relative to a viewport. The position is delivered asynchronously and is useful for understanding the visibility of elements and implementing pre-loading and deferred loading of DOM content.
https://github.com/slightlyoff/IntersectionObserver/blob/master/explainer.md
Motivation
Accurately measuring viewability is important for several use cases; deferred-loading or lazy-loading of content, infinite-scroll lists and advertising. Because there is no standard way to get viewable information across browsers, developers have built and rely on a series of browser-specific hacks and workarounds.
For instance, many third parties have come to rely on scroll handlers, plugins and other polling approaches in order to measure viewability. On mobile, this is particularly unfortunate given the significant negative impact on performance and battery life of such approaches.
Intersection Observer addresses this need by introducing a new API to asynchronously report on the relative positions of elements without interrupting the critical paths of rendering or processing.
Link to “Intent to Implement” blink-dev discussion
https://groups.google.com/a/chromium.org/d/msg/blink-dev/eLxh8xUp3j4/m7RH4_nLBgAJ
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Debuggability
N/A (no additional devtools functionality needed)
Interoperability and Compatibility Risk
Medium:
The rough API and use cases were received positively when meeting with other browser vendors in Paris in August. Notes from Paris: http://www.w3.org/2015/08/27-positionobserver-irc
Since then, we’ve worked with other vendors to surface and address concerns via the github issue tracker. We also reached out to a wide range of interested parties to vet the design and viability of the API.
Based on these interactions, we believe that we have attain reasonable confidence in the specification and its initial scope
We have a good coverage of the spec in our test suite and we intend to convert and upstream it to the w3c repo.
OWP launch tracking bug
Entry on the feature dashboard
https://www.chromestatus.com/features/5695342691483648
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
I took a look at the IDL and filed Use FrozenArray<double> for IntersectionObserver's thresholds attribute. The situation is similar to Notifications, and there the problematic attributes have been held back from shipping. Would it make sense to ship IntersectionObserver without the theresholds attribute exposed as well?
Does the current implementation cause `observer.thresholds !== observer.thresholds`? If that is the case, we cannot live with it, and should avoid shipping until that can be resolved.
Otherwise, you just have the compat risk that people will start writing code that depends on the mutability, and you will be unable to ship the frozen array variant later. Maybe that is negligible, but I wouldn't be sure.
--
That's a pretty crazy hack, can you not just do custom bindings and store the array in a hidden property? Constructing the array in core/ seems pretty gross. Maybe it's not much better either way.
I don't think it should be a problem to ship without this attribute. It's only there for convenience; its value is the same as the "thresholds" parameter given to the constructor, and it never changes.
From: blin...@chromium.org [mailto:blin...@chromium.org] On Behalf Of Stefan Zager
> It was suggested to me that there's an IDL incantation that would implement the correct behavior:
This wouldn't be correct. The "IDL array" type (double[]) has been removed from the latest IDL specification, for a variety of fairly good reasons (like: it's missing a bunch of methods JS programmers expect of arrays; it doesn't pass common tests like instanceof Array or Array.isArray; no two browsers implemented it the same way; and, it's yet another exotic object that we want to eliminate from the platform).
It seems better to just ship without the thresholds property until FrozenArray is implemented.