browser(firefox): implement Page.bringToFront (#3051)

This commit is contained in:
Pavel Feldman 2020-07-20 16:47:27 -07:00 committed by GitHub
parent eb14c4711f
commit 726f636b5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 2 deletions

View file

@ -1,2 +1,2 @@
1133
Changed: yurys@chromium.org Mon Jul 20 14:11:12 PDT 2020
1134
Changed: pavel.feldman@gmail.com Mon Jul 20 15:11:16 PDT 2020

View file

@ -179,6 +179,10 @@ class PageHandler {
return await this._contentPage.send('setEmulatedMedia', options);
}
async bringToFront(options) {
this._pageTarget._window.focus();
}
async setCacheDisabled(options) {
return await this._contentPage.send('setCacheDisabled', options);
}

View file

@ -654,6 +654,10 @@ const Page = {
viewportSize: t.Nullable(pageTypes.Size),
},
},
'bringToFront': {
params: {
},
},
'setEmulatedMedia': {
params: {
type: t.Optional(t.Enum(['screen', 'print', ''])),

View file

@ -651,6 +651,21 @@ index e268e2bbe8add1b43f6e4d6507cc7810d707a344..a34a7a292a02ea8d94042475a43ae3a0
dom::MediaCapabilities* MediaCapabilities();
dom::MediaSession* MediaSession();
diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp
index 7fd3b0069dfd8159818c0f80d0c1cee901ce074a..77f08fb399145302677d36003884e9d775cc4e44 100644
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2649,7 +2649,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow,
}
}
- if (sTestMode) {
+ // In Playwright, we still want to execte the embedder functions
+ // to actually show / focus windows.
+ if (false && sTestMode) {
// In test mode, emulate raising the window. WindowRaised takes
// care of lowering the present active window. This happens in
// a separate runnable to avoid touching multiple windows in
diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp
index da9d56e843a2c762dc7d5527712cdd3d30418f7f..aa3d2d6022b60ac3a263c2d1df4eb12714d8e728 100644
--- a/dom/base/nsGlobalWindowOuter.cpp