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

Issue 713819 link

Starred by 4 users

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Intersection Observer API is broken in Chrome 58.x - detects all elements as visible although there are not

Reported by jarkko.v...@gmail.com, Apr 20 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce the problem:
1. Open the observerbug.html file

What is the expected behavior?
Status div should report that only card0, card1 and card2 became visible

What went wrong?
Status div reports that Intersection Observer API thinks that all cards became visible.

Did this work before? Yes Latest 57.x release before the first stable 58.x release

Does this work in other browsers? N/A

Chrome version: 58.0.3029.81  Channel: stable
OS Version: 6.3
Flash Version: 

This causes a serious problem to one of my key products. Fix should be prioritized.
 
observerbug.html
1.7 KB View Download
Test case is also available here: http://www.sci.fi/~jviinama/chrome/observerbug.html (click to test)
Cc: ligim...@chromium.org
Components: Blink
Labels: -Pri-2 ReleaseBlock-Stable Prestable-58.0.3029.81 Needs-Triage-M58 Needs-Bisect Pri-1

Comment 3 by kojii@chromium.org, Apr 21 2017

Components: -Blink Blink>Layout
see https://github.com/WICG/IntersectionObserver/issues/165, there was an intentional change in Chrome 58.

Comment 5 Deleted

Comment 6 Deleted

Comment 7 by hdodda@chromium.org, Apr 21 2017

Cc: hdodda@chromium.org
Labels: -Needs-Bisect -Needs-Triage-M58 hasbisect-per-revision M60 OS-Linux OS-Mac
Owner: szager@chromium.org
Status: Assigned (was: Unconfirmed)
Tested the issue on Windows 7 , ubuntu 14.04 and mac os 10.12.3 using chrome M58 #58.0.3029.81 and is reproduced.

Issue is a regression issue broken in "M58" and is reproducible in latest chrome ,beta , dev and canary channels.

Using the per-revision bisect providing the bisect results,
Good build:58.0.2988.0 (Revision: 445280).
Bad build: 58.0.3000.0 (Revision: 447669).

You are probably looking for a change made after 447298 (known good), but no later than 447299 (first known bad).

CHANGELOG URL:

The script might not always return single CL as suspectas some perf builds might get missing due to failure.

 https://chromium.googlesource.com/chromium/src/+log/9d72c664ac08275bbde7dbb4bfd350416302d4f4..c9092d27fc367898890811f6bb75893bc2200755

From the CL above, assigning the issue to the concern owner 

@szager - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Review-Url: https://codereview.chromium.org/2645283008

Thanks!
Since the API was intentionally changed, the observer callback function needs to check whether the element is actually visible since the callback is now immediately called when observer.observe(target) is invoked.

Here's a demo how to get correct behaviour:
http://www.sci.fi/~jviinama/chrome/observerbug-fixed.html

This code works both with Chrome 57.x and Chrome 58.x. Note however that event property "isIntersecting" is not available in Chrome <58, so we need to check intersectionRatio to make the decision.

Comment 9 by szager@chromium.org, Apr 21 2017

Status: WontFix (was: Assigned)
For most cases, checking intersectionRatio should be sufficient.  The new isIntersecting field is meant to address the case of an edge-adjacent intersection (i.e., both target and root have non-zero area, and they overlap on an edge).  In that case, the intersectionRect will be all zero's and the intersectionRatio will be zero, but IntersectionObserver sets isIntersecting to be true.

This is working as intended; closing bug.
Labels: -M60 M-60

Sign in to add a comment