w3c / webdriver-bidi

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

Remove ranges from `AngleProperties` and `TiltProperties` #559

Closed jrandolf-2 closed 1 year ago

jrandolf-2 commented 1 year ago

Although the ranges for AngleProperties and TiltProperties are correct, adding them to the schema creates the incorrect type.

More specifically, for a given value, the type union will match the value if the value matches any of the productions in the union. In particular, if the value is {tiltX: 91}, value will not match TiltProperties, but it will match AngleProperties.


Preview | Diff

juliandescottes commented 1 year ago

Even with the fix here, if I tried to pass { tiltX: 1.234 }, would it also match AngleProperties and therefore match the type union? If that's the case, removing ranges is not addressing the root cause, so I agree with @OrKoN we should try to fix it completely.

I don't know what is the best solution to fix it, I would prefer to get feedback from @jgraham here.

jrandolf-2 commented 1 year ago

Even with the fix here, if I tried to pass { tiltX: 1.234 }, would it also match AngleProperties and therefore match the type union? If that's the case, removing ranges is not addressing the root cause, so I agree with @OrKoN we should try to fix it completely.

I don't know what is the best solution to fix it, I would prefer to get feedback from @jgraham here.

With the fix here, tiltX will match TiltProperties, therefore implementations can validate tiltX independently during performActions.