Bug 251586

Summary: Support Intersection Observer V2 (isVisible)
Product: WebKit Reporter: somamine7 <somamine7>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: agafvv, annevk, ap, bfulgham, koivisto, nmouchtaris, rbuis, simon.fraser, webkit-bug-importer, wilander, zalan
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   

Description somamine7@gmail.com 2023-02-02 07:59:31 PST
I'd like to propose that WebKit extend the Intersection Observer API to support the V2 that Chrome has implemented and shipped to production.

V2 of the Intersection Observer API exposes a few simple, but incredibly powerful features to developers: namely, the "isVisible" property. This property lets developers detect whether an element is visible, accounting for not only the element's position, but things like opacity, filters, and transforms.

This simple extension of the Intersection Observer API has effectively solved clickjacking as an attack vector, which has incredibly profound consequences for all kinds of security sensitive applications. Being able to confirm an iFrame is entirely visible to the user, for example, opens up a world of possibility for developers.

Here are a few helpful links about Intersection Observer V2 to help give the needed context:
https://chromestatus.com/feature/5878481493688320
https://github.com/szager-chromium/IntersectionObserver/blob/v2/explainer.md
https://szager-chromium.github.io/IntersectionObserver/demo/cashbomb/hidden/
Comment 1 Radar WebKit Bug Importer 2023-02-03 03:31:45 PST
<rdar://problem/105000796>