Skip to content

webdriver: Move NewWebView, FocusWebView, GetWindowSize, and SetWindowSize to servoshell#37555

Merged
mrobinson merged 6 commits intoservo:mainfrom
longvatrong111:webdriver-new-webview
Jun 25, 2025
Merged

webdriver: Move NewWebView, FocusWebView, GetWindowSize, and SetWindowSize to servoshell#37555
mrobinson merged 6 commits intoservo:mainfrom
longvatrong111:webdriver-new-webview

Conversation

@longvatrong111
Copy link
Copy Markdown
Contributor

@longvatrong111 longvatrong111 commented Jun 19, 2025

Follow up to: #36714
Moving webdriver context commands to be handled in embedder:

  • New Window command - WebdriverCommandMsg::NewWebView
  • Switch To Window command - WebdriverCommandMsg::FocusWebView
  • Resizing commands

cc: @xiaochengh

@longvatrong111 longvatrong111 requested a review from atbrakhi as a code owner June 19, 2025 10:46
@longvatrong111 longvatrong111 marked this pull request as draft June 19, 2025 10:49
@longvatrong111 longvatrong111 changed the title Moving webdriver NewWebView command to embedder Moving webdriver Contex commands to embedder Jun 19, 2025
@longvatrong111 longvatrong111 force-pushed the webdriver-new-webview branch 2 times, most recently from 4a917e7 to 53ca995 Compare June 23, 2025 08:38
@longvatrong111 longvatrong111 marked this pull request as ready for review June 23, 2025 09:09
@longvatrong111 longvatrong111 requested a review from jschwe as a code owner June 23, 2025 09:09
@longvatrong111 longvatrong111 requested a review from mrobinson June 23, 2025 09:09
@longvatrong111 longvatrong111 force-pushed the webdriver-new-webview branch from 53ca995 to bf424ca Compare June 24, 2025 05:13
Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

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

Looks good. I just have a few minor suggestions:

@mrobinson mrobinson changed the title Moving webdriver Contex commands to embedder webdriver: Move NewWebView, FocusWebView, GetWindowSize, and SetWindowSize to servoshell Jun 24, 2025
@longvatrong111 longvatrong111 force-pushed the webdriver-new-webview branch from c253ab5 to 6fef44c Compare June 24, 2025 18:03
@longvatrong111
Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

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

Looks great! Just one request:

}
},
webdriver_msg @ WebDriverCommandMsg::GetViewportSize(..) => {
running_state.forward_webdriver_command(webdriver_msg);
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.

You should be able to retrieve the size of the viewport here without forwarding the message. The viewport of a WebView is window.rendering_context().size2d(). I think it makes sense to implement this here without forwarding or just waiting to handle this in a followup.

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.

The more I know. It would be faster if we put this change in the follow up, there are some.

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 will make the change here: #37665

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.

Okay. Sounds good. For now, just don't move this message to the embedder yet. I can review the change very quickly.

@mrobinson mrobinson added this pull request to the merge queue Jun 25, 2025
Merged via the queue into servo:main with commit d970584 Jun 25, 2025
21 checks passed
@longvatrong111 longvatrong111 deleted the webdriver-new-webview branch June 25, 2025 15:36
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