Skip to content

Commit 726f636

Browse files
authored
browser(firefox): implement Page.bringToFront (#3051)
1 parent eb14c47 commit 726f636

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

browser_patches/firefox/BUILD_NUMBER

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1133
2-
Changed: [email protected] Mon Jul 20 14:11:12 PDT 2020
1+
1134
2+
Changed: [email protected] Mon Jul 20 15:11:16 PDT 2020

browser_patches/firefox/juggler/protocol/PageHandler.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ class PageHandler {
179179
return await this._contentPage.send('setEmulatedMedia', options);
180180
}
181181

182+
async bringToFront(options) {
183+
this._pageTarget._window.focus();
184+
}
185+
182186
async setCacheDisabled(options) {
183187
return await this._contentPage.send('setCacheDisabled', options);
184188
}

browser_patches/firefox/juggler/protocol/Protocol.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@ const Page = {
654654
viewportSize: t.Nullable(pageTypes.Size),
655655
},
656656
},
657+
'bringToFront': {
658+
params: {
659+
},
660+
},
657661
'setEmulatedMedia': {
658662
params: {
659663
type: t.Optional(t.Enum(['screen', 'print', ''])),

browser_patches/firefox/patches/bootstrap.diff

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,21 @@ index e268e2bbe8add1b43f6e4d6507cc7810d707a344..a34a7a292a02ea8d94042475a43ae3a0
651651

652652
dom::MediaCapabilities* MediaCapabilities();
653653
dom::MediaSession* MediaSession();
654+
diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp
655+
index 7fd3b0069dfd8159818c0f80d0c1cee901ce074a..77f08fb399145302677d36003884e9d775cc4e44 100644
656+
--- a/dom/base/nsFocusManager.cpp
657+
+++ b/dom/base/nsFocusManager.cpp
658+
@@ -2649,7 +2649,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow,
659+
}
660+
}
661+
662+
- if (sTestMode) {
663+
+ // In Playwright, we still want to execte the embedder functions
664+
+ // to actually show / focus windows.
665+
+ if (false && sTestMode) {
666+
// In test mode, emulate raising the window. WindowRaised takes
667+
// care of lowering the present active window. This happens in
668+
// a separate runnable to avoid touching multiple windows in
654669
diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp
655670
index da9d56e843a2c762dc7d5527712cdd3d30418f7f..aa3d2d6022b60ac3a263c2d1df4eb12714d8e728 100644
656671
--- a/dom/base/nsGlobalWindowOuter.cpp

0 commit comments

Comments
 (0)