Skip to content

Allow ignoring position or dimensions in set window rect#1830

Merged
jgraham merged 1 commit intomasterfrom
set_window_rect
Jul 17, 2024
Merged

Allow ignoring position or dimensions in set window rect#1830
jgraham merged 1 commit intomasterfrom
set_window_rect

Conversation

@jgraham
Copy link
Copy Markdown
Member

@jgraham jgraham commented Jul 16, 2024

Previously it was unclear if it was acceptable to return without error from set window rect if the implementation is unable to set some of the properties.

This updates the spec so that:

  • It's unambiguously OK to run the command even if you don't support some aspects of the functionality on the current platform / configuration (you are expected to continue to return an error if you don't support any aspect of the functionality).

  • It's clear that both position and dimension properties are best effort, and even if you are able to adjust them there's no guarantee that you get the exact requested values.

  • It's clear what to do if you get just an x coordinate but not y, or just width but not height, or vice-versa. Previously this was undefined.


Preview | Diff

Previously it was unclear if it was acceptable to return without error
from set window rect if the implementation is unable to set some of
the properties.

This updates the spec so that:

* It's unambiguously OK to run the command even if you don't support
some aspects of the functionality on the current platform /
configuration (you are expected to continue to return an error if you
don't support any aspect of the functionality).

* It's clear that both position and dimension properties are best
effort, and even if you are able to adjust them there's no guarantee
that you get the exact requested values.

* It's clear what to do if you get just an x coordinate but not y, or
just width but not height, or vice-versa. Previously this was undefined.
Copy link
Copy Markdown
Contributor

@whimboo whimboo left a comment

Choose a reason for hiding this comment

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

Thanks James! The changes look good to me.

@whimboo whimboo requested a review from gsnedders July 16, 2024 09:39
@OrKoN
Copy link
Copy Markdown
Contributor

OrKoN commented Jul 16, 2024

cc @nechaev-chromium

@jgraham jgraham merged commit bb939cc into master Jul 17, 2024
@jgraham jgraham deleted the set_window_rect branch July 17, 2024 10:35
@jgraham
Copy link
Copy Markdown
Member Author

jgraham commented Jul 17, 2024

After merging this I noticed we have some uniformly passing tests that assume that input like {x: 200} is just silently ignored rather than either producing an error or setting the x-coordinate to 200 (where possible). Silently ignoring broken input seems like bad design, but I guess I should revert that part on the basis that's the defacto behviour.

yezhizhen added a commit to yezhizhen/wpt that referenced this pull request Jun 26, 2025
The spec was changed in w3c/webdriver#1830 to allow partial parameter and change with best-effort. This makes some test assertion out-dated.

This commit removes those out-dated test and move them to a new function `test_partial_input` to match the new expecation.

Fixes: web-platform-tests#53409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants