refactor(webdriver): move webdriver_port option to servoshell pref (#37867)

Move `webdriver_port` option from servo config options to servoshell
preference.

Testing: run `./mach run` with/without `--webdriver` option and see if
the webdriver server runs on the port (default: 7000)
Fixes: https://github.com/servo/servo/issues/37843

Signed-off-by: Jason Tsai <git@pews.dev>
This commit is contained in:
Jason Tsai 2025-07-04 16:04:49 +09:00 committed by GitHub
parent 6ba54e4d79
commit cf408f7302
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 15 deletions

View file

@ -12,7 +12,7 @@ use euclid::Vector2D;
use keyboard_types::{Key, Modifiers, ShortcutMatcher};
use log::{error, info};
use servo::base::id::WebViewId;
use servo::config::{opts, pref};
use servo::config::pref;
use servo::ipc_channel::ipc::IpcSender;
use servo::webrender_api::ScrollLocation;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntSize};
@ -500,7 +500,7 @@ impl WebViewDelegate for RunningAppState {
// When WebDriver is enabled, do not focus and raise the WebView to the top,
// as that is what the specification expects. Otherwise, we would like `window.open()`
// to create a new foreground tab
if opts::get().webdriver_port.is_none() {
if self.servoshell_preferences.webdriver_port.is_none() {
webview.focus();
webview.raise_to_top(true);
}