Skip to content

Check receiver response in actions.rs - #36928

Merged
jdm merged 1 commit into
servo:mainfrom
PotatoCP:action-wait-response
May 10, 2025
Merged

jdm merged 1 commit into
servo:mainfrom
PotatoCP:action-wait-response

Conversation

@PotatoCP

@PotatoCP PotatoCP commented May 9, 2025 •

Copy link
Copy Markdown
Contributor

Extend wait_for_script_response() (#35024) for actions.rs

@PotatoCP
PotatoCP force-pushed the action-wait-response branch from d9e77f8 to 2ececfb Compare May 9, 2025 07:46
@xiaochengh

Copy link
Copy Markdown
Contributor

I don't think we should create a duplicate function.

Better to extend the existing wait_for_script_response to allow waiting for other responses and reuse it.

@PotatoCP
PotatoCP force-pushed the action-wait-response branch from 2ececfb to bca0b05 Compare May 9, 2025 09:02
@PotatoCP
PotatoCP force-pushed the action-wait-response branch from bca0b05 to 4d02eee Compare May 9, 2025 09:08
@PotatoCP

PotatoCP commented May 9, 2025

Copy link
Copy Markdown
Contributor Author

I don't think we should create a duplicate function.

Better to extend the existing wait_for_script_response to allow waiting for other responses and reuse it.

Agreed. I have push the change, thanks

Ok(response) => response,
Err(WebDriverError { error, .. }) => return Err(error),
};
if x < 0 || x as f32 > viewport_size.width || y < 0 || y as f32 > viewport_size.height {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure is this would also work:

Suggested change
if x < 0 || x as f32 > viewport_size.width || y < 0 || y as f32 > viewport_size.height {
if x < 0.0 || x > viewport_size.width || y < 0.0 || y > viewport_size.height {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it won't work since x and y is i64, and we compare it with float. Also viewport_size.width and viewport_size.height is still f32.

@jdm
jdm added this pull request to the merge queue May 10, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 10, 2025
@jdm
jdm added this pull request to the merge queue May 10, 2025
Merged via the queue into servo:main with commit 924fd06 May 10, 2025
AmalenduManoj pushed a commit to AmalenduManoj/servo that referenced this pull request May 12, 2025
Extend `wait_for_script_response()`
(servo#35024) for `actions.rs`

Signed-off-by: PotatoCP <[email protected]>
Co-authored-by: PotatoCP <[email protected]>
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.

4 participants