w3c / webdriver

Remote control interface that enables introspection and control of user agents.
https://w3c.github.io/webdriver/
Other
674 stars 190 forks source link

"Create an input source" doesn't add the source to the map #1810

Open grokys opened 1 month ago

grokys commented 1 month ago

Consider the following:

grokys commented 1 month ago

In fact I see that "add an input source" is only referenced in:

§ 12.5.1 Element Click § 12.5.3 Element Send Keys

So I'm not sure exactly what should be adding input sources for actions... The documentation for "input sources" says:

Each input source has an input id which is stored as a key in the input state map.

So I assume that implicitly means that create an input source should add the source to the map? But that conflicts with "Element Send Keys" which explicitly adds the input source to the map:

  1. Let source be the result of create an input source with input state, and "key".

  2. Add an input source with input state, input id and source.

grokys commented 1 month ago

Another question is: where should the input source created in process an input source sequence be removed? Again, "remove an input source" is only referenced in "Element Click" and "Element Send Keys".

EDIT: looks like input sources for actions shouldn't be removed until "Release Actions" is called.

grokys commented 1 month ago

Another problem:

Conflicts with:

i.e. it will fail for pointer actions?

grokys commented 1 month ago

Another problem:

process an input source action sequence can potentially be called multiple times from extract an action sequence, with differing types. If extract an action sequence should indeed add the source to the map, then this conflicts with:

As it would require an multiple input sources to be created with the same id but different types.

ChernyshevDS commented 3 weeks ago

i.e. it will fail for pointer actions?

That part confuses me too. Why this specific handling for pointer actions?

Just a guess from my side (not really good when one have to guess while reading the spec...): get_or_create_input_source is mentioned only in processing actions section, and should add input sources to input map for them to survive between process_actions calls and they can be removed with release_actions. Meanwhile, in element_click and element_send_keys new input sources are created, temporarily added to input map, processed and removed at the end of processing sequence.