webdriver: Reuse JSValue as WebDriverJSValue (#38751)

After #38748, `WebDriverJSValue` is almost same as `JSValue`. Now we
turn "potentially merge into one in the future" into reality. The only
thing we should be cautious is to properly serialize `WebFrame`,
`WebWindow`, `WebElement` for WebDriver.

Testing: No regression. Some error is fixed previously by #38709 which
didn't update test :)
Binary size reduced by 134KB.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-08-19 01:38:48 +08:00 committed by GitHub
parent 7471ad7730
commit ec5872992b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 57 additions and 101 deletions

View file

@ -20,10 +20,9 @@ use servo::webrender_api::ScrollLocation;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntSize};
use servo::{
AllowOrDenyRequest, AuthenticationRequest, FilterPattern, FocusId, FormControl,
GamepadHapticEffectType, KeyboardEvent, LoadStatus, PermissionRequest, Servo, ServoDelegate,
ServoError, SimpleDialog, TraversalId, WebDriverCommandMsg, WebDriverJSResult,
WebDriverJSValue, WebDriverLoadStatus, WebDriverUserPrompt, WebView, WebViewBuilder,
WebViewDelegate,
GamepadHapticEffectType, JSValue, KeyboardEvent, LoadStatus, PermissionRequest, Servo,
ServoDelegate, ServoError, SimpleDialog, TraversalId, WebDriverCommandMsg, WebDriverJSResult,
WebDriverLoadStatus, WebDriverUserPrompt, WebView, WebViewBuilder, WebViewDelegate,
};
use url::Url;
@ -500,8 +499,10 @@ impl RunningAppState {
.borrow()
.script_evaluation_interrupt_sender
{
sender.send(Ok(WebDriverJSValue::Null)).unwrap_or_else(|err| {
info!("Notify dialog appear failed. Maybe the channel to webdriver is closed: {err}");
sender.send(Ok(JSValue::Null)).unwrap_or_else(|err| {
info!(
"Notify dialog appear failed. Maybe the channel to webdriver is closed: {err}"
);
});
}
}