Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 661db3a

Browse files
author
Oana Pop Rus
committed
Backed out 7 changesets (bug 1432856) for build bustages failures in nsWindow.h on a CLOSED TREE
Backed out changeset 3d08c3cce533 (bug 1432856) Backed out changeset 49d03dd89b17 (bug 1432856) Backed out changeset 62fc84c8ce99 (bug 1432856) Backed out changeset a8a4fa63f5b2 (bug 1432856) Backed out changeset c81f3d5b9bf3 (bug 1432856) Backed out changeset 8351a8b1d96a (bug 1432856) Backed out changeset a303b775a51b (bug 1432856)
1 parent b49aefd commit 661db3a

68 files changed

Lines changed: 116 additions & 511 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
[DEFAULT]
22
support-files =
33
head.js
4-
open_and_focus_helper.html
54
[browser_bug1557041.js]
65
skip-if = os == 'linux' # Bug 1561973
76
[browser_fullscreen_permissions_prompt.js]
87
skip-if = debug && os == 'mac' # Bug 1568570
98
[browser_fullscreen_cross_origin.js]
109
support-files = fullscreen.html fullscreen_frame.html
11-
[browser_fullscreen_window_open.js]
12-
skip-if = debug && os == 'mac' # Bug 1568570
13-
[browser_fullscreen_window_focus.js]
14-
skip-if = debug && os == 'mac' # Bug 1568570

browser/base/content/test/fullscreen/browser_fullscreen_window_focus.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

browser/base/content/test/fullscreen/browser_fullscreen_window_open.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

