w3c / at-driver

AT Driver defines a protocol for introspection and remote control of assistive technology software, using a bidirectional communication channel.
https://w3c.github.io/at-driver
Other
31 stars 4 forks source link

Editorial: Correct "process capabilities" algorithm #55

Closed jugglinmike closed 1 year ago

jugglinmike commented 1 year ago

Correct the derivation of "required capabilities" and simplify the return value.


Preview | Diff

jugglinmike commented 1 year ago

As written today (that is, before applying this patch), "process capabilities" and "match capabilities" are incoherent. "process capabilities" may invoke "match capabilities" with a value of null, to which the latter attempts to apply the "iterate" algorithm for ordered maps.

This occurs if either of the following conditions is met:

Since "process capabilities" was modeled after an algorithm of the same name in the WebDriver specification, and since I'm not aware of any reason to diverge, I designed this patch to resolve the incoherency by mimicking the behavior in WebDriver. That is: when the "session.new" command is invoked without any specified capabilities, then the session is created successfully.

With this patch applied, "process capabilities" always invokes "match capabilities" with a map, though the map may be empty. "match capabilities" continues to tolerate empty maps.

jugglinmike commented 1 year ago

Thanks, @jkva!