w3c / webdriver-bidi

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

Fix order of groups in script.Target #680

Closed OrKoN closed 3 months ago

OrKoN commented 3 months ago

The spec text defines that script.ContextTarget is matched first. The CDDL spec also picks groups in order. Therefore, the ContextTarget needs to be defined first in the group.


Preview | Diff

whimboo commented 3 months ago

@OrKoN I would still propose that we fix it as suggested on https://github.com/w3c/webdriver-bidi/issues/635 by for now having an optional type field added.

Having the processing in order of definition might require us to also check other CDDL definitions if those are valid.

OrKoN commented 3 months ago

@OrKoN I would still propose that we fix it as suggested on #635 by for now having an optional type field added.

Having the processing in order of definition might require us to also check other CDDL definitions if those are valid.

I am afraid there is no way around processing groups in order since it is defined by the CDDL spec? I think this change does not block the more general fix by using the type attribute and it does not affect implementations that do not rely strictly on CDDL.

OrKoN commented 3 months ago

@whimboo it also makes the order alphabetical :)