IntersectionObserver does not trigger an event when display:none is set on an element.
Reported by
joel.re...@moat.com,
Jun 20 2016
|
|||||||
Issue descriptionChrome 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
,
Jun 22 2016
,
Jul 14 2016
,
Jul 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/39fcf43a4bee8f0b15abf4ef8100c2612dd45cb2 commit 39fcf43a4bee8f0b15abf4ef8100c2612dd45cb2 Author: szager <szager@chromium.org> Date: Thu Jul 14 23:43:35 2016 IntersectionObserver: send notifications when objects disappear. TEST=intersection-observer/display-none.html BUG= 621693 R=eae@chromium.org Review-Url: https://codereview.chromium.org/2149033003 Cr-Commit-Position: refs/heads/master@{#405630} [add] https://crrev.com/39fcf43a4bee8f0b15abf4ef8100c2612dd45cb2/third_party/WebKit/LayoutTests/intersection-observer/display-none-expected.txt [add] https://crrev.com/39fcf43a4bee8f0b15abf4ef8100c2612dd45cb2/third_party/WebKit/LayoutTests/intersection-observer/display-none.html [modify] https://crrev.com/39fcf43a4bee8f0b15abf4ef8100c2612dd45cb2/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
,
Jul 15 2016
,
Aug 2 2016
This fix has been requested in M53 by several major developers.
,
Aug 2 2016
Your change meets the bar and is auto-approved for M53 (branch: 2785)
,
Aug 2 2016
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
,
Aug 3 2016
@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.
,
Aug 3 2016
@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!
,
Aug 4 2016
@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.
,
Aug 4 2016
@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 |
|||||||
Comment 1 by kenjibaheux@chromium.org
, Jun 21 2016Owner: szager@chromium.org