IntersectionObserver uses root's padding box rather than border box
Reported by
nolan.la...@gmail.com,
Nov 8 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299 Steps to reproduce the problem: 1. Open http://bl.ocks.org/nolanlawson/raw/91515336dcf019e455f5b12dbcc8acc8/ 2. Notice that the observer event only fires once, whereas in Firefox 56 and Edge 16 it fires three times What is the expected behavior? In the IntersectionObserver spec (https://w3c.github.io/IntersectionObserver/#intersectionobserver-intersection-root) it says : "The root intersection rectangle [ when non-implicit and without overflow clip is ] the result of running the getBoundingClientRect() algorithm on the intersection root." In the attached example, the container has a height of 600px and a padding of 50px, thus the getBoundingClientRect() returns a height of 700 in all browsers, which is what is supposed to be used as the root rectangle. Thus the intersection event should fire when the border box is crossed (not the padding box). What went wrong? Chrome, however, appears to be using the 600px padding box rather than the 700px border box, so the event doesn't fire at the same point as Firefox/Edge. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 62.0.3202.89 Channel: stable OS Version: 10.0 Flash Version: There's some discussion of this issue in http://www.quirksmode.org/blog/archives/2017/10/intersection_ob.html
,
Nov 9 2017
Able to reproduce the issue on the reported version 62.0.3202.89 and latest stable 64.0.3262.0 using windows 10, Ubuntu 14.04 and Mac 10.12.6. As output is not generated in M-50 but the reported issue is seen from M-51 (51.0.2703.0) considering it as non-regression, hence marking it as untriaged.
,
Nov 9 2017
,
Nov 12
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 12
The spec says: "If the intersection root has an overflow clip, [the root intersection rect] is the element’s content area." https://w3c.github.io/IntersectionObserver/#intersectionobserver-root-intersection-rectangle |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by manoranj...@chromium.org
, Nov 8 2017