Bug 200776 - IntersectionObserverEntry#intersectionRatio can be larger than 1
Summary: IntersectionObserverEntry#intersectionRatio can be larger than 1
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ali Juma
Keywords: InRadar
Depends on:
Reported: 2019-08-15 11:18 PDT by Tim Guan-tin Chien [:timdream]
Modified: 2019-09-13 11:47 PDT (History)
12 users (show)

See Also:

test case (657 bytes, text/html)
2019-08-15 11:18 PDT, Tim Guan-tin Chien [:timdream]
no flags Details
Patch (5.71 KB, patch)
2019-09-13 08:54 PDT, Ali Juma
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Guan-tin Chien [:timdream] 2019-08-15 11:18:14 PDT
Created attachment 376398 [details]
test case

STR: Load the minimal test case. the callback will put the intersectionRatio on the page.

Expected: The intersectionRatio should be exactly 1 in this case because the element is entirely in the viewport.

Actual: It's 1.0270270109176636.

The spec states it should be a number between 0 and 1. https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-intersectionratio

This is also reproducible on Chrome but not Firefox.
Comment 1 Tim Guan-tin Chien [:timdream] 2019-08-15 11:19:41 PDT
Tested on Release 89 (Safari 13.1, WebKit 14609.1.1)
Comment 2 Tim Guan-tin Chien [:timdream] 2019-08-15 11:25:23 PDT
Filed on Chromium as https://bugs.chromium.org/p/chromium/issues/detail?id=994298
Comment 3 Tim Guan-tin Chien [:timdream] 2019-08-15 13:20:08 PDT
Still producible on WebKit Nightly Version 12.1.2 (14607.3.9, 609+)
Comment 4 Radar WebKit Bug Importer 2019-08-15 16:26:54 PDT
Comment 5 Ali Juma 2019-09-13 08:54:10 PDT
Created attachment 378731 [details]
Comment 6 WebKit Commit Bot 2019-09-13 11:47:01 PDT
Comment on attachment 378731 [details]

Clearing flags on attachment: 378731

Committed r249845: <https://trac.webkit.org/changeset/249845>
Comment 7 WebKit Commit Bot 2019-09-13 11:47:03 PDT
All reviewed patches have been landed.  Closing bug.