Bug 245941

Summary: IntersectionObserver Api Ratio Less Than 1 While Toolbar Visible
Product: WebKit Reporter: Mahdi <mohammadmahdi1383>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Intel)   
OS: iOS 16   
Attachments:
Description Flags
Image of example on Safari 16 - iPhone14 - iOS 16 none

Mahdi
Reported 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!?
Attachments
Image of example on Safari 16 - iPhone14 - iOS 16 (1.67 MB, image/png)
2022-10-02 03:13 PDT, Mahdi
no flags
Radar WebKit Bug Importer
Comment 2 2022-10-03 12:16:24 PDT
Ahmad Saleem
Comment 3 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.
Note You need to log in before you can comment on or make changes to this bug.