Bug 245941 - IntersectionObserver Api Ratio Less Than 1 While Toolbar Visible
Summary: IntersectionObserver Api Ratio Less Than 1 While Toolbar Visible
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 16
Hardware: Mac (Intel) iOS 16
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-02 03:13 PDT by Mahdi
Modified: 2023-08-13 10:52 PDT (History)
5 users (show)

See Also:


Attachments
Image of example on Safari 16 - iPhone14 - iOS 16 (1.67 MB, image/png)
2022-10-02 03:13 PDT, Mahdi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mahdi 2022-10-02 03:13:18 PDT
Created attachment 462761 [details]
Image of example on Safari 16 - iPhone14 - iOS 16

Problem:

IntersectionObserver api in every desktop browser and mobile browsers that does not have `Toolbar` like safari on bottom of the webpage, is giving the intersectionRatio of `1` when the observed target reached the top of view:

------------------- <-- top of browser web view
+++++++++++++++++++ <-- ELEMENT THAT REACHES THE TOP
|   Hello World   |
|                 |
+++++++++++++++++++


------------------- <-- bottom of browser web view

But in Safari on iOS with Toolbar that in the browser view, it gives the value of ~0.9 for intersectionRatio which is INCORRECT!?
Comment 2 Radar WebKit Bug Importer 2022-10-03 12:16:24 PDT
<rdar://problem/100728324>
Comment 3 Ahmad Saleem 2023-08-13 10:52:46 PDT
Changed test to following JSFiddle: https://jsfiddle.net/58h0ko2w/

In Chrome Canary 118, I get following in JSFiddle Console:

"Ratio is: ", 1
"%cWorking", "color: green;"

_____

In WebKit ToT (266852@main):

"Ratio is: ", 0.9980040192604065

and get console error: <a class='gotoLine' href='#"Expect ratio to be 1 but got 0.9980040192604065"'>"Expect ratio to be 1 but got 0.9980040192604065"</a>

____

In Firefox Nightly 118:

Same as Firefox but different ratio but also error.