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

Issue 621693 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

IntersectionObserver does not trigger an event when display:none is set on an element.

Reported by joel.re...@moat.com, Jun 20 2016

Issue description

Chrome Version       : 51.0.2704.84
OS Version: OS X 10.10.5
URLs (if applicable) : http://joelregus.com/upload/intersection_test.html

What steps will reproduce the problem?
1. Open dev tools and go to the console.
2. Scroll down the page to see the red box, notice the console logs, these are coming from an event handler.
3. Input the following code into the console:

document.getElementById("box").style.display = "none";

What is the expected result?

An event should fire and you should see "0%" appear in the console.

What happens instead of that?

The event is not triggered and the event handler does not fire. 

Please provide any additional information below. Attach a screenshot if
possible.

The event is triggered when you bring the box back:

document.getElementById("box").style.display = "block";

UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36



 
Components: Blink>Layout
Owner: szager@chromium.org

Comment 2 by e...@chromium.org, Jun 22 2016

Status: Available (was: Unconfirmed)

Comment 3 by szager@chromium.org, Jul 14 2016

Cc: szager@chromium.org
 Issue 627616  has been merged into this issue.

Comment 5 by e...@chromium.org, Jul 15 2016

Status: Fixed (was: Available)
Labels: Merge-Request-53
This fix has been requested in M53 by several major developers.

Comment 7 by dimu@chromium.org, Aug 2 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 2 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6e367f99646fef1c75b43e3e9533c4feae8020c3

commit 6e367f99646fef1c75b43e3e9533c4feae8020c3
Author: szager <szager@chromium.org>
Date: Tue Aug 02 22:06:49 2016

[M53] IntersectionObserver: send notifications when objects disappear

TEST=intersection-observer/display-none.html
BUG= 621693 
TBR=eae@chromium.org
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2206003002
Cr-Commit-Position: refs/branch-heads/2785@{#472}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[add] https://crrev.com/6e367f99646fef1c75b43e3e9533c4feae8020c3/third_party/WebKit/LayoutTests/intersection-observer/display-none-expected.txt
[add] https://crrev.com/6e367f99646fef1c75b43e3e9533c4feae8020c3/third_party/WebKit/LayoutTests/intersection-observer/display-none.html
[modify] https://crrev.com/6e367f99646fef1c75b43e3e9533c4feae8020c3/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp

Cc: rnimmagadda@chromium.org
Labels: Needs-Feedback
@joel.regus: Could you please have a look at the attached video and let us know if this is the correct procedure/expected result ?

Thank you.
621693.mov
11.0 MB Download
@rnimmagadda: This is the correct testing procedure, however in the video provided the box is placed out of view before applying display:none. 

Since the box already has an intersectionRatio of 0 at this point I don't believe a change event would fire when display:none is applied.

Could you run the test again but with the box 100% in view? Ideally we should see 0% appear in the console when display:none is applied to an element that is in view.

Thanks!
@joel.regus: Could you run the test again but with the box 100% in view? => I my understanding the Zoom Level in Chrome is set to 100% in my Chrome [When tested]

@szager: Could you please look into the issue and provide an update as per the comment #10.

Thank you.
@rnimmagadda: I apologize for the misunderstanding, I was not referring to the browser's zoom level, but to the percent that the box was visible on screen. In the console you should see 100% when the box is fully in view.

Sign in to add a comment