browser/base/content/test/fullscreen/head.js

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { ContentTaskUtils } = ChromeUtils.import(
22
"resource://testing-common/ContentTaskUtils.jsm"
33
);
44
function waitForFullScreenState(browser, state) {
5+
info("inside waitforfullscreenstate");
56
return new Promise(resolve => {
67
let eventReceived = false;
78

@@ -14,7 +15,7 @@ function waitForFullScreenState(browser, state) {
1415
};
1516
Services.obs.addObserver(observe, "fullscreen-painted");
1617

17-
browser.ownerGlobal.addEventListener(
18+
window.addEventListener(
1819
`MozDOMFullscreen:${state ? "Entered" : "Exited"}`,
1920
() => {
2021
eventReceived = true;
@@ -49,78 +50,3 @@ async function changeFullscreen(browser, fullScreenState) {
4950
});
5051
return fullScreenChange;
5152
}
52-
53-
async function testExpectFullScreenExit(browser, leaveFS, action) {
54-
let fsPromise = waitForFullScreenState(browser, !leaveFS);
55-
if (leaveFS) {
56-
if (action) {
57-
await action();
58-
}
59-
await fsPromise;
60-
ok(true, "Should leave full-screen");
61-
} else {
62-
if (action) {
63-
await action();
64-
}
65-
let result = await Promise.race([
66-
fsPromise,
67-
new Promise(resolve => {
68-
SimpleTest.requestFlakyTimeout("Wait for failure condition");
69-
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
70-
setTimeout(() => resolve(true), 2500);
71-
}),
72-
]);
73-
ok(result, "Should not leave full-screen");
74-
}
75-
}
76-
77-
function jsWindowFocus(browser, iframeId) {
78-
return ContentTask.spawn(browser, { iframeId }, async args => {
79-
let destWin = content;
80-
if (args.iframeId) {
81-
let iframe = content.document.getElementById(args.iframeId);
82-
if (!iframe) {
83-
throw new Error("iframe not set");
84-
}
85-
destWin = iframe.contentWindow;
86-
}
87-
await content.wrappedJSObject.sendMessage(destWin, "focus");
88-
});
89-
}
90-
91-
async function jsWindowOpen(browser, iframeId) {
92-
let windowOpened = BrowserTestUtils.waitForNewWindow();
93-
ContentTask.spawn(browser, { iframeId }, async args => {
94-
let destWin = content;
95-
if (args.iframeId) {
96-
// Create a cross origin iframe
97-
destWin = (await content.wrappedJSObject.createIframe(
98-
args.iframeId,
99-
true
100-
)).contentWindow;
101-
}
102-
// Send message to either the iframe or the current page to open a popup
103-
await content.wrappedJSObject.sendMessage(destWin, "open");
104-
});
105-
return windowOpened;
106-
}
107-
108-
function waitForFocus(...args) {
109-
return new Promise(resolve => SimpleTest.waitForFocus(resolve, ...args));
110-
}
111-
112-
function waitForBrowserWindowActive(win) {
113-
return new Promise(resolve => {
114-
if (Services.focus.activeWindow == win) {
115-
resolve();
116-
} else {
117-
win.addEventListener(
118-
"activate",
119-
() => {
120-
resolve();
121-
},
122-
{ once: true }
123-
);
124-
}
125-
});
126-
}

browser/base/content/test/fullscreen/open_and_focus_helper.html

Lines changed: 0 additions & 44 deletions
This file was deleted.

docshell/base/BrowsingContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ nsresult BrowsingContext::InternalLoad(BrowsingContext* aAccessor,
948948
// the same as how the tab first opened.
949949
nsCOMPtr<nsPIDOMWindowOuter> domWin = GetDOMWindow();
950950
if (isActive && domWin) {
951-
nsFocusManager::FocusWindow(domWin, CallerType::System);
951+
nsFocusManager::FocusWindow(domWin);
952952
}
953953

954954
// Else we ran out of memory, or were a popup and got blocked,
@@ -1022,11 +1022,11 @@ void BrowsingContext::Close(CallerType aCallerType, ErrorResult& aError) {
10221022
}
10231023
}
10241024

1025-
void BrowsingContext::Focus(CallerType aCallerType, ErrorResult& aError) {
1025+
void BrowsingContext::Focus(ErrorResult& aError) {
10261026
if (ContentChild* cc = ContentChild::GetSingleton()) {
1027-
cc->SendWindowFocus(this, aCallerType);
1027+
cc->SendWindowFocus(this);
10281028
} else if (ContentParent* cp = Canonical()->GetContentParent()) {
1029-
Unused << cp->SendWindowFocus(this, aCallerType);
1029+
Unused << cp->SendWindowFocus(this);
10301030
}
10311031
}
10321032

docshell/base/BrowsingContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class BrowsingContext : public nsISupports,
388388
ErrorResult& aError);
389389
void Close(CallerType aCallerType, ErrorResult& aError);
390390
bool GetClosed(ErrorResult&) { return mClosed; }
391-
void Focus(CallerType aCallerType, ErrorResult& aError);
391+
void Focus(ErrorResult& aError);
392392
void Blur(ErrorResult& aError);
393393
WindowProxyHolder GetFrames(ErrorResult& aError);
394394
int32_t Length() const { return mChildren.Length(); }

docshell/base/nsDSURIContentListener.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType,
196196
nsCOMPtr<nsPIDOMWindowOuter> domWindow =
197197
mDocShell ? mDocShell->GetWindow() : nullptr;
198198
NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
199-
domWindow->Focus(mozilla::dom::CallerType::System);
199+
domWindow->Focus();
200200
}
201201

202202
return NS_OK;

dom/base/Document.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11563,7 +11563,7 @@ class nsAutoFocusEvent : public Runnable {
1156311563

1156411564
FocusOptions options;
1156511565
ErrorResult rv;
11566-
mElement->Focus(options, CallerType::System, rv);
11566+
mElement->Focus(options, rv);
1156711567
return rv.StealNSResult();
1156811568
}
1156911569

dom/base/Element.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ int32_t Element::TabIndex() {
336336
return TabIndexDefault();
337337
}
338338

339-
void Element::Focus(const FocusOptions& aOptions, CallerType aCallerType,
340-
ErrorResult& aError) {
339+
void Element::Focus(const FocusOptions& aOptions, ErrorResult& aError) {
341340
nsFocusManager* fm = nsFocusManager::GetFocusManager();
342341
// Also other browsers seem to have the hack to not re-focus (and flush) when
343342
// the element is already focused.
@@ -349,13 +348,9 @@ void Element::Focus(const FocusOptions& aOptions, CallerType aCallerType,
349348
if (fm->CanSkipFocus(this)) {
350349
fm->NeedsFlushBeforeEventHandling(this);
351350
} else {
352-
uint32_t fmFlags =
353-
nsIFocusManager::FLAG_BYELEMENTFOCUS |
354-
nsFocusManager::FocusOptionsToFocusManagerFlags(aOptions);
355-
if (aCallerType == CallerType::NonSystem) {
356-
fmFlags = nsIFocusManager::FLAG_NONSYSTEMCALLER | fmFlags;
357-
}
358-
aError = fm->SetFocus(this, fmFlags);
351+
aError = fm->SetFocus(
352+
this, nsIFocusManager::FLAG_BYELEMENTFOCUS |
353+
nsFocusManager::FocusOptionsToFocusManagerFlags(aOptions));
359354
}
360355
}
361356
}

0 commit comments

Comments
 (0)