IntersectionObserver boundingClientRect is wrong for display:inline elements
Reported by
mich...@quora.com,
May 29 2018
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36 Steps to reproduce the problem: 1. See: https://jsfiddle.net/4d0mgtnc/1/ 2. Scroll the container horizontally What is the expected behavior? Only the boxes that are visible are marked as visible. The visible boxes updates as you scroll the parent div. What went wrong? All observed elements are display:inline; and are mistakenly classified as intersecting and in the viewport IntersectionObserverEntry.boundingClientRect doesn't return the same value as elem.getBoundingClientRect for each observed element Did this work before? N/A Does this work in other browsers? Yes Chrome version: 66.0.3359.181 Channel: n/a OS Version: OS X 10.13.4 Flash Version:
,
May 30 2018
,
May 30 2018
michael@ Thanks for the issue. Able to reproduce the issue on Mac OS 10.13.3, Windows 10 and Ubuntu 14.04 on the latest Canary 69.0.3444.0 and Stable 66.0.3359.181 by the steps mentioned in the original comment. Attached is the screen cast for reference. This is a Non-Regression issue as this behavior is observed from M60 Chrome builds. Hence marking this as Untriaged for further updates from Dev. Thanks.
,
May 30 2018
,
Jun 1 2018
,
Aug 7
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ba33dbe645ff064f39484dd238ddecd050491923 commit ba33dbe645ff064f39484dd238ddecd050491923 Author: Stefan Zager <szager@chromium.org> Date: Tue Aug 07 17:29:39 2018 [IntersectionObserver] Fix target rect calculation for LayoutInline. BUG= 847623 R=chrishtr@chromium.org Change-Id: Ib8cefc856ecbeadfdeecabcf7f20b6d3b457db6a Reviewed-on: https://chromium-review.googlesource.com/1164473 Commit-Queue: Stefan Zager <szager@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Cr-Commit-Position: refs/heads/master@{#581271} [add] https://crrev.com/ba33dbe645ff064f39484dd238ddecd050491923/third_party/WebKit/LayoutTests/external/wpt/intersection-observer/inline-client-rect.html [modify] https://crrev.com/ba33dbe645ff064f39484dd238ddecd050491923/third_party/blink/renderer/core/layout/intersection_geometry.cc
,
Aug 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1abadbc5476d7be43100ddb6190d0e9ab0df3b5f commit 1abadbc5476d7be43100ddb6190d0e9ab0df3b5f Author: Stefan Zager <szager@chromium.org> Date: Thu Aug 09 02:07:47 2018 [IntersectionObserver] Fix initial notifications for non-zero threshold When a target is first observed, last_threshold_index_ is set to a sentinel value (0x1fffffff), to ensure that an initial notification will be sent on the next frame. For that notification, if the target is intersecting, but the intersection ratio is less than the smallest threshold set on the observer, then the isIntersecting field of the notification should be false. Also, for IOv2, the isVisible field should always be false -- and skip the expensive hit test -- if the intersection ratio is less than the smallest threshold set on the observer. BUG= 847623 ,827639 R=chrishtr@chromium.org Change-Id: I518ff97a23afd92a82c4d01d9280d57ffb0c9ae2 Reviewed-on: https://chromium-review.googlesource.com/1167884 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Commit-Queue: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#581755} [add] https://crrev.com/1abadbc5476d7be43100ddb6190d0e9ab0df3b5f/third_party/WebKit/LayoutTests/external/wpt/intersection-observer/initial-observation-with-threshold.html [modify] https://crrev.com/1abadbc5476d7be43100ddb6190d0e9ab0df3b5f/third_party/blink/renderer/core/intersection_observer/intersection_observation.cc
,
Sep 13
@szager: is this fixed? If so, does it fix the example in comment 6 here? https://bugs.chromium.org/p/chromium/issues/detail?id=823796#c6
,
Sep 14
It is fixed, but it does not fix the other bug. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by sdy@chromium.org
, May 29 2018