Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify "dispatch action chain" behavior when executed within a frame #1840

Open
whimboo opened this issue Sep 16, 2024 · 3 comments
Open

Clarify "dispatch action chain" behavior when executed within a frame #1840

whimboo opened this issue Sep 16, 2024 · 3 comments

Comments

@whimboo
Copy link
Contributor

whimboo commented Sep 16, 2024

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

@sadym-chromium
Copy link
Contributor

This issue is not about the coordinates, but rather about the origin of the event, right?

@whimboo
Copy link
Contributor Author

whimboo commented Oct 23, 2024

This issue is not about the coordinates, but rather about the origin of the event, right?

The coordinates for the clicks depend on the browsing context you are actually executing the action in. If the frame has a border and some margin the coordinates will be different when dispatching the events in the TLBC or the current BC.

Nevertheless the important part is that the action chain needs to be able to get the coordinates of a referenced web element as origin from the appropriate browsing context. When we can get this spec'ed we probably should be fine in dispatching the action chain from the TLBC.

So this is the identical topic as now discussed on #795 for WebDriver BiDi.

The current PR to get this behavior changed is #1847.

@whimboo
Copy link
Contributor Author

whimboo commented Nov 6, 2024

@sadym-chromium lets see if we are in sync. So when a mouse move event is synthesized to point 100x100 within a frame, the resulting mousemove event as fired by the browser within that frame should have the exact same coordinates. Right now this is (or was) not the case with Chrome and there is a difference based on the frame's outer margin etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants