Open grokys opened 6 months 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:
Let source be the result of create an input source with input state, and "key".
Add an input source with input state, input id and source.
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.
Another problem:
Conflicts with:
i.e. it will fail for pointer actions?
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 type
s.
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.
Consider the following:
extract an action sequence
is invokedprocess an input source action sequence
is invokedget or create an input source
is invokedcreate an input source
is invoked and a new input source returned. NOTE: this is not specified as being added to the input state mapprocess an input source action sequence
: 3. "Otherwise, if type is "key" let action be the result of trying to process a key action with parameters id, and action item." is invokedDispatch actions
is invokedDispatch tick actions
is invoked