mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
webdriver: Raise WebView
to top when focus (#38909)
- Add a helper function `focus_and_raise_to_top` to `WebView`. - For webdriver, raise webview to top when focus, to make it consistent with user interaction. Testing: Should reduce some flaky TIMEOUT when combined with another PR later. Fixes: A small patch before the PR for #38906. --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
01a9b317d4
commit
8683f97fcc
6 changed files with 14 additions and 16 deletions
|
@ -120,8 +120,7 @@ impl RunningAppState {
|
|||
|
||||
pub(crate) fn create_and_focus_toplevel_webview(self: &Rc<Self>, url: Url) {
|
||||
let webview = self.create_toplevel_webview(url);
|
||||
webview.focus();
|
||||
webview.raise_to_top(true);
|
||||
webview.focus_and_raise_to_top(true);
|
||||
}
|
||||
|
||||
pub(crate) fn create_toplevel_webview(self: &Rc<Self>, url: Url) -> WebView {
|
||||
|
@ -634,8 +633,7 @@ impl WebViewDelegate for RunningAppState {
|
|||
// as that is what the specification expects. Otherwise, we would like `window.open()`
|
||||
// to create a new foreground tab
|
||||
if self.servoshell_preferences.webdriver_port.is_none() {
|
||||
webview.focus();
|
||||
webview.raise_to_top(true);
|
||||
webview.focus_and_raise_to_top(true);
|
||||
}
|
||||
self.add(webview.clone());
|
||||
Some(webview)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue