w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
368 stars 41 forks source link

Input events dispatch to top-level frame #795

Open sadym-chromium opened 2 weeks ago

sadym-chromium commented 2 weeks ago

Currently in BiDi, the origin of the input event can be sent to a non-top level browsing context. Classic specification declares it as Perform implementation-specific action dispatch steps on browsing context, which ends up in

These steps must be equivalent to performing the given input device manipulations on context.

However, performing inputs on not top level browsing context seems to be odd and can be misleading during testing of interactions with iframe's elements.

Should we emit the emulation events on the top-level browsing context? How spec can be formulated, so that user keeps possibility to send an element in a nested browsing context, and be able to verify it was not intercepted by the parent frame?

css-meeting-bot commented 2 weeks ago

The Browser Testing and Tools Working Group just discussed Input events dispatch to top-level frame.

The full IRC log of that discussion <jgraham> Topic: Input events dispatch to top-level frame
<jgraham> github: https://github.com/w3c/webdriver-bidi/issues/795
<jgraham> sadym: BiDi allows sending input events to any context including iframes. However if the user wants to test that there is nothing interrupting that click they have to dispatch to the top-level target on the coordinates of the button and check if the event bubbled down through the layers. I don't think classic has the problem because we can only
<jgraham> target top level traversables. Do we want to adjust the specification so that all events go via all the browsing contexts?
<tidoust> jgraham: I don't know what the answer is, it's a real problem. I think we're doing something similar to what you suggest to dispatch the event through iframes. We would need to check what's possible.
<tidoust> ... We should specify you're not directly targeting the iframe, and probably we're not doing that correctly at the moment.
<jgraham> sadym: You're saying it's a good idea to dispatch from th tlbc?
<jgraham> jgraham: Yes
<jgraham> sadym: The specification currently says that you have to make it equivalent to performing the events on the given context, but we want to change to the top-level context, right?
<jgraham> jgraham: Yes, I think so
<jgraham> sadym: OK, I'll do that
<AutomatedTester> q?
whimboo commented 1 week ago

@sadym-chromium I assume that this request is similar or actually the same as https://github.com/w3c/webdriver/issues/1840?

sadym-chromium commented 3 days ago

@sadym-chromium I assume that this request is similar or actually the same as w3c/webdriver#1840?

If the issue you mentioned is not about coordinates but about the context the actions dispatch from, then yes, it's the same.