Skip to content

[Set Window Rect] Change parameter requirement from Number to Integer and range to "maximum safe integer" #1909

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4058,11 +4058,11 @@ <h4><dfn>Set Window Rect</dfn></h4>
<li><p>If <var>y</var> is <a>undefined</a>, let <var>y</var> be null.

<li><p>If <var>width</var> or <var>height</var> is neither null, nor
a <a>Number</a> from 0 to 2<sup>31</sup> − 1, return <a>error</a>
an integer from 0 to 2<sup>31</sup> − 1, return <a>error</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find. But lets take one more thing into account. In WebDriver BiDi we actually use a range from 0 to maximum safe integer. We probably should do the same here as well even though those high values won't be able to get applied. The same applies for x and y.

Copy link
Contributor Author

@yezhizhen yezhizhen Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In WebDriver BiDi we actually use a range from 0 to maximum safe integer.

Can you show a reference of this case in BiDi? I cannot find it anywhere.

I only see usage of "maximum safe integer" in Add Cookie/Timeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies for x and y.

https://github.com/mozilla-firefox/firefox/blob/dc64a7e82ff4e2e31b7dafaaa0a9599640a2c87c/testing/webdriver/src/command.rs#L850-L861

Also it seems x and y can be negative? How would we phrase it if upper bound is maximum safe integer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CDDL definition uses https://w3c.github.io/webdriver-bidi/#cddl-type-js-uint. That's basically the maximum safe value. There is also js-int for the full range. In WebDriver classic see https://w3c.github.io/webdriver/#dfn-maximum-safe-integer.

with <a>error code</a> <a>invalid argument</a>.

<li><p>If <var>x</var> or <var>y</var> is neither null, nor
a <a>Number</a> from −(2<sup>31</sup>) to 2<sup>31</sup> − 1,
an integer from −(2<sup>31</sup>) to 2<sup>31</sup> − 1,
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.

<li><p>If the <a>remote end</a> does not support
Expand Down