Bug 1617254: Rename BrowsingContext.getChildren() to .children. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D63699

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kris Maglione 2020-02-25 22:33:53 +00:00
parent 7c279073ca
commit f3354d4788
44 changed files with 107 additions and 104 deletions

View File

@ -21,7 +21,7 @@ addAccessibleTask(
ok(iframeDocAcc, "IFRAME document accessible is present");
(gIsRemoteIframe ? isnot : is)(
browser.browsingContext.currentWindowGlobal.osPid,
browser.browsingContext.getChildren()[0].currentWindowGlobal.osPid,
browser.browsingContext.children[0].currentWindowGlobal.osPid,
`Content and IFRAME documents are in ${
gIsRemoteIframe ? "separate processes" : "same process"
}.`

View File

@ -58,35 +58,35 @@ addAccessibleTask(
if (gIsRemoteIframe) {
isnot(
getOsPid(browser.browsingContext),
getOsPid(browser.browsingContext.getChildren()[0]),
getOsPid(browser.browsingContext.children[0]),
`Content and IFRAME documents are in separate processes.`
);
isnot(
getOsPid(browser.browsingContext),
getOsPid(browser.browsingContext.getChildren()[0].getChildren()[0]),
getOsPid(browser.browsingContext.children[0].children[0]),
`Content and nested IFRAME documents are in separate processes.`
);
isnot(
getOsPid(browser.browsingContext.getChildren()[0]),
getOsPid(browser.browsingContext.getChildren()[0].getChildren()[0]),
getOsPid(browser.browsingContext.children[0]),
getOsPid(browser.browsingContext.children[0].children[0]),
`IFRAME and nested IFRAME documents are in separate processes.`
);
} else {
is(
getOsPid(browser.browsingContext),
getOsPid(browser.browsingContext.getChildren()[0]),
getOsPid(browser.browsingContext.children[0]),
`Content and IFRAME documents are in same processes.`
);
if (gFissionBrowser) {
isnot(
getOsPid(browser.browsingContext.getChildren()[0]),
getOsPid(browser.browsingContext.getChildren()[0].getChildren()[0]),
getOsPid(browser.browsingContext.children[0]),
getOsPid(browser.browsingContext.children[0].children[0]),
`IFRAME and nested IFRAME documents are in separate processes.`
);
} else {
is(
getOsPid(browser.browsingContext),
getOsPid(browser.browsingContext.getChildren()[0].getChildren()[0]),
getOsPid(browser.browsingContext.children[0].children[0]),
`Content and nested IFRAME documents are in same processes.`
);
}

View File

@ -7629,7 +7629,7 @@ var gPageStyleMenu = {
let actor = global.getActor("PageStyle");
actor.sendAsyncMessage(message, data);
contextsToVisit.push(...currentContext.getChildren());
contextsToVisit.push(...currentContext.children);
}
},
@ -8457,7 +8457,7 @@ function ReportFalseDeceptiveSite() {
});
}
contextsToVisit.push(...currentContext.getChildren());
contextsToVisit.push(...currentContext.children);
}
}

View File

@ -387,7 +387,7 @@ async function loadPageInfo(browsingContext, imageElement, browser) {
addImage(item);
}
selectImage();
contextsToVisit.push(...currContext.getChildren());
contextsToVisit.push(...currContext.children);
}
/* Call registered overlay init functions */

View File

