New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 612323 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

IntersectionObserver.prototype.observe doesn't always trigger the callback for already-in-view items

Project Member Reported by philipwalton@google.com, May 16 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2738.0 Safari/537.36

Example URL:
http://s.codepen.io/philipwalton/debug/vGwXbg

Steps to reproduce the problem:
1. Visit http://s.codepen.io/philipwalton/debug/vGwXbg in any version of Chrome that supports IntersectionObserver
2. Open up the console.
3. Notice that the string "Intersection happened..." is not being logged unless you scroll or click or otherwise interact with the page.

What is the expected behavior?
The InteractionObserver callback should always be invoked after calling `.observe` if the element is already in view.

What went wrong?
It seems that the setTimeout is deferring the `.observe` call to a point after which no new frames are immediately made, so the callback doesn't happen.

The `.observe` method should probably always schedule a new frame.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? N/A 

Chrome version: 52.0.2738.0  Channel: canary
OS Version: OS X 10.11.4
Flash Version: Shockwave Flash 22.0 r0
 

Comment 1 by dmu...@chromium.org, May 17 2016

Components: -Blink Blink>Layout
Owner: szager@chromium.org
Hello, I'm your friendly blink triage sheriff. Routing to Stefan, who works on IntersectionObserver.
Cc: tkonch...@chromium.org
Labels: M-52 OS-Linux OS-Windows
Status: Assigned (was: Unconfirmed)
Tested the same on mac 10.11, win8.1 and Linux 14.04 chrome version 52.0.2738.0, 52.0.2729.3 and 51.0.2704.47 - the string "Intersection happened..." is displayed in console only after interacting with page.

Observed the error "Uncaught ReferenceError: IntersectionObserver is not defined" is displayed on mac 10.11 chrome version 50.0.2661.102

Confirming and assigning the issue for further inputs on this.


Comment 3 by szager@chromium.org, May 17 2016

Status: Started (was: Assigned)
https://codereview.chromium.org/1988633002/
Status: Fixed (was: Started)
Stefan, do you know which version has this fix?
I got a question from an interested third party reporting that the issue was still in M52 (v52.0.2743.82 OSX)

M54: fix confirmed.
M53: not tested.


It's in M53, but not M52
Sorry to insist, but the bug is still there on my Chrome 52.0.2743.116 Stable channel / OS X 10.11.6

Let me clarify my testing steps:

1. Visit http://s.codepen.io/philipwalton/debug/vGwXbg
2. Open up the console.
3. The string "Intersection happened..." is being logged (because opening the console *is* an interaction).
4. Reload the page, while console is opened.
5. Notice that the string "Intersection happened..." is not being logged unless you scroll or click or otherwise interact with the page.
Sorry Stefan, i did not read your answer. It is ok for me: 52 is not fixed, 53 is.
Labels: -M-52 M-53
Updating the label to reflect the actual status.

Sign in to add a comment