Description
There is currently a difference between Firefox and Chrome / Safari when actions are performed within an iframe
. While Firefox uses the iframe's visual viewport as reference to dispatch the actions, the top-level browsing context's visible viewport is actually used by Chrome and Safari.
As per definition of the visual viewport on MDN:
The VisualViewport interface of the Visual Viewport API represents the visual viewport for a given window. For a page containing iframes, each iframe, as well as the containing page, will have a unique window object. Each window on a page will have a unique VisualViewport representing the properties associated with that window.
IMO this means that we do it right in Firefox, but it's not clear given that the specification is quite unclear.
I noticed that issue when trying to fix some wpt tests around input events (see web-platform-tests/wpt#48147).
I also landed a test which demonstrates the difference in behavior:
web-platform-tests/wpt#48123