@ -39,7 +39,7 @@ add_task(async function checkReturnToAboutHome() {
info("Clicking the go back button on about:certerror");
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
let locationChangePromise = BrowserTestUtils.waitForLocationChange(
gBrowser,
@ -114,7 +114,7 @@ add_task(async function checkReturnToPreviousPage() {
info("Clicking the go back button on about:certerror");
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
let pageShownPromise = BrowserTestUtils.waitForContentEvent(
@ -159,7 +159,7 @@ add_task(async function checkAdvancedDetails() {
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
let message = await SpecialPowers.spawn(bc, [], async function() {
@ -246,7 +246,7 @@ add_task(async function checkAdvancedDetailsForHSTS() {
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
let message = await SpecialPowers.spawn(bc, [], async function() {
@ -335,7 +335,7 @@ add_task(async function checkUnknownIssuerLearnMoreLink() {
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
let href = await SpecialPowers.spawn(bc, [], async function() {
@ -356,7 +356,7 @@ add_task(async function checkCautionClass() {
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
await SpecialPowers.spawn(bc, [useFrame], async function(subFrame) {
@ -397,7 +397,7 @@ add_task(async function checkViewCertificate() {
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
let loaded = BrowserTestUtils.waitForNewTab(gBrowser, null, true);
@ -462,7 +462,7 @@ add_task(async function checkBadStsCertHeadline() {
let bc = browser.browsingContext;
if (useFrame) {
bc = bc.getChildren()[0];
bc = bc.children[0];
}
let titleContent = await SpecialPowers.spawn(bc, [], async function() {
@ -493,7 +493,7 @@ add_task(async function checkSandboxedIframe() {
let tab = await openErrorPage(BAD_CERT, useFrame, sandboxed);
let browser = tab.linkedBrowser;
let bc = browser.browsingContext.getChildren()[0];
let bc = browser.browsingContext.children[0];
await SpecialPowers.spawn(bc, [], async function() {
let doc = content.document;
let titleText = doc.querySelector(".title-text");

View File

@ -139,7 +139,7 @@ add_task(async function() {
let browsingContext = gBrowser.selectedBrowser.browsingContext;
if (test.frameIndex != null) {
browsingContext = browsingContext.getChildren()[test.frameIndex];
browsingContext = browsingContext.children[test.frameIndex];
}
await new Promise(r => {

View File

@ -188,7 +188,7 @@ add_task(async function test_alt_click_in_frame() {
await BrowserTestUtils.synthesizeMouseAtCenter(
"#linkToExample",
{ altKey: true },
gBrowser.selectedBrowser.browsingContext.getChildren()[0]
gBrowser.selectedBrowser.browsingContext.children[0]
);
// Wait for all downloads to be added to the download list.

View File

@ -31,7 +31,7 @@ add_task(async function test_toplevel_frame_permission() {
});
// Show a plugin notification from the iframe's actor:
let { currentWindowGlobal } = browser.browsingContext.getChildren()[0];
let { currentWindowGlobal } = browser.browsingContext.children[0];
let actor = currentWindowGlobal.getActor("Plugin");
const kHost = Cc["@mozilla.org/plugin/host;1"].getService(
Ci.nsIPluginHost

View File

@ -63,9 +63,7 @@ add_task(async function test() {
is(securityInfo, null, "Found no security info");
// Get the info of the frame, which is HTTPS.
securityInfo = await browser.browsingContext
.getChildren()[0]
.currentWindowGlobal.getSecurityInfo();
securityInfo = await browser.browsingContext.children[0].currentWindowGlobal.getSecurityInfo();
securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
ok(securityInfo, "Found some security info");
ok(securityInfo.succeededCertChain, "Has a succeeded cert chain");

View File

@ -16,7 +16,7 @@ var gTests = [
desc: "getUserMedia audio+video",
run: async function checkAudioVideo() {
let frame1BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[0]
? gBrowser.selectedBrowser.browsingContext.children[0]
: undefined;
let observerPromise = expectObserverCalled(
@ -73,7 +73,7 @@ var gTests = [
desc: "getUserMedia audio+video: stop sharing",
run: async function checkStopSharing() {
let frame1BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[0]
? gBrowser.selectedBrowser.browsingContext.children[0]
: undefined;
let observerPromise = expectObserverCalled(
@ -148,7 +148,7 @@ var gTests = [
"getUserMedia audio+video: reloading the frame removes all sharing UI",
run: async function checkReloading() {
let frame1BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[0]
? gBrowser.selectedBrowser.browsingContext.children[0]
: undefined;
let observerPromise = expectObserverCalled(
@ -209,7 +209,7 @@ var gTests = [
desc: "getUserMedia audio+video: reloading the frame removes prompts",
run: async function checkReloadingRemovesPrompts() {
let frame1BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[0]
? gBrowser.selectedBrowser.browsingContext.children[0]
: undefined;
let observerPromise = expectObserverCalled(
@ -247,7 +247,7 @@ var gTests = [
// The WebRTC UI should still show both video and audio indicators.
let frame1BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[0]
? gBrowser.selectedBrowser.browsingContext.children[0]
: undefined;
let observerPromise = expectObserverCalled(
@ -289,7 +289,7 @@ var gTests = [
// Check that requesting a new device from a different frame
// doesn't override sharing UI.
let frame2BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[1]
? gBrowser.selectedBrowser.browsingContext.children[1]
: undefined;
observerPromise = expectObserverCalled(
@ -358,7 +358,7 @@ var gTests = [
// second frame, then reload the second frame. After each step, we'll check
// the UI is in the correct state.
let frame1BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[0]
? gBrowser.selectedBrowser.browsingContext.children[0]
: undefined;
let observerPromise = expectObserverCalled(
@ -398,7 +398,7 @@ var gTests = [
await checkSharingUI({ video: true, audio: false });
let frame2BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[1]
? gBrowser.selectedBrowser.browsingContext.children[1]
: undefined;
observerPromise = expectObserverCalled(
@ -463,7 +463,7 @@ var gTests = [
"getUserMedia audio+video: reloading the top level page removes all sharing UI",
run: async function checkReloading() {
let frame1BC = gShouldObserveSubframes
? gBrowser.selectedBrowser.browsingContext.getChildren()[0]
? gBrowser.selectedBrowser.browsingContext.children[0]
: undefined;
let observerPromise = expectObserverCalled(

View File

@ -378,7 +378,7 @@ async function getMediaCaptureState() {
function gatherBrowsingContexts(aBrowsingContext) {
let list = [aBrowsingContext];
let children = aBrowsingContext.getChildren();
let children = aBrowsingContext.children;
for (let child of children) {
list.push(...gatherBrowsingContexts(child));
}

View File

@ -42,7 +42,7 @@ add_task(async function test_sitespecific_iframe_global_zoom() {
is(loadedURL, TEST_IFRAME_URL, "got the load event for the iframe");
let frameZoom = await SpecialPowers.spawn(
gBrowser.selectedBrowser.browsingContext.getChildren()[0],
gBrowser.selectedBrowser.browsingContext.children[0],
[],
async () => {
await ContentTaskUtils.waitForCondition(() => {
@ -94,7 +94,7 @@ add_task(async function test_sitespecific_global_zoom_enlarge() {
is(ZoomManager.getZoomForBrowser(tabBrowser), 0.8, "Local zoom is increased");
let frameZoom = await SpecialPowers.spawn(
gBrowser.selectedBrowser.browsingContext.getChildren()[0],
gBrowser.selectedBrowser.browsingContext.children[0],
[],
async () => {
await ContentTaskUtils.waitForCondition(() => {

View File

@ -35,7 +35,7 @@ function gatherActors(browsingContext) {
list.push({ actor, result: null });
}
let children = browsingContext.getChildren();
let children = browsingContext.children;
for (let child of children) {
list.push(...gatherActors(child));
}

View File

@ -247,9 +247,8 @@ add_task(async function testFind() {
let { top, left } = rectData[5].rectsAndTexts.rectList[0];
await extension.unload();
let subFrameBrowsingContext = gBrowser.selectedBrowser.browsingContext
.getChildren()[0]
.getChildren()[1];
let subFrameBrowsingContext =
gBrowser.selectedBrowser.browsingContext.children[0].children[1];
let result = await SpecialPowers.spawn(
subFrameBrowsingContext,
[],
@ -331,9 +330,8 @@ add_task(async function testRemoveHighlighting() {
await extension.awaitMessage("test:find:WebExtensionFinished");
await extension.unload();
let subFrameBrowsingContext = gBrowser.selectedBrowser.browsingContext
.getChildren()[0]
.getChildren()[1];
let subFrameBrowsingContext =
gBrowser.selectedBrowser.browsingContext.children[0].children[1];
let result = await SpecialPowers.spawn(
subFrameBrowsingContext,
[],

View File

@ -141,7 +141,7 @@ add_task(
BrowserTestUtils.synthesizeMouseAtCenter(
"#test-create-new-tab-from-mouse-click-subframe",
{ ctrlKey: true, metaKey: true },
tab.linkedBrowser.browsingContext.getChildren()[0]
tab.linkedBrowser.browsingContext.children[0]
);
},
expectedWebNavProps: {
@ -159,7 +159,7 @@ add_task(
BrowserTestUtils.synthesizeMouseAtCenter(
"#test-create-new-window-from-mouse-click-subframe",
{ shiftKey: true },
tab.linkedBrowser.browsingContext.getChildren()[0]
tab.linkedBrowser.browsingContext.children[0]
);
},
expectedWebNavProps: {
@ -177,7 +177,7 @@ add_task(
BrowserTestUtils.synthesizeMouseAtCenter(
"#test-create-new-tab-from-targetblank-click-subframe",
{},
tab.linkedBrowser.browsingContext.getChildren()[0]
tab.linkedBrowser.browsingContext.children[0]
);
},
expectedWebNavProps: {

View File

@ -499,7 +499,7 @@ async function openContextMenuInFrame(selector = "body", frameIndex = 0) {
await BrowserTestUtils.synthesizeMouseAtCenter(
selector,
{ type: "contextmenu" },
gBrowser.selectedBrowser.browsingContext.getChildren()[frameIndex]
gBrowser.selectedBrowser.browsingContext.children[frameIndex]
);
await popupShownPromise;
return contentAreaContextMenu;

View File

@ -24,7 +24,7 @@ add_task(async function test_iframe_autocomplete() {
true
);
let browser = tab.linkedBrowser;
let iframeBC = browser.browsingContext.getChildren()[1];
let iframeBC = browser.browsingContext.children[1];
await openPopupForSubframe(browser, iframeBC, "#street-address");
// Highlight the first item in the list. We want to verify
@ -115,7 +115,7 @@ add_task(async function test_iframe_autocomplete_preferences() {
true
);
let browser = tab.linkedBrowser;
let iframeBC = browser.browsingContext.getChildren()[1];
let iframeBC = browser.browsingContext.children[1];
await openPopupForSubframe(browser, iframeBC, "#organization");
await expectWarningText(browser, "Also autofills address, email");

View File

@ -173,7 +173,7 @@ add_task(async function test_submit_untouched_creditCard_form_iframe() {
await BrowserTestUtils.withNewTab(
{ gBrowser, url: CREDITCARD_FORM_IFRAME_URL },
async function(browser) {
let iframeBC = browser.browsingContext.getChildren()[0];
let iframeBC = browser.browsingContext.children[0];
await openPopupForSubframe(browser, iframeBC, "form #cc-name");
EventUtils.synthesizeKey("VK_DOWN", {});
EventUtils.synthesizeKey("VK_RETURN", {});

View File

@ -613,8 +613,7 @@ exports.RootActor = protocol.ActorClassWithSpec(rootSpec, {
// a different type, we can just get the children directly from
// the BrowsingContext.
return (
parentBrowsingContext
.getChildren()
parentBrowsingContext.children
// For now, we only return the "remote frames".
// i.e. the frames which are in a distinct process compared to their parent document
.filter(browsingContext => {
@ -647,7 +646,7 @@ exports.RootActor = protocol.ActorClassWithSpec(rootSpec, {
}
pool.manage(frameDescriptor);
frames.push(frameDescriptor);
contextsToWalk.push(...currentContext.getChildren());
contextsToWalk.push(...currentContext.children);
}
// Do not destroy the pool before transfering ownership to the newly created
// pool, so that we do not accidently destroy actors that are still in use.

View File

@ -383,7 +383,13 @@ void BrowsingContext::Attach(bool aFromIPC) {
MOZ_DIAGNOSTIC_ASSERT(!mGroup->IsContextCached(this));
MOZ_DIAGNOSTIC_ASSERT(!mIsDiscarded);
auto* children = mParent ? &mParent->mChildren : &mGroup->Toplevels();
Children* children = nullptr;
if (mParent) {
children = &mParent->mChildren;
BrowsingContext_Binding::ClearCachedChildrenValue(mParent);
} else {
children = &mGroup->Toplevels();
}
MOZ_DIAGNOSTIC_ASSERT(!children->Contains(this));
children->AppendElement(this);
@ -423,6 +429,7 @@ void BrowsingContext::Detach(bool aFromIPC) {
Children* children = nullptr;
if (mParent) {
children = &mParent->mChildren;
BrowsingContext_Binding::ClearCachedChildrenValue(mParent);
} else {
children = &mGroup->Toplevels();
}
@ -433,6 +440,7 @@ void BrowsingContext::Detach(bool aFromIPC) {
if (!mChildren.IsEmpty()) {
mGroup->CacheContexts(mChildren);
mChildren.Clear();
BrowsingContext_Binding::ClearCachedChildrenValue(this);
}
{
@ -521,6 +529,7 @@ void BrowsingContext::CacheChildren(bool aFromIPC) {
mGroup->CacheContexts(mChildren);
mChildren.Clear();
BrowsingContext_Binding::ClearCachedChildrenValue(this);
if (!aFromIPC && XRE_IsContentProcess()) {
auto cc = ContentChild::GetSingleton();
@ -542,6 +551,7 @@ void BrowsingContext::RestoreChildren(Children&& aChildren, bool aFromIPC) {
}
mChildren.AppendElements(aChildren);
BrowsingContext_Binding::ClearCachedChildrenValue(this);
if (!aFromIPC && XRE_IsContentProcess()) {
auto cc = ContentChild::GetSingleton();

View File

@ -653,6 +653,8 @@ class BrowsingContext : public nsISupports, public nsWrapperCache {
RefPtr<BrowsingContextGroup> mGroup;
RefPtr<BrowsingContext> mParent;
// Note: BrowsingContext_Binding::ClearCachedChildrenValue must be called any
// time this array is mutated to keep the JS-exposed reflection in sync.
Children mChildren;
nsCOMPtr<nsIDocShell> mDocShell;

View File

@ -106,7 +106,7 @@ add_task(async function() {
await removeFrame(browser, "frame2");
is(browsingContext1.getChildren().indexOf(browsingContext2), -1);
is(browsingContext1.children.indexOf(browsingContext2), -1);
// TODO(farre): Handle browsingContext removal [see Bug 1486719].
todo_isnot(browsingContext2.parent, browsingContext1);
@ -190,7 +190,7 @@ add_task(async function() {
"BF cached BC's have same id"
);
is(
win.docShell.browsingContext.getChildren()[0],
win.docShell.browsingContext.children[0],
frameBC,
"BF cached BC's should still be a child of its parent"
);

View File

@ -20,7 +20,8 @@ interface BrowsingContext {
readonly attribute BrowsingContext top;
sequence<BrowsingContext> getChildren();
[Cached, Frozen, Pure]
readonly attribute sequence<BrowsingContext> children;
readonly attribute nsIDocShell? docShell;

View File

@ -399,7 +399,7 @@ However, if any of the frames on the page are running in their own process, they
let actor = global.getActor("PageInfo");
actor.sendAsyncMessage("PageInfo:getInfoForFrame", { someArgument: 123 });
contextsToVisit.push(...currentContext.getChildren());
contextsToVisit.push(...currentContext.children);
}
The original ``"PageInfo:info"`` message listener will need to be updated, too. Any responses from the ``PageInfoChild`` actor will end up being passed to the ``receiveMessage`` method of the ``PageInfoParent`` actor. It will be necessary to pass that information along to the interested party (in this case, the dialog code which is showing the table of interesting Page Info).

View File

@ -60,7 +60,7 @@ async function openPage(shouldClick) {
await BrowserTestUtils.loadURI(browser, PAGE_URL);
await BrowserTestUtils.browserLoaded(browser);
let frameBC = browser.browsingContext.getChildren()[0];
let frameBC = browser.browsingContext.children[0];
if (shouldClick) {
await BrowserTestUtils.synthesizeMouse("body", 2, 2, {}, frameBC);
}

View File

@ -18,7 +18,7 @@ class ReftestFissionParent extends JSWindowActorParent {
}
}
for (let context of browsingContext.getChildren()) {
for (let context of browsingContext.children) {
this.tellChildrenToFlushRenderingRecursive(context, ignoreThrottledAnimations, promises);
}
}
@ -39,7 +39,7 @@ class ReftestFissionParent extends JSWindowActorParent {
}
}
for (let context of browsingContext.getChildren()) {
for (let context of browsingContext.children) {
this.tellChildrenToUpdateLayerTreeRecursive(context, promises);
}
}

View File

@ -99,12 +99,10 @@ add_task(async function mouse_in_iframe() {
5,
10,
{},
browser.browsingContext.getChildren()[0]
browser.browsingContext.children[0]
);
let details = await getLastEventDetails(
browser.browsingContext.getChildren()[0]
);
let details = await getLastEventDetails(browser.browsingContext.children[0]);
is(details, "two", "synthesizeMouse");
await BrowserTestUtils.synthesizeMouse(
@ -112,9 +110,9 @@ add_task(async function mouse_in_iframe() {
5,
10,
{},
browser.browsingContext.getChildren()[1]
browser.browsingContext.children[1]
);
details = await getLastEventDetails(browser.browsingContext.getChildren()[1]);
details = await getLastEventDetails(browser.browsingContext.children[1]);
is(details, "four", "synthesizeMouse");
gBrowser.removeTab(tab);

View File

@ -346,7 +346,7 @@ class AutoScrollChild extends JSWindowActorChild {
let data = msg.data;
switch (msg.name) {
case "Autoscroll:MaybeStart":
for (let child of this.browsingContext.getChildren()) {
for (let child of this.browsingContext.children) {
if (data.browsingContextId == child.id) {
this.startScroll({
screenX: data.screenX,

View File

@ -267,7 +267,7 @@ var PermitUnloader = {
roots.push(windowGlobal);
}
contextsToWalk.push(...currentContext.getChildren());
contextsToWalk.push(...currentContext.children);
}
return roots;

View File

@ -55,7 +55,7 @@ class PopupBlocker {
let popupCountForGlobal =
this._allBlockedPopupCounts.get(windowGlobal) || 0;
totalBlockedPopups += popupCountForGlobal;
contextsToVisit.push(...currentBC.getChildren());
contextsToVisit.push(...currentBC.children);
}
return totalBlockedPopups;
@ -112,7 +112,7 @@ class PopupBlocker {
}
}
contextsToVisit.push(...currentBC.getChildren());
contextsToVisit.push(...currentBC.children);
}
return result;

View File

@ -71,7 +71,7 @@ add_task(async function test_iframe_in_http_autofill() {
await formFilled;
let [username, password] = await SpecialPowers.spawn(
gBrowser.selectedBrowser.browsingContext.getChildren()[0],
gBrowser.selectedBrowser.browsingContext.children[0],
[],
async function() {
let doc = this.content.document;

View File

@ -40,7 +40,7 @@ add_task(async function test_context_menu_iframe_fill() {
browser,
"#form-basic-password",
() => true,
browser.browsingContext.getChildren()[0]
browser.browsingContext.children[0]
);
let popupMenu = document.getElementById("fill-login-popup");
@ -48,7 +48,7 @@ add_task(async function test_context_menu_iframe_fill() {
// Stores the original value of username
function promiseFrameInputValue(name) {
return SpecialPowers.spawn(
browser.browsingContext.getChildren()[0],
browser.browsingContext.children[0],
[name],
function(inputname) {
return content.document.getElementById(inputname).value;
@ -127,7 +127,7 @@ add_task(async function test_context_menu_iframe_sandbox() {
);
return false;
},
browser.browsingContext.getChildren()[1]
browser.browsingContext.children[1]
);
let contextMenu = document.getElementById("contentAreaContextMenu");
contextMenu.hidePopup();
@ -160,7 +160,7 @@ add_task(async function test_context_menu_iframe_sandbox_same_origin() {
);
return false;
},
browser.browsingContext.getChildren()[2]
browser.browsingContext.children[2]
);
let contextMenu = document.getElementById("contentAreaContextMenu");

View File

@ -82,7 +82,7 @@ async function submitSomeCrossSiteFrames(locationMode) {
);
let outerFrameBC = firsttab.linkedBrowser.browsingContext;
let innerFrameBC = outerFrameBC.getChildren()[0];
let innerFrameBC = outerFrameBC.children[0];
await verifyNotifications(notifyPromise, [
"FormProcessed: " + outerFrameBC.id,
@ -123,7 +123,7 @@ async function submitSomeCrossSiteFrames(locationMode) {
);
let outerFrameBC2 = secondtab.linkedBrowser.browsingContext;
let innerFrameBC2 = outerFrameBC2.getChildren()[0];
let innerFrameBC2 = outerFrameBC2.children[0];
await verifyNotifications(notifyPromise, [
"FormProcessed: " + outerFrameBC2.id,
"FormProcessed: " + innerFrameBC2.id,
@ -160,7 +160,7 @@ async function submitSomeCrossSiteFrames(locationMode) {
);
let outerFrameBC3 = thirdtab.linkedBrowser.browsingContext;
let innerFrameBC3 = outerFrameBC3.getChildren()[0];
let innerFrameBC3 = outerFrameBC3.children[0];
await verifyNotifications(notifyPromise, [
"FormProcessed: " + outerFrameBC3.id,
"FormProcessed: " + innerFrameBC3.id,

View File

@ -110,7 +110,7 @@ function checkAutoCompleteResults(actualValues, expectedValues, hostname, msg) {
function getIframeBrowsingContext(window, iframeNumber = 0) {
let bc = SpecialPowers.wrap(window).windowGlobalChild.browsingContext;
return SpecialPowers.unwrap(bc.getChildren()[iframeNumber]);
return SpecialPowers.unwrap(bc.children[iframeNumber]);
}
/**

View File

@ -297,13 +297,13 @@
}
let parentIFrameBC = SpecialPowers.wrap(window).windowGlobalChild
.browsingContext.getChildren()[0];
.browsingContext.children[0];
let childIFrame = SpecialPowers.unwrap(parentIFrameBC.getChildren()[0]);
let childIFrame = SpecialPowers.unwrap(parentIFrameBC.children[0]);
await SpecialPowers.spawn(childIFrame, ["iframe1"], checkIframe);
childIFrame = SpecialPowers.unwrap(parentIFrameBC.getChildren()[1]);
childIFrame = SpecialPowers.unwrap(parentIFrameBC.children[1]);
await SpecialPowers.spawn(childIFrame, ["iframe2"], checkIframe);
childIFrame = SpecialPowers.unwrap(parentIFrameBC.getChildren()[2]);
childIFrame = SpecialPowers.unwrap(parentIFrameBC.children[2]);
await SpecialPowers.spawn(childIFrame, ["iframe3"], checkIframe);
});

View File

@ -27,7 +27,7 @@ add_task(async () => {
await loadPromise;
});
let iframeBc = browser.browsingContext.getChildren()[0];
let iframeBc = browser.browsingContext.children[0];
let pipWin = await triggerPictureInPicture(iframeBc, videoID);
ok(pipWin, "Got Picture-in-Picture window.");

View File

@ -13,7 +13,7 @@ add_task(async function oopProcessSwap() {
await BrowserTestUtils.withNewTab(
{ gBrowser: win.gBrowser, url: FILE },
async browser => {
is(browser.browsingContext.getChildren().length, 0);
is(browser.browsingContext.children.length, 0);
info("creating an in-process frame");
let frameId = await SpecialPowers.spawn(
@ -31,7 +31,7 @@ add_task(async function oopProcessSwap() {
}
);
is(browser.browsingContext.getChildren().length, 1);
is(browser.browsingContext.children.length, 1);
info("navigating to x-process frame");
let oopinfo = await SpecialPowers.spawn(
@ -68,7 +68,7 @@ add_task(async function oopProcessSwap() {
}
);
is(browser.browsingContext.getChildren().length, 1);
is(browser.browsingContext.children.length, 1);
if (Services.prefs.getBoolPref("fission.preserve_browsing_contexts")) {
is(
@ -98,7 +98,7 @@ add_task(async function oopOriginProcessSwap() {
await BrowserTestUtils.withNewTab(
{ gBrowser: win.gBrowser, url: COM_DUMMY },
async browser => {
is(browser.browsingContext.getChildren().length, 0);
is(browser.browsingContext.children.length, 0);
info("creating an in-process frame");
let frameId = await SpecialPowers.spawn(
@ -116,7 +116,7 @@ add_task(async function oopOriginProcessSwap() {
}
);
is(browser.browsingContext.getChildren().length, 1);
is(browser.browsingContext.children.length, 1);
info("navigating to x-process frame");
let oopinfo = await SpecialPowers.spawn(
@ -153,7 +153,7 @@ add_task(async function oopOriginProcessSwap() {
}
);
is(browser.browsingContext.getChildren().length, 1);
is(browser.browsingContext.children.length, 1);
if (Services.prefs.getBoolPref("fission.preserve_browsing_contexts")) {
is(
frameId,

View File

@ -16,7 +16,7 @@ add_task(async function partial_source() {
"data:text/html," + source
);
let frameBC = gBrowser.selectedBrowser.browsingContext.getChildren()[0];
let frameBC = gBrowser.selectedBrowser.browsingContext.children[0];
await SpecialPowers.spawn(frameBC, [], () => {
let element = content.document.getElementById("other");

View File

@ -313,7 +313,7 @@ add_task(async function test_hotkey_insubframe() {
// Focus the editable area within the frame.
let browser = gBrowser.selectedBrowser;
let frameBC = browser.browsingContext.getChildren()[0];
let frameBC = browser.browsingContext.children[0];
await SpecialPowers.spawn(frameBC, [], async () => {
content.document.body.focus();
content.document.defaultView.focus();

View File

@ -2084,8 +2084,7 @@
// Iterate as long as scope in assigned. Note that we use the original
// passed in scope, not childScope here.
if (scope) {
let contexts = browsingContext.getChildren();
for (let context of contexts) {
for (let context of browsingContext.children) {
sendToChildren(context, scope);
}
}

View File

@ -164,8 +164,7 @@
// Iterate as long as scope in assigned. Note that we use the original
// passed in scope, not childScope here.
if (scope) {
let contexts = browsingContext.getChildren();
for (let context of contexts) {
for (let context of browsingContext.children) {
sendToChildren(context, scope);
}
}

View File

@ -938,7 +938,7 @@ var E10SUtils = {
let stack = [aBrowser.browsingContext];
while (stack.length) {
let bc = stack.pop();
stack.push(...bc.getChildren());
stack.push(...bc.children);
if (bc.currentWindowGlobal) {
let pid = bc.currentWindowGlobal.osPid;
if (pid != tabPid) {

View File

@ -169,8 +169,7 @@ FinderParent.prototype = {
gatherBrowsingContexts(aBrowsingContext) {
let list = [aBrowsingContext];
let children = aBrowsingContext.getChildren();
for (let child of children) {
for (let child of aBrowsingContext.children) {
list.push(...this.gatherBrowsingContexts(child));
}

View File

@ -7,7 +7,7 @@ registerCleanupFunction(() => {
});
function check_frame_availability(browser) {
return check_availability(browser.browsingContext.getChildren()[0]);
return check_availability(browser.browsingContext.children[0]);
}
function check_availability(browser) {