Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error in browser.SetClientWindowStateParameters definition? #853

Open
tabatkins opened this issue Jan 12, 2025 · 1 comment · May be fixed by #857
Open

Syntax error in browser.SetClientWindowStateParameters definition? #853

tabatkins opened this issue Jan 12, 2025 · 1 comment · May be fixed by #857
Labels
bug Something isn't working module-browser Browser module

Comments

@tabatkins
Copy link
Member

If I'm understanding the CDDL spec correctly, and inferring the intended definition of browser.SetClientWindowStateParameters correctly, then browser.SetClientWindowStateParameters is defined incorrectly; it uses // when it meant to use /.

That is, // is just a weakly-binding /, allowing you to define groups inline without having to abstract them to types. The current definition of browser.SetClientWindowStateParameters is:

browser.SetClientWindowStateParameters = {
  clientWindow: browser.ClientWindow,
  browser.ClientWindowNamedState // browser.ClientWindowRectState
}

This is, afaict, equivalent to:

browser.SetClientWindowStateParameters = {
  (clientWindow: browser.ClientWindow, browser.ClientWindowNamedState) // 
  browser.ClientWindowRectState
}

That is, the first two items form a group, and the third item forms an alternative group. But I suspect what was intended was for clientWindow to always be present, and then have a choice between browser.ClientWindowNamedState and browser.ClientWindowRectState. To do that, you would need to have written:

browser.SetClientWindowStateParameters = {
  clientWindow: browser.ClientWindow,
  browser.ClientWindowNamedState / browser.ClientWindowRectState
}
@whimboo whimboo added bug Something isn't working module-browser Browser module labels Jan 13, 2025
@whimboo
Copy link
Contributor

whimboo commented Jan 13, 2025

Thank you @tabatkins for the issue. This is correct. The // operator binds more weakly and we need the choice here. Would you be interested to provide a PR for it?

tabatkins added a commit to tabatkins/webdriver-bidi that referenced this issue Jan 14, 2025
@whimboo whimboo linked a pull request Jan 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module-browser Browser module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants