forked from mirrors/gecko-dev
Merge inbound to mozilla-central. a=merge
This commit is contained in:
commit
2ee9341d01
399 changed files with 3476 additions and 2142 deletions
|
|
@ -2448,6 +2448,9 @@ void
|
||||||
DocAccessible::DispatchScrollingEvent(uint32_t aEventType)
|
DocAccessible::DispatchScrollingEvent(uint32_t aEventType)
|
||||||
{
|
{
|
||||||
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollable();
|
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollable();
|
||||||
|
if (!sf) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t appUnitsPerDevPixel = mPresShell->GetPresContext()->AppUnitsPerDevPixel();
|
int32_t appUnitsPerDevPixel = mPresShell->GetPresContext()->AppUnitsPerDevPixel();
|
||||||
LayoutDevicePoint scrollPoint = LayoutDevicePoint::FromAppUnits(
|
LayoutDevicePoint scrollPoint = LayoutDevicePoint::FromAppUnits(
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,8 @@ var AccessFu = {
|
||||||
Services.obs.addObserver(this, "inprocess-browser-shown");
|
Services.obs.addObserver(this, "inprocess-browser-shown");
|
||||||
Services.ww.registerNotification(this);
|
Services.ww.registerNotification(this);
|
||||||
|
|
||||||
let windows = Services.wm.getEnumerator(null);
|
for (let win of Services.wm.getEnumerator(null)) {
|
||||||
while (windows.hasMoreElements()) {
|
this._attachWindow(win);
|
||||||
this._attachWindow(windows.getNext());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.info("AccessFu:Enabled");
|
Logger.info("AccessFu:Enabled");
|
||||||
|
|
@ -89,9 +88,8 @@ var AccessFu = {
|
||||||
Services.obs.removeObserver(this, "inprocess-browser-shown");
|
Services.obs.removeObserver(this, "inprocess-browser-shown");
|
||||||
Services.ww.unregisterNotification(this);
|
Services.ww.unregisterNotification(this);
|
||||||
|
|
||||||
let windows = Services.wm.getEnumerator(null);
|
for (let win of Services.wm.getEnumerator(null)) {
|
||||||
while (windows.hasMoreElements()) {
|
this._detachWindow(win);
|
||||||
this._detachWindow(windows.getNext());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete this._notifyOutputPref;
|
delete this._notifyOutputPref;
|
||||||
|
|
|
||||||
|
|
@ -160,13 +160,9 @@ var Utils = { // jshint ignore:line
|
||||||
let attributes = {};
|
let attributes = {};
|
||||||
|
|
||||||
if (aAccessible && aAccessible.attributes) {
|
if (aAccessible && aAccessible.attributes) {
|
||||||
let attributesEnum = aAccessible.attributes.enumerate();
|
|
||||||
|
|
||||||
// Populate |attributes| object with |aAccessible|'s attribute key-value
|
// Populate |attributes| object with |aAccessible|'s attribute key-value
|
||||||
// pairs.
|
// pairs.
|
||||||
while (attributesEnum.hasMoreElements()) {
|
for (let attribute of aAccessible.attributes.enumerate()) {
|
||||||
let attribute = attributesEnum.getNext().QueryInterface(
|
|
||||||
Ci.nsIPropertyElement);
|
|
||||||
attributes[attribute.key] = attribute.value;
|
attributes[attribute.key] = attribute.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -757,9 +753,8 @@ PivotContext.prototype = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let getHeaders = function* getHeaders(aHeaderCells) {
|
let getHeaders = function* getHeaders(aHeaderCells) {
|
||||||
let enumerator = aHeaderCells.enumerate();
|
for (let {name} of aHeaderCells.enumerate(Ci.nsIAccessible)) {
|
||||||
while (enumerator.hasMoreElements()) {
|
yield name;
|
||||||
yield enumerator.getNext().QueryInterface(Ci.nsIAccessible).name;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -246,11 +246,8 @@ function addAccessibleTask(doc, task) {
|
||||||
}
|
}
|
||||||
|
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
let observers = Services.obs.enumerateObservers("accessible-event");
|
for (let observer of Services.obs.enumerateObservers("accessible-event")) {
|
||||||
while (observers.hasMoreElements()) {
|
Services.obs.removeObserver(observer, "accessible-event");
|
||||||
Services.obs.removeObserver(
|
|
||||||
observers.getNext().QueryInterface(Ci.nsIObserver),
|
|
||||||
"accessible-event");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
26
accessible/tests/crashtests/1484778.html
Normal file
26
accessible/tests/crashtests/1484778.html
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
<style>
|
||||||
|
#a { border-left: solid -moz-hyperlinktext 93em }
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
/*
|
||||||
|
I dont't know why but this seems to be required to trigger the crash...
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
*/
|
||||||
|
function go() {
|
||||||
|
var b = document.elementFromPoint(0,0);
|
||||||
|
window.scroll({left: 97, top: -1});
|
||||||
|
document.adoptNode(b);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<body onload=go()>
|
||||||
|
<ins id="a">
|
||||||
|
|
@ -6,6 +6,7 @@ load 893515.html
|
||||||
load 1072792.xhtml
|
load 1072792.xhtml
|
||||||
load 1380199.html
|
load 1380199.html
|
||||||
load 1402999.html
|
load 1402999.html
|
||||||
|
load 1484778.html
|
||||||
|
|
||||||
# last_test_to_unload_testsuite.xul MUST be the last test in the list because it
|
# last_test_to_unload_testsuite.xul MUST be the last test in the list because it
|
||||||
# is responsible for shutting down accessibility service affecting later tests.
|
# is responsible for shutting down accessibility service affecting later tests.
|
||||||
|
|
|
||||||
|
|
@ -319,10 +319,7 @@ function testAttrsInternal(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs,
|
||||||
function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs,
|
function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs,
|
||||||
aAbsentAttrs) {
|
aAbsentAttrs) {
|
||||||
// Check if all obtained attributes are expected and have expected value.
|
// Check if all obtained attributes are expected and have expected value.
|
||||||
var enumerate = aAttrs.enumerate();
|
for (let prop of aAttrs.enumerate()) {
|
||||||
while (enumerate.hasMoreElements()) {
|
|
||||||
let prop = enumerate.getNext().QueryInterface(nsIPropertyElement);
|
|
||||||
|
|
||||||
if (!(prop.key in aExpectedAttrs)) {
|
if (!(prop.key in aExpectedAttrs)) {
|
||||||
if (!aSkipUnexpectedAttrs)
|
if (!aSkipUnexpectedAttrs)
|
||||||
ok(false, "Unexpected attribute '" + prop.key + "' having '" +
|
ok(false, "Unexpected attribute '" + prop.key + "' having '" +
|
||||||
|
|
@ -355,9 +352,7 @@ function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs,
|
||||||
for (var name in aAbsentAttrs) {
|
for (var name in aAbsentAttrs) {
|
||||||
var wasFound = false;
|
var wasFound = false;
|
||||||
|
|
||||||
enumerate = aAttrs.enumerate();
|
for (let prop of aAttrs.enumerate()) {
|
||||||
while (enumerate.hasMoreElements()) {
|
|
||||||
let prop = enumerate.getNext().QueryInterface(nsIPropertyElement);
|
|
||||||
if (prop.key == name)
|
if (prop.key == name)
|
||||||
wasFound = true;
|
wasFound = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,7 @@ function testRelation(aIdentifier, aRelType, aRelatedIdentifiers) {
|
||||||
// Check if all given related accessibles are targets of obtained relation.
|
// Check if all given related accessibles are targets of obtained relation.
|
||||||
for (let idx = 0; idx < targets.length; idx++) {
|
for (let idx = 0; idx < targets.length; idx++) {
|
||||||
var isFound = false;
|
var isFound = false;
|
||||||
let enumerate = actualTargets.enumerate();
|
for (let relatedAcc of actualTargets.enumerate(Ci.nsIAccessible)) {
|
||||||
while (enumerate.hasMoreElements()) {
|
|
||||||
let relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
|
|
||||||
if (targets[idx] == relatedAcc) {
|
if (targets[idx] == relatedAcc) {
|
||||||
isFound = true;
|
isFound = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -89,9 +87,7 @@ function testRelation(aIdentifier, aRelType, aRelatedIdentifiers) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if all obtained targets are given related accessibles.
|
// Check if all obtained targets are given related accessibles.
|
||||||
let enumerate = actualTargets.enumerate();
|
for (let relatedAcc of actualTargets.enumerate(Ci.nsIAccessible)) {
|
||||||
while (enumerate.hasMoreElements()) {
|
|
||||||
let relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
|
|
||||||
let idx;
|
let idx;
|
||||||
for (idx = 0; idx < targets.length && relatedAcc != targets[idx]; idx++);
|
for (idx = 0; idx < targets.length && relatedAcc != targets[idx]; idx++);
|
||||||
|
|
||||||
|
|
@ -140,9 +136,7 @@ function testAbsentRelation(aIdentifier, aRelType, aUnrelatedIdentifiers) {
|
||||||
// Any found targets that match given accessibles should be called out.
|
// Any found targets that match given accessibles should be called out.
|
||||||
for (let idx = 0; idx < targets.length; idx++) {
|
for (let idx = 0; idx < targets.length; idx++) {
|
||||||
var notFound = true;
|
var notFound = true;
|
||||||
var enumerate = actualTargets.enumerate();
|
for (let relatedAcc of actualTargets.enumerate(Ci.nsIAccessible)) {
|
||||||
while (enumerate.hasMoreElements()) {
|
|
||||||
var relatedAcc = enumerate.getNext().QueryInterface(nsIAccessible);
|
|
||||||
if (targets[idx] == relatedAcc) {
|
if (targets[idx] == relatedAcc) {
|
||||||
notFound = false;
|
notFound = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,9 @@ class NetErrorChild extends ActorChild {
|
||||||
_getCertValidityRange(docShell) {
|
_getCertValidityRange(docShell) {
|
||||||
let {securityInfo} = docShell.failedChannel;
|
let {securityInfo} = docShell.failedChannel;
|
||||||
securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
|
securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
|
||||||
let certs = securityInfo.failedCertChain.getEnumerator();
|
|
||||||
let notBefore = 0;
|
let notBefore = 0;
|
||||||
let notAfter = Number.MAX_SAFE_INTEGER;
|
let notAfter = Number.MAX_SAFE_INTEGER;
|
||||||
while (certs.hasMoreElements()) {
|
for (let cert of securityInfo.failedCertChain.getEnumerator()) {
|
||||||
let cert = certs.getNext();
|
|
||||||
cert.QueryInterface(Ci.nsIX509Cert);
|
|
||||||
notBefore = Math.max(notBefore, cert.validity.notBefore);
|
notBefore = Math.max(notBefore, cert.validity.notBefore);
|
||||||
notAfter = Math.min(notAfter, cert.validity.notAfter);
|
notAfter = Math.min(notAfter, cert.validity.notAfter);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -336,10 +336,8 @@ function isInitialPage(url) {
|
||||||
return gInitialPages.includes(url) || url == BROWSER_NEW_TAB_URL;
|
return gInitialPages.includes(url) || url == BROWSER_NEW_TAB_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
function* browserWindows() {
|
function browserWindows() {
|
||||||
let windows = Services.wm.getEnumerator("navigator:browser");
|
return Services.wm.getEnumerator("navigator:browser");
|
||||||
while (windows.hasMoreElements())
|
|
||||||
yield windows.getNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateBackForwardCommands(aWebNavigation) {
|
function UpdateBackForwardCommands(aWebNavigation) {
|
||||||
|
|
@ -2636,13 +2634,11 @@ function BrowserPageInfo(documentURL, initialTab, imageElement, frameOuterWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
let args = { initialTab, imageElement, frameOuterWindowID, browser };
|
let args = { initialTab, imageElement, frameOuterWindowID, browser };
|
||||||
var windows = Services.wm.getEnumerator("Browser:page-info");
|
|
||||||
|
|
||||||
documentURL = documentURL || window.gBrowser.selectedBrowser.currentURI.spec;
|
documentURL = documentURL || window.gBrowser.selectedBrowser.currentURI.spec;
|
||||||
|
|
||||||
// Check for windows matching the url
|
// Check for windows matching the url
|
||||||
while (windows.hasMoreElements()) {
|
for (let currentWindow of Services.wm.getEnumerator("Browser:page-info")) {
|
||||||
var currentWindow = windows.getNext();
|
|
||||||
if (currentWindow.closed) {
|
if (currentWindow.closed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -3309,10 +3305,7 @@ function getDetailedCertErrorInfo(location, securityInfo) {
|
||||||
|
|
||||||
let certChain = "";
|
let certChain = "";
|
||||||
if (securityInfo.failedCertChain) {
|
if (securityInfo.failedCertChain) {
|
||||||
let certs = securityInfo.failedCertChain.getEnumerator();
|
for (let cert of securityInfo.failedCertChain.getEnumerator()) {
|
||||||
while (certs.hasMoreElements()) {
|
|
||||||
let cert = certs.getNext();
|
|
||||||
cert.QueryInterface(Ci.nsIX509Cert);
|
|
||||||
certChain += getPEMString(cert);
|
certChain += getPEMString(cert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -496,10 +496,7 @@ function getCertChain(securityInfoAsString) {
|
||||||
.getService(Ci.nsISerializationHelper);
|
.getService(Ci.nsISerializationHelper);
|
||||||
let securityInfo = serhelper.deserializeObject(securityInfoAsString);
|
let securityInfo = serhelper.deserializeObject(securityInfoAsString);
|
||||||
securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
|
securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
|
||||||
let certs = securityInfo.failedCertChain.getEnumerator();
|
for (let cert of securityInfo.failedCertChain.getEnumerator()) {
|
||||||
while (certs.hasMoreElements()) {
|
|
||||||
let cert = certs.getNext();
|
|
||||||
cert.QueryInterface(Ci.nsIX509Cert);
|
|
||||||
certChain += getPEMString(cert);
|
certChain += getPEMString(cert);
|
||||||
}
|
}
|
||||||
return certChain;
|
return certChain;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
function test() {
|
function test() {
|
||||||
var contentWin = window.open("about:blank", "", "width=100,height=100");
|
var contentWin = window.open("about:blank", "", "width=100,height=100");
|
||||||
var enumerator = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
|
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let win = enumerator.getNext();
|
|
||||||
if (win.content == contentWin) {
|
if (win.content == contentWin) {
|
||||||
Services.prefs.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
|
Services.prefs.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
|
||||||
win.gBrowser.removeCurrentTab();
|
win.gBrowser.removeCurrentTab();
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,7 @@ function triggerSave(aWindow, aCallback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function continueDownloading() {
|
function continueDownloading() {
|
||||||
let windows = Services.wm.getEnumerator("");
|
for (let win of Services.wm.getEnumerator("")) {
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
let win = windows.getNext();
|
|
||||||
if (win.location && win.location.href == UCT_URI) {
|
if (win.location && win.location.href == UCT_URI) {
|
||||||
win.document.documentElement._fireButtonEvent("accept");
|
win.document.documentElement._fireButtonEvent("accept");
|
||||||
win.close();
|
win.close();
|
||||||
|
|
|
||||||
|
|
@ -533,24 +533,13 @@ async function loadBadCertPage(url) {
|
||||||
// Utility function to get a handle on the certificate exception dialog.
|
// Utility function to get a handle on the certificate exception dialog.
|
||||||
// Modified from toolkit/components/passwordmgr/test/prompt_common.js
|
// Modified from toolkit/components/passwordmgr/test/prompt_common.js
|
||||||
function getCertExceptionDialog(aLocation) {
|
function getCertExceptionDialog(aLocation) {
|
||||||
let enumerator = Services.wm.getXULWindowEnumerator(null);
|
for (let {docShell} of Services.wm.getXULWindowEnumerator(null)) {
|
||||||
|
let containedDocShells = docShell.getDocShellEnumerator(
|
||||||
while (enumerator.hasMoreElements()) {
|
docShell.typeChrome,
|
||||||
let win = enumerator.getNext();
|
docShell.ENUMERATE_FORWARDS);
|
||||||
let windowDocShell = win.QueryInterface(Ci.nsIXULWindow).docShell;
|
for (let {domWindow} of containedDocShells) {
|
||||||
|
if (domWindow.location.href == aLocation) {
|
||||||
let containedDocShells = windowDocShell.getDocShellEnumerator(
|
return domWindow.document;
|
||||||
Ci.nsIDocShellTreeItem.typeChrome,
|
|
||||||
Ci.nsIDocShell.ENUMERATE_FORWARDS);
|
|
||||||
while (containedDocShells.hasMoreElements()) {
|
|
||||||
// Get the corresponding document for this docshell
|
|
||||||
let childDocShell = containedDocShells.getNext();
|
|
||||||
let childDoc = childDocShell.QueryInterface(Ci.nsIDocShell)
|
|
||||||
.contentViewer
|
|
||||||
.DOMDocument;
|
|
||||||
|
|
||||||
if (childDoc.location.href == aLocation) {
|
|
||||||
return childDoc;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,7 @@ const PLUGIN_SMALL_PAGE = gTestRoot + "plugin_small.html";
|
||||||
*/
|
*/
|
||||||
function convertPropertyBag(aBag) {
|
function convertPropertyBag(aBag) {
|
||||||
let result = {};
|
let result = {};
|
||||||
let enumerator = aBag.enumerator;
|
for (let { name, value } of aBag.enumerator) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let { name, value } = enumerator.getNext().QueryInterface(Ci.nsIProperty);
|
|
||||||
if (value instanceof Ci.nsIPropertyBag) {
|
if (value instanceof Ci.nsIPropertyBag) {
|
||||||
value = convertPropertyBag(value);
|
value = convertPropertyBag(value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -294,24 +294,15 @@ async function loadBadCertPage(url) {
|
||||||
// Utility function to get a handle on the certificate exception dialog.
|
// Utility function to get a handle on the certificate exception dialog.
|
||||||
// Modified from toolkit/components/passwordmgr/test/prompt_common.js
|
// Modified from toolkit/components/passwordmgr/test/prompt_common.js
|
||||||
function getCertExceptionDialog(aLocation) {
|
function getCertExceptionDialog(aLocation) {
|
||||||
let enumerator = Services.wm.getXULWindowEnumerator(null);
|
for (let win of Services.wm.getXULWindowEnumerator(null)) {
|
||||||
|
let windowDocShell = win.docShell;
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let win = enumerator.getNext();
|
|
||||||
let windowDocShell = win.QueryInterface(Ci.nsIXULWindow).docShell;
|
|
||||||
|
|
||||||
let containedDocShells = windowDocShell.getDocShellEnumerator(
|
let containedDocShells = windowDocShell.getDocShellEnumerator(
|
||||||
Ci.nsIDocShellTreeItem.typeChrome,
|
Ci.nsIDocShellTreeItem.typeChrome,
|
||||||
Ci.nsIDocShell.ENUMERATE_FORWARDS);
|
Ci.nsIDocShell.ENUMERATE_FORWARDS);
|
||||||
while (containedDocShells.hasMoreElements()) {
|
for (let {domWindow} of containedDocShells) {
|
||||||
// Get the corresponding document for this docshell
|
if (domWindow.location.href == aLocation) {
|
||||||
let childDocShell = containedDocShells.getNext();
|
return domWindow.document;
|
||||||
let childDoc = childDocShell.QueryInterface(Ci.nsIDocShell)
|
|
||||||
.contentViewer
|
|
||||||
.DOMDocument;
|
|
||||||
|
|
||||||
if (childDoc.location.href == aLocation) {
|
|
||||||
return childDoc;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,10 +219,8 @@ add_task(async function checkAllTheProperties() {
|
||||||
|
|
||||||
for (let uri of uris) {
|
for (let uri of uris) {
|
||||||
let bundle = Services.strings.createBundle(uri.spec);
|
let bundle = Services.strings.createBundle(uri.spec);
|
||||||
let enumerator = bundle.getSimpleEnumeration();
|
|
||||||
|
|
||||||
while (enumerator.hasMoreElements()) {
|
for (let entity of bundle.getSimpleEnumeration()) {
|
||||||
let entity = enumerator.getNext().QueryInterface(Ci.nsIPropertyElement);
|
|
||||||
testForErrors(uri.spec, entity.key, entity.value);
|
testForErrors(uri.spec, entity.key, entity.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,7 @@ function promiseCrashReport(expectedExtra = {}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
info("Iterating crash report extra keys");
|
info("Iterating crash report extra keys");
|
||||||
let enumerator = extra.enumerator;
|
for (let {name: key} of extra.enumerator) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let key = enumerator.getNext().QueryInterface(Ci.nsIProperty).name;
|
|
||||||
let value = extra.getPropertyAsAString(key);
|
let value = extra.getPropertyAsAString(key);
|
||||||
if (key in expectedExtra) {
|
if (key in expectedExtra) {
|
||||||
if (expectedExtra[key] == null) {
|
if (expectedExtra[key] == null) {
|
||||||
|
|
|
||||||
|
|
@ -139,9 +139,7 @@ function loadTab(tab, url) {
|
||||||
function ensure_opentabs_match_db() {
|
function ensure_opentabs_match_db() {
|
||||||
var tabs = {};
|
var tabs = {};
|
||||||
|
|
||||||
var winEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let browserWin of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (winEnum.hasMoreElements()) {
|
|
||||||
let browserWin = winEnum.getNext();
|
|
||||||
// skip closed-but-not-destroyed windows
|
// skip closed-but-not-destroyed windows
|
||||||
if (browserWin.closed)
|
if (browserWin.closed)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -110,9 +110,7 @@ async function assertWebRTCIndicatorStatus(expected) {
|
||||||
is(ui.showMicrophoneIndicator, expectAudio, "microphone global indicator as expected");
|
is(ui.showMicrophoneIndicator, expectAudio, "microphone global indicator as expected");
|
||||||
is(ui.showScreenSharingIndicator, expectScreen, "screen global indicator as expected");
|
is(ui.showScreenSharingIndicator, expectScreen, "screen global indicator as expected");
|
||||||
|
|
||||||
let windows = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
let win = windows.getNext();
|
|
||||||
let menu = win.document.getElementById("tabSharingMenu");
|
let menu = win.document.getElementById("tabSharingMenu");
|
||||||
is(!!menu && !menu.hidden, !!expected, "WebRTC menu should be " + expectedState);
|
is(!!menu && !menu.hidden, !!expected, "WebRTC menu should be " + expectedState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -790,10 +790,8 @@ function isBidiEnabled() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function openAboutDialog() {
|
function openAboutDialog() {
|
||||||
var enumerator = Services.wm.getEnumerator("Browser:About");
|
for (let win of Services.wm.getEnumerator("Browser:About")) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
// Only open one about window (Bug 599573)
|
// Only open one about window (Bug 599573)
|
||||||
let win = enumerator.getNext();
|
|
||||||
if (win.closed) {
|
if (win.closed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,7 @@ add_task(async function test_cookie_getCookiesWithOriginAttributes() {
|
||||||
|
|
||||||
// Using getCookiesWithOriginAttributes() to get all cookies for a certain
|
// Using getCookiesWithOriginAttributes() to get all cookies for a certain
|
||||||
// domain by using the originAttributes pattern, and clear all these cookies.
|
// domain by using the originAttributes pattern, and clear all these cookies.
|
||||||
let enumerator = Services.cookies.getCookiesWithOriginAttributes(JSON.stringify({}), TEST_HOST);
|
for (let cookie of Services.cookies.getCookiesWithOriginAttributes(JSON.stringify({}), TEST_HOST)) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
|
|
||||||
Services.cookies.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
|
Services.cookies.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,7 @@ function checkCookies(ignoreContext = null) {
|
||||||
function deleteCookies(onlyContext = null) {
|
function deleteCookies(onlyContext = null) {
|
||||||
// Using getCookiesWithOriginAttributes() to get all cookies for a certain
|
// Using getCookiesWithOriginAttributes() to get all cookies for a certain
|
||||||
// domain by using the originAttributes pattern, and clear all these cookies.
|
// domain by using the originAttributes pattern, and clear all these cookies.
|
||||||
let enumerator = Services.cookies.getCookiesWithOriginAttributes(JSON.stringify({}), TEST_HOST);
|
for (let cookie of Services.cookies.getCookiesWithOriginAttributes(JSON.stringify({}), TEST_HOST)) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
|
|
||||||
if (!onlyContext || cookie.originAttributes.userContextId == onlyContext) {
|
if (!onlyContext || cookie.originAttributes.userContextId == onlyContext) {
|
||||||
Services.cookies.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
|
Services.cookies.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -516,6 +516,15 @@ var PanelMultiView = class extends AssociatedToNode {
|
||||||
try {
|
try {
|
||||||
canCancel = false;
|
canCancel = false;
|
||||||
this._panel.openPopup(...args);
|
this._panel.openPopup(...args);
|
||||||
|
|
||||||
|
// On Windows, if another popup is hiding while we call openPopup, the
|
||||||
|
// call won't fail but the popup won't open. In this case, we have to
|
||||||
|
// dispatch an artificial "popuphidden" event to reset our state.
|
||||||
|
if (this._panel.state == "closed" && this.openViews.length) {
|
||||||
|
this.dispatchCustomEvent("popuphidden");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this.dispatchCustomEvent("popuphidden");
|
this.dispatchCustomEvent("popuphidden");
|
||||||
|
|
@ -1056,8 +1065,10 @@ var PanelMultiView = class extends AssociatedToNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleEvent(aEvent) {
|
handleEvent(aEvent) {
|
||||||
if (aEvent.type.startsWith("popup") && aEvent.target != this._panel) {
|
// Only process actual popup events from the panel or events we generate
|
||||||
// Shouldn't act on e.g. context menus being shown from within the panel.
|
// ourselves, but not from menus being shown from within the panel.
|
||||||
|
if (aEvent.type.startsWith("popup") && aEvent.target != this._panel &&
|
||||||
|
aEvent.target != this.node) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (aEvent.type) {
|
switch (aEvent.type) {
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ skip-if = os == "mac"
|
||||||
[browser_1096763_seen_widgets_post_reset.js]
|
[browser_1096763_seen_widgets_post_reset.js]
|
||||||
[browser_1161838_inserted_new_default_buttons.js]
|
[browser_1161838_inserted_new_default_buttons.js]
|
||||||
skip-if = verify
|
skip-if = verify
|
||||||
|
[browser_1484275_PanelMultiView_toggle_with_other_popup.js]
|
||||||
[browser_allow_dragging_removable_false.js]
|
[browser_allow_dragging_removable_false.js]
|
||||||
[browser_bootstrapped_custom_toolbar.js]
|
[browser_bootstrapped_custom_toolbar.js]
|
||||||
[browser_currentset_post_reset.js]
|
[browser_currentset_post_reset.js]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URL = "data:text/html,<html><body></body></html>";
|
||||||
|
|
||||||
|
// This code can be consolidated in the EventUtils module (bug 1126772).
|
||||||
|
const isWindows = AppConstants.platform == "win";
|
||||||
|
const isMac = AppConstants.platform == "macosx";
|
||||||
|
const mouseDown = isWindows ? 2 : isMac ? 1 : 4; // eslint-disable-line no-nested-ternary
|
||||||
|
const mouseUp = isWindows ? 4 : isMac ? 2 : 7; // eslint-disable-line no-nested-ternary
|
||||||
|
const utils = window.windowUtils;
|
||||||
|
const scale = utils.screenPixelsPerCSSPixel;
|
||||||
|
function synthesizeNativeMouseClick(aElement) {
|
||||||
|
let rect = aElement.getBoundingClientRect();
|
||||||
|
let win = aElement.ownerGlobal;
|
||||||
|
let x = win.mozInnerScreenX + (rect.left + rect.right) / 2;
|
||||||
|
let y = win.mozInnerScreenY + (rect.top + rect.bottom) / 2;
|
||||||
|
|
||||||
|
// Wait for the mouseup event to occur before continuing.
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
function eventOccurred(e) {
|
||||||
|
aElement.removeEventListener("mouseup", eventOccurred, true);
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
aElement.addEventListener("mouseup", eventOccurred, true);
|
||||||
|
|
||||||
|
utils.sendNativeMouseEvent(x * scale, y * scale, mouseDown, 0, null);
|
||||||
|
utils.sendNativeMouseEvent(x * scale, y * scale, mouseUp, 0, null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test steps that may lead to the panel being stuck on Windows (bug 1484275).
|
||||||
|
*/
|
||||||
|
add_task(async function test_PanelMultiView_toggle_with_other_popup() {
|
||||||
|
// For proper cleanup, create a bookmark that we will remove later.
|
||||||
|
let bookmark = await PlacesUtils.bookmarks.insert({
|
||||||
|
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||||
|
url: TEST_URL,
|
||||||
|
});
|
||||||
|
registerCleanupFunction(() => PlacesUtils.bookmarks.remove(bookmark));
|
||||||
|
|
||||||
|
await BrowserTestUtils.withNewTab({
|
||||||
|
gBrowser,
|
||||||
|
url: TEST_URL,
|
||||||
|
}, async function(browser) {
|
||||||
|
// 1. Open the main menu.
|
||||||
|
await gCUITestUtils.openMainMenu();
|
||||||
|
|
||||||
|
// 2. Open another popup not managed by PanelMultiView.
|
||||||
|
let bookmarkPanel = document.getElementById("editBookmarkPanel");
|
||||||
|
let shown = BrowserTestUtils.waitForEvent(bookmarkPanel, "popupshown");
|
||||||
|
let hidden = BrowserTestUtils.waitForEvent(bookmarkPanel, "popuphidden");
|
||||||
|
EventUtils.synthesizeKey("D", { accelKey: true });
|
||||||
|
await shown;
|
||||||
|
|
||||||
|
// 3. Click the button to which the main menu is anchored. We need a native
|
||||||
|
// mouse event to simulate the exact platform behavior with popups.
|
||||||
|
let clickFn = () => synthesizeNativeMouseClick(
|
||||||
|
document.getElementById("PanelUI-button"));
|
||||||
|
|
||||||
|
if (AppConstants.platform == "win") {
|
||||||
|
// On Windows, the operation will close both popups.
|
||||||
|
await gCUITestUtils.hidePanelMultiView(PanelUI.panel, clickFn);
|
||||||
|
await new Promise(resolve => executeSoon(resolve));
|
||||||
|
|
||||||
|
// 4. Test that the popup can be opened again after it's been closed.
|
||||||
|
await gCUITestUtils.openMainMenu();
|
||||||
|
Assert.equal(PanelUI.panel.state, "open");
|
||||||
|
} else {
|
||||||
|
// On other platforms, the operation will close both popups and reopen the
|
||||||
|
// main menu immediately, so we wait for the reopen to occur.
|
||||||
|
shown = BrowserTestUtils.waitForEvent(PanelUI.mainView, "ViewShown");
|
||||||
|
clickFn();
|
||||||
|
await shown;
|
||||||
|
}
|
||||||
|
|
||||||
|
await gCUITestUtils.hideMainMenu();
|
||||||
|
|
||||||
|
// Make sure the events for the bookmarks panel have also been processed
|
||||||
|
// before closing the tab and removing the bookmark.
|
||||||
|
await hidden;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -406,6 +406,7 @@ add_task(async function test_cancel_mainview_event_sequence() {
|
||||||
Assert.deepEqual(recordArray, [
|
Assert.deepEqual(recordArray, [
|
||||||
"panelview-0: ViewShowing",
|
"panelview-0: ViewShowing",
|
||||||
"panelview-0: ViewHiding",
|
"panelview-0: ViewHiding",
|
||||||
|
"panelmultiview-0: PanelMultiViewHidden",
|
||||||
"panelmultiview-0: popuphidden",
|
"panelmultiview-0: popuphidden",
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
@ -475,8 +476,9 @@ add_task(async function test_close_while_showing_mainview_event_sequence() {
|
||||||
|
|
||||||
Assert.deepEqual(recordArray, [
|
Assert.deepEqual(recordArray, [
|
||||||
"panelview-0: ViewShowing",
|
"panelview-0: ViewShowing",
|
||||||
"panelview-0: ViewShowing > panelmultiview-0: popuphidden",
|
|
||||||
"panelview-0: ViewShowing > panelview-0: ViewHiding",
|
"panelview-0: ViewShowing > panelview-0: ViewHiding",
|
||||||
|
"panelview-0: ViewShowing > panelmultiview-0: PanelMultiViewHidden",
|
||||||
|
"panelview-0: ViewShowing > panelmultiview-0: popuphidden",
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,14 +140,12 @@ DirectoryProvider::GetFiles(const char *aKey, nsISimpleEnumerator* *aResult)
|
||||||
nsCOMArray<nsIFile> distroFiles;
|
nsCOMArray<nsIFile> distroFiles;
|
||||||
AppendDistroSearchDirs(dirSvc, distroFiles);
|
AppendDistroSearchDirs(dirSvc, distroFiles);
|
||||||
|
|
||||||
return NS_NewArrayEnumerator(aResult, distroFiles);
|
return NS_NewArrayEnumerator(aResult, distroFiles, NS_GET_IID(nsIFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(DirectoryProvider::AppendingEnumerator, nsISimpleEnumerator)
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
DirectoryProvider::AppendingEnumerator::HasMoreElements(bool *aResult)
|
DirectoryProvider::AppendingEnumerator::HasMoreElements(bool *aResult)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
#include "nsIDirectoryService.h"
|
#include "nsIDirectoryService.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsISimpleEnumerator.h"
|
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
|
#include "nsSimpleEnumerator.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
|
||||||
#define NS_BROWSERDIRECTORYPROVIDER_CONTRACTID \
|
#define NS_BROWSERDIRECTORYPROVIDER_CONTRACTID \
|
||||||
|
|
@ -27,17 +27,16 @@ public:
|
||||||
private:
|
private:
|
||||||
~DirectoryProvider() {}
|
~DirectoryProvider() {}
|
||||||
|
|
||||||
class AppendingEnumerator final : public nsISimpleEnumerator
|
class AppendingEnumerator final : public nsSimpleEnumerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
NS_DECL_NSISIMPLEENUMERATOR
|
NS_DECL_NSISIMPLEENUMERATOR
|
||||||
|
|
||||||
AppendingEnumerator(nsISimpleEnumerator* aBase,
|
AppendingEnumerator(nsISimpleEnumerator* aBase,
|
||||||
char const *const *aAppendList);
|
char const *const *aAppendList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~AppendingEnumerator() {}
|
~AppendingEnumerator() override = default;
|
||||||
|
|
||||||
nsCOMPtr<nsISimpleEnumerator> mBase;
|
nsCOMPtr<nsISimpleEnumerator> mBase;
|
||||||
char const *const *const mAppendList;
|
char const *const *const mAppendList;
|
||||||
|
|
|
||||||
|
|
@ -142,9 +142,7 @@ var DownloadsCommon = {
|
||||||
get strings() {
|
get strings() {
|
||||||
let strings = {};
|
let strings = {};
|
||||||
let sb = Services.strings.createBundle(kDownloadsStringBundleUrl);
|
let sb = Services.strings.createBundle(kDownloadsStringBundleUrl);
|
||||||
let enumerator = sb.getSimpleEnumeration();
|
for (let string of sb.getSimpleEnumeration()) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let string = enumerator.getNext().QueryInterface(Ci.nsIPropertyElement);
|
|
||||||
let stringName = string.key;
|
let stringName = string.key;
|
||||||
if (stringName in kDownloadsStringsRequiringFormatting) {
|
if (stringName in kDownloadsStringsRequiringFormatting) {
|
||||||
strings[stringName] = function() {
|
strings[stringName] = function() {
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,7 @@ add_task(async function setup() {
|
||||||
|
|
||||||
function retrieve_all_cookies(host) {
|
function retrieve_all_cookies(host) {
|
||||||
const values = [];
|
const values = [];
|
||||||
const cookies = Services.cookies.getCookiesFromHost(host, {});
|
for (let cookie of Services.cookies.getCookiesFromHost(host, {})) {
|
||||||
while (cookies.hasMoreElements()) {
|
|
||||||
const cookie = cookies.getNext().QueryInterface(Ci.nsICookie);
|
|
||||||
values.push({
|
values.push({
|
||||||
host: cookie.host,
|
host: cookie.host,
|
||||||
name: cookie.name,
|
name: cookie.name,
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ const clearCookies = async function(options) {
|
||||||
|
|
||||||
if (options.since || options.hostnames) {
|
if (options.since || options.hostnames) {
|
||||||
// Iterate through the cookies and delete any created after our cutoff.
|
// Iterate through the cookies and delete any created after our cutoff.
|
||||||
for (const cookie of XPCOMUtils.IterSimpleEnumerator(cookieMgr.enumerator, Ci.nsICookie2)) {
|
for (const cookie of cookieMgr.enumerator) {
|
||||||
if ((!options.since || cookie.creationTime >= PlacesUtils.toPRTime(options.since)) &&
|
if ((!options.since || cookie.creationTime >= PlacesUtils.toPRTime(options.since)) &&
|
||||||
(!options.hostnames || options.hostnames.includes(cookie.host.replace(/^\./, "")))) {
|
(!options.hostnames || options.hostnames.includes(cookie.host.replace(/^\./, "")))) {
|
||||||
// This cookie was created after our cutoff, clear it.
|
// This cookie was created after our cutoff, clear it.
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "pkcs11db",
|
||||||
var {DefaultMap} = ExtensionUtils;
|
var {DefaultMap} = ExtensionUtils;
|
||||||
|
|
||||||
const findModuleByPath = function(path) {
|
const findModuleByPath = function(path) {
|
||||||
let modules = pkcs11db.listModules();
|
for (let module of pkcs11db.listModules()) {
|
||||||
for (let module of XPCOMUtils.IterSimpleEnumerator(modules, Ci.nsIPKCS11Module)) {
|
|
||||||
if (module && module.libName === path) {
|
if (module && module.libName === path) {
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +117,7 @@ this.pkcs11 = class extends ExtensionAPI {
|
||||||
return Promise.reject({message: `The module ${name} is not installed`});
|
return Promise.reject({message: `The module ${name} is not installed`});
|
||||||
}
|
}
|
||||||
let rv = [];
|
let rv = [];
|
||||||
for (let slot of XPCOMUtils.IterSimpleEnumerator(module.listSlots(), Ci.nsIPKCS11Slot)) {
|
for (let slot of module.listSlots()) {
|
||||||
let token = slot.getToken();
|
let token = slot.getToken();
|
||||||
let slotobj = {
|
let slotobj = {
|
||||||
name: slot.name,
|
name: slot.name,
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,7 @@ XPCOMUtils.defineLazyGetter(this, "tabHidePopup", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function showHiddenTabs(id) {
|
function showHiddenTabs(id) {
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let win = windowsEnum.getNext();
|
|
||||||
if (win.closed || !win.gBrowser) {
|
if (win.closed || !win.gBrowser) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ support-files =
|
||||||
file_inspectedwindow_reload_target.sjs
|
file_inspectedwindow_reload_target.sjs
|
||||||
file_indexedDB.html
|
file_indexedDB.html
|
||||||
file_serviceWorker.html
|
file_serviceWorker.html
|
||||||
|
install_other-1.0-fx.xpi
|
||||||
|
install_theme-1.0-fx.xpi
|
||||||
webNav_createdTarget.html
|
webNav_createdTarget.html
|
||||||
webNav_createdTargetSource.html
|
webNav_createdTargetSource.html
|
||||||
webNav_createdTargetSource_subframe.html
|
webNav_createdTargetSource_subframe.html
|
||||||
|
|
@ -105,6 +107,7 @@ skip-if = (verify && (os == 'linux' || os == 'mac'))
|
||||||
[browser_ext_incognito_views.js]
|
[browser_ext_incognito_views.js]
|
||||||
[browser_ext_incognito_popup.js]
|
[browser_ext_incognito_popup.js]
|
||||||
[browser_ext_lastError.js]
|
[browser_ext_lastError.js]
|
||||||
|
[browser_ext_management.js]
|
||||||
[browser_ext_menus.js]
|
[browser_ext_menus.js]
|
||||||
[browser_ext_menus_accesskey.js]
|
[browser_ext_menus_accesskey.js]
|
||||||
[browser_ext_menus_activeTab.js]
|
[browser_ext_menus_activeTab.js]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const BASE = "http://mochi.test:8888/browser/browser/components/extensions/test/browser/";
|
||||||
|
|
||||||
|
function waitForTransition(element, propertyName) {
|
||||||
|
return BrowserTestUtils.waitForEvent(element, "transitionend", false, event => {
|
||||||
|
return event.target == element && event.propertyName == propertyName;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
add_task(async function test_management_install() {
|
||||||
|
await SpecialPowers.pushPrefEnv({set: [
|
||||||
|
["xpinstall.signatures.required", false],
|
||||||
|
]});
|
||||||
|
|
||||||
|
registerCleanupFunction(async () => {
|
||||||
|
await SpecialPowers.popPrefEnv();
|
||||||
|
});
|
||||||
|
|
||||||
|
let extension = ExtensionTestUtils.loadExtension({
|
||||||
|
manifest: {
|
||||||
|
browser_action: {
|
||||||
|
"browser_style": false,
|
||||||
|
},
|
||||||
|
permissions: ["management"],
|
||||||
|
},
|
||||||
|
background() {
|
||||||
|
let addons;
|
||||||
|
browser.test.onMessage.addListener((msg, init) => {
|
||||||
|
addons = init;
|
||||||
|
browser.test.sendMessage("ready");
|
||||||
|
});
|
||||||
|
browser.browserAction.onClicked.addListener(async () => {
|
||||||
|
try {
|
||||||
|
let {url, hash} = addons.shift();
|
||||||
|
browser.test.log(`Installing XPI from ${url} with hash ${hash || "missing"}`);
|
||||||
|
let {id} = await browser.management.install({url, hash});
|
||||||
|
let {type} = await browser.management.get(id);
|
||||||
|
browser.test.sendMessage("installed", {id, type});
|
||||||
|
} catch (e) {
|
||||||
|
browser.test.log(`management.install() throws ${e}`);
|
||||||
|
browser.test.sendMessage("failed", e.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
let addons = [{
|
||||||
|
url: BASE + "install_theme-1.0-fx.xpi",
|
||||||
|
hash: "sha256:aa232d8391d82a9c1014364efbe1657ff6d8dfc88b3c71e99881b1f3843fdad3",
|
||||||
|
}, {
|
||||||
|
url: BASE + "install_other-1.0-fx.xpi",
|
||||||
|
}];
|
||||||
|
|
||||||
|
await extension.startup();
|
||||||
|
extension.sendMessage("addons", addons);
|
||||||
|
await extension.awaitMessage("ready");
|
||||||
|
|
||||||
|
// Test installing a static WE theme.
|
||||||
|
let transitionDone = waitForTransition(document.documentElement, "background-color");
|
||||||
|
clickBrowserAction(extension);
|
||||||
|
|
||||||
|
let {id, type} = await extension.awaitMessage("installed");
|
||||||
|
is(id, "tiger@persona.beard", "Static web extension theme installed");
|
||||||
|
is(type, "theme", "Extension type is correct");
|
||||||
|
|
||||||
|
await transitionDone;
|
||||||
|
let style = window.getComputedStyle(document.documentElement);
|
||||||
|
is(style.backgroundColor, "rgb(255, 165, 0)", "Background is the new black");
|
||||||
|
|
||||||
|
let addon = await AddonManager.getAddonByID("tiger@persona.beard");
|
||||||
|
await addon.uninstall();
|
||||||
|
|
||||||
|
// Test installing a standard WE.
|
||||||
|
clickBrowserAction(extension);
|
||||||
|
let error = await extension.awaitMessage("failed");
|
||||||
|
is(error, "Incompatible addon", "Standard web extension rejected");
|
||||||
|
|
||||||
|
await extension.unload();
|
||||||
|
});
|
||||||
|
|
@ -508,9 +508,7 @@ function awaitEvent(eventName, id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function* BrowserWindowIterator() {
|
function* BrowserWindowIterator() {
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let currentWindow of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let currentWindow = windowsEnum.getNext();
|
|
||||||
if (!currentWindow.closed) {
|
if (!currentWindow.closed) {
|
||||||
yield currentWindow;
|
yield currentWindow;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -276,9 +276,7 @@ const AutoMigrate = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_removeNotificationBars() {
|
_removeNotificationBars() {
|
||||||
let browserWindows = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (browserWindows.hasMoreElements()) {
|
|
||||||
let win = browserWindows.getNext();
|
|
||||||
if (!win.closed) {
|
if (!win.closed) {
|
||||||
for (let browser of win.gBrowser.browsers) {
|
for (let browser of win.gBrowser.browsers) {
|
||||||
let nb = win.gBrowser.getNotificationBox(browser);
|
let nb = win.gBrowser.getNotificationBox(browser);
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,9 @@ FirefoxProfileMigrator.prototype = Object.create(MigratorPrototype);
|
||||||
|
|
||||||
FirefoxProfileMigrator.prototype._getAllProfiles = function() {
|
FirefoxProfileMigrator.prototype._getAllProfiles = function() {
|
||||||
let allProfiles = new Map();
|
let allProfiles = new Map();
|
||||||
let profiles =
|
let profileService = Cc["@mozilla.org/toolkit/profile-service;1"]
|
||||||
Cc["@mozilla.org/toolkit/profile-service;1"]
|
.getService(Ci.nsIToolkitProfileService);
|
||||||
.getService(Ci.nsIToolkitProfileService)
|
for (let profile of profileService.profiles) {
|
||||||
.profiles;
|
|
||||||
while (profiles.hasMoreElements()) {
|
|
||||||
let profile = profiles.getNext().QueryInterface(Ci.nsIToolkitProfile);
|
|
||||||
let rootDir = profile.rootDir;
|
let rootDir = profile.rootDir;
|
||||||
|
|
||||||
if (rootDir.exists() && rootDir.isReadable() &&
|
if (rootDir.exists() && rootDir.isReadable() &&
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,8 @@ History.prototype = {
|
||||||
migrate: function H_migrate(aCallback) {
|
migrate: function H_migrate(aCallback) {
|
||||||
let pageInfos = [];
|
let pageInfos = [];
|
||||||
let typedURLs = MSMigrationUtils.getTypedURLs("Software\\Microsoft\\Internet Explorer");
|
let typedURLs = MSMigrationUtils.getTypedURLs("Software\\Microsoft\\Internet Explorer");
|
||||||
let historyEnumerator = Cc["@mozilla.org/profile/migrator/iehistoryenumerator;1"].
|
for (let entry of Cc["@mozilla.org/profile/migrator/iehistoryenumerator;1"]
|
||||||
createInstance(Ci.nsISimpleEnumerator);
|
.createInstance(Ci.nsISimpleEnumerator)) {
|
||||||
while (historyEnumerator.hasMoreElements()) {
|
|
||||||
let entry = historyEnumerator.getNext().QueryInterface(Ci.nsIPropertyBag2);
|
|
||||||
let url = entry.get("uri").QueryInterface(Ci.nsIURI);
|
let url = entry.get("uri").QueryInterface(Ci.nsIURI);
|
||||||
// MSIE stores some types of URLs in its history that we don't handle,
|
// MSIE stores some types of URLs in its history that we don't handle,
|
||||||
// like HTMLHelp and others. Since we don't properly map handling for
|
// like HTMLHelp and others. Since we don't properly map handling for
|
||||||
|
|
@ -115,11 +113,9 @@ IE7FormPasswords.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
async migrate(aCallback) {
|
async migrate(aCallback) {
|
||||||
let historyEnumerator = Cc["@mozilla.org/profile/migrator/iehistoryenumerator;1"].
|
|
||||||
createInstance(Ci.nsISimpleEnumerator);
|
|
||||||
let uris = []; // the uris of the websites that are going to be migrated
|
let uris = []; // the uris of the websites that are going to be migrated
|
||||||
while (historyEnumerator.hasMoreElements()) {
|
for (let entry of Cc["@mozilla.org/profile/migrator/iehistoryenumerator;1"]
|
||||||
let entry = historyEnumerator.getNext().QueryInterface(Ci.nsIPropertyBag2);
|
.createInstance(Ci.nsISimpleEnumerator)) {
|
||||||
let uri = entry.get("uri").QueryInterface(Ci.nsIURI);
|
let uri = entry.get("uri").QueryInterface(Ci.nsIURI);
|
||||||
// MSIE stores some types of URLs in its history that we don't handle, like HTMLHelp
|
// MSIE stores some types of URLs in its history that we don't handle, like HTMLHelp
|
||||||
// and others. Since we are not going to import the logins that are performed in these URLs
|
// and others. Since we are not going to import the logins that are performed in these URLs
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//// nsIEHistoryEnumerator
|
//// nsIEHistoryEnumerator
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(nsIEHistoryEnumerator, nsISimpleEnumerator)
|
|
||||||
|
|
||||||
nsIEHistoryEnumerator::nsIEHistoryEnumerator()
|
nsIEHistoryEnumerator::nsIEHistoryEnumerator()
|
||||||
{
|
{
|
||||||
::CoInitialize(nullptr);
|
::CoInitialize(nullptr);
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,23 @@
|
||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsISimpleEnumerator.h"
|
|
||||||
#include "nsIWritablePropertyBag2.h"
|
#include "nsIWritablePropertyBag2.h"
|
||||||
|
#include "nsSimpleEnumerator.h"
|
||||||
|
|
||||||
class nsIEHistoryEnumerator final : public nsISimpleEnumerator
|
class nsIEHistoryEnumerator final : public nsSimpleEnumerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
NS_DECL_NSISIMPLEENUMERATOR
|
NS_DECL_NSISIMPLEENUMERATOR
|
||||||
|
|
||||||
nsIEHistoryEnumerator();
|
nsIEHistoryEnumerator();
|
||||||
|
|
||||||
|
const nsID& DefaultInterface() override
|
||||||
|
{
|
||||||
|
return NS_GET_IID(nsIWritablePropertyBag2);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~nsIEHistoryEnumerator();
|
~nsIEHistoryEnumerator() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the history reader, if needed.
|
* Initializes the history reader, if needed.
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ function readFile(file) {
|
||||||
function checkDirectoryContains(dir, files) {
|
function checkDirectoryContains(dir, files) {
|
||||||
print("checking " + dir.path + " - should contain " + Object.keys(files));
|
print("checking " + dir.path + " - should contain " + Object.keys(files));
|
||||||
let seen = new Set();
|
let seen = new Set();
|
||||||
let enumerator = dir.directoryEntries;
|
for (let file of dir.directoryEntries) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let file = enumerator.getNext().QueryInterface(Ci.nsIFile);
|
|
||||||
print("found file: " + file.path);
|
print("found file: " + file.path);
|
||||||
Assert.ok(file.leafName in files, file.leafName + " exists, but shouldn't");
|
Assert.ok(file.leafName in files, file.leafName + " exists, but shouldn't");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,7 @@ this.ASRouterTriggerListeners = new Map([
|
||||||
Services.ww.registerNotification(this);
|
Services.ww.registerNotification(this);
|
||||||
|
|
||||||
// Add listeners to all existing browser windows
|
// Add listeners to all existing browser windows
|
||||||
const winEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (winEnum.hasMoreElements()) {
|
|
||||||
let win = winEnum.getNext();
|
|
||||||
if (win.closed || PrivateBrowsingUtils.isWindowPrivate(win)) {
|
if (win.closed || PrivateBrowsingUtils.isWindowPrivate(win)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -59,9 +57,7 @@ this.ASRouterTriggerListeners = new Map([
|
||||||
if (this._initialized) {
|
if (this._initialized) {
|
||||||
Services.ww.unregisterNotification(this);
|
Services.ww.unregisterNotification(this);
|
||||||
|
|
||||||
const winEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (winEnum.hasMoreElements()) {
|
|
||||||
let win = winEnum.getNext();
|
|
||||||
if (win.closed || PrivateBrowsingUtils.isWindowPrivate(win)) {
|
if (win.closed || PrivateBrowsingUtils.isWindowPrivate(win)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,8 @@ this.Screenshots = {
|
||||||
* we are ok to collect screenshots.
|
* we are ok to collect screenshots.
|
||||||
*/
|
*/
|
||||||
_shouldGetScreenshots() {
|
_shouldGetScreenshots() {
|
||||||
const windows = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windows.hasMoreElements()) {
|
if (!PrivateBrowsingUtils.isWindowPrivate(win)) {
|
||||||
if (!PrivateBrowsingUtils.isWindowPrivate(windows.getNext())) {
|
|
||||||
// As soon as we encounter 1 non-private window, screenshots are fair game.
|
// As soon as we encounter 1 non-private window, screenshots are fair game.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -642,9 +642,8 @@ BrowserGlue.prototype = {
|
||||||
// delays are in seconds
|
// delays are in seconds
|
||||||
const MAX_DELAY = 300;
|
const MAX_DELAY = 300;
|
||||||
let delay = 3;
|
let delay = 3;
|
||||||
let browserEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (browserEnum.hasMoreElements()) {
|
delay += win.gBrowser.tabs.length;
|
||||||
delay += browserEnum.getNext().gBrowser.tabs.length;
|
|
||||||
}
|
}
|
||||||
delay = delay <= MAX_DELAY ? delay : MAX_DELAY;
|
delay = delay <= MAX_DELAY ? delay : MAX_DELAY;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,9 @@ add_task(async function cookie_test() {
|
||||||
let tab = BrowserTestUtils.addTab(gBrowser, BASE_URL + "test_firstParty_cookie.html");
|
let tab = BrowserTestUtils.addTab(gBrowser, BASE_URL + "test_firstParty_cookie.html");
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, true);
|
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, true);
|
||||||
|
|
||||||
let iter = Services.cookies.enumerator;
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
while (iter.hasMoreElements()) {
|
for (let cookie of Services.cookies.enumerator) {
|
||||||
count++;
|
count++;
|
||||||
let cookie = iter.getNext().QueryInterface(Ci.nsICookie2);
|
|
||||||
Assert.equal(cookie.value, "foo", "Cookie value should be foo");
|
Assert.equal(cookie.value, "foo", "Cookie value should be foo");
|
||||||
Assert.equal(cookie.originAttributes.firstPartyDomain, BASE_DOMAIN, "Cookie's origin attributes should be " + BASE_DOMAIN);
|
Assert.equal(cookie.originAttributes.firstPartyDomain, BASE_DOMAIN, "Cookie's origin attributes should be " + BASE_DOMAIN);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,9 +154,7 @@ PaymentUIService.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
findDialog(requestId) {
|
findDialog(requestId) {
|
||||||
let enu = Services.wm.getEnumerator(null);
|
for (let win of Services.wm.getEnumerator(null)) {
|
||||||
let win;
|
|
||||||
while ((win = enu.getNext())) {
|
|
||||||
if (win.name == `${this.REQUEST_ID_PREFIX}${requestId}`) {
|
if (win.name == `${this.REQUEST_ID_PREFIX}${requestId}`) {
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,7 @@ const {PaymentTestUtils: PTU} = ChromeUtils.import(
|
||||||
"resource://testing-common/PaymentTestUtils.jsm", {});
|
"resource://testing-common/PaymentTestUtils.jsm", {});
|
||||||
|
|
||||||
function getPaymentRequests() {
|
function getPaymentRequests() {
|
||||||
let requestsEnum = paymentSrv.enumerate();
|
return Array.from(paymentSrv.enumerate());
|
||||||
let requests = [];
|
|
||||||
while (requestsEnum.hasMoreElements()) {
|
|
||||||
requests.push(requestsEnum.getNext().QueryInterface(Ci.nsIPaymentRequest));
|
|
||||||
}
|
|
||||||
return requests;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,10 @@ var gAppManagerDialog = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var list = document.getElementById("appList");
|
var list = document.getElementById("appList");
|
||||||
var apps = this.handlerInfo.possibleApplicationHandlers.enumerate();
|
for (let app of this.handlerInfo.possibleApplicationHandlers.enumerate()) {
|
||||||
while (apps.hasMoreElements()) {
|
|
||||||
let app = apps.getNext();
|
|
||||||
if (!gMainPane.isValidHandlerApp(app))
|
if (!gMainPane.isValidHandlerApp(app))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
app.QueryInterface(Ci.nsIHandlerApp);
|
|
||||||
|
|
||||||
// Ensure the XBL binding is created eagerly.
|
// Ensure the XBL binding is created eagerly.
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
list.appendChild(MozXULElement.parseXULToFragment("<richlistitem/>"));
|
list.appendChild(MozXULElement.parseXULToFragment("<richlistitem/>"));
|
||||||
|
|
|
||||||
|
|
@ -1397,10 +1397,7 @@ var gMainPane = {
|
||||||
* Load the set of handlers defined by the application datastore.
|
* Load the set of handlers defined by the application datastore.
|
||||||
*/
|
*/
|
||||||
_loadApplicationHandlers() {
|
_loadApplicationHandlers() {
|
||||||
var wrappedHandlerInfos = gHandlerService.enumerate();
|
for (let wrappedHandlerInfo of gHandlerService.enumerate()) {
|
||||||
while (wrappedHandlerInfos.hasMoreElements()) {
|
|
||||||
let wrappedHandlerInfo =
|
|
||||||
wrappedHandlerInfos.getNext().QueryInterface(Ci.nsIHandlerInfo);
|
|
||||||
let type = wrappedHandlerInfo.type;
|
let type = wrappedHandlerInfo.type;
|
||||||
|
|
||||||
let handlerInfoWrapper;
|
let handlerInfoWrapper;
|
||||||
|
|
@ -1661,10 +1658,8 @@ var gMainPane = {
|
||||||
|
|
||||||
// Create menu items for possible handlers.
|
// Create menu items for possible handlers.
|
||||||
let preferredApp = handlerInfo.preferredApplicationHandler;
|
let preferredApp = handlerInfo.preferredApplicationHandler;
|
||||||
let possibleApps = handlerInfo.possibleApplicationHandlers.enumerate();
|
|
||||||
var possibleAppMenuItems = [];
|
var possibleAppMenuItems = [];
|
||||||
while (possibleApps.hasMoreElements()) {
|
for (let possibleApp of handlerInfo.possibleApplicationHandlers.enumerate()) {
|
||||||
let possibleApp = possibleApps.getNext();
|
|
||||||
if (!this.isValidHandlerApp(possibleApp))
|
if (!this.isValidHandlerApp(possibleApp))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -1692,10 +1687,8 @@ var gMainPane = {
|
||||||
let gIOSvc = Cc["@mozilla.org/gio-service;1"].
|
let gIOSvc = Cc["@mozilla.org/gio-service;1"].
|
||||||
getService(Ci.nsIGIOService);
|
getService(Ci.nsIGIOService);
|
||||||
var gioApps = gIOSvc.getAppsForURIScheme(handlerInfo.type);
|
var gioApps = gIOSvc.getAppsForURIScheme(handlerInfo.type);
|
||||||
let enumerator = gioApps.enumerate();
|
|
||||||
let possibleHandlers = handlerInfo.possibleApplicationHandlers;
|
let possibleHandlers = handlerInfo.possibleApplicationHandlers;
|
||||||
while (enumerator.hasMoreElements()) {
|
for (let handler of gioApps.enumerate()) {
|
||||||
let handler = enumerator.getNext().QueryInterface(Ci.nsIHandlerApp);
|
|
||||||
// OS handler share the same name, it's most likely the same app, skipping...
|
// OS handler share the same name, it's most likely the same app, skipping...
|
||||||
if (handler.name == handlerInfo.defaultDescription) {
|
if (handler.name == handlerInfo.defaultDescription) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -2400,6 +2393,10 @@ function ArrayEnumerator(aItems) {
|
||||||
ArrayEnumerator.prototype = {
|
ArrayEnumerator.prototype = {
|
||||||
_index: 0,
|
_index: 0,
|
||||||
|
|
||||||
|
[Symbol.iterator]() {
|
||||||
|
return this._contents.values();
|
||||||
|
},
|
||||||
|
|
||||||
hasMoreElements() {
|
hasMoreElements() {
|
||||||
return this._index < this._contents.length;
|
return this._index < this._contents.length;
|
||||||
},
|
},
|
||||||
|
|
@ -2710,9 +2707,8 @@ class HandlerInfoWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
addPossibleApplicationHandler(aNewHandler) {
|
addPossibleApplicationHandler(aNewHandler) {
|
||||||
var possibleApps = this.possibleApplicationHandlers.enumerate();
|
for (let app of this.possibleApplicationHandlers.enumerate()) {
|
||||||
while (possibleApps.hasMoreElements()) {
|
if (app.equals(aNewHandler))
|
||||||
if (possibleApps.getNext().equals(aNewHandler))
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.possibleApplicationHandlers.appendElement(aNewHandler);
|
this.possibleApplicationHandlers.appendElement(aNewHandler);
|
||||||
|
|
|
||||||
|
|
@ -54,15 +54,10 @@ var gLanguagesDialog = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1) Read the available languages out of language.properties
|
// 1) Read the available languages out of language.properties
|
||||||
var strings = bundleAccepted.strings;
|
|
||||||
|
|
||||||
let localeCodes = [];
|
let localeCodes = [];
|
||||||
let localeValues = [];
|
let localeValues = [];
|
||||||
while (strings.hasMoreElements()) {
|
for (let currString of bundleAccepted.strings) {
|
||||||
var currString = strings.getNext();
|
|
||||||
if (!(currString instanceof Ci.nsIPropertyElement))
|
|
||||||
break;
|
|
||||||
|
|
||||||
var property = currString.key.split("."); // ab[-cd].accept
|
var property = currString.key.split("."); // ab[-cd].accept
|
||||||
if (property[1] == "accept") {
|
if (property[1] == "accept") {
|
||||||
localeCodes.push(property[0]);
|
localeCodes.push(property[0]);
|
||||||
|
|
|
||||||
|
|
@ -260,9 +260,7 @@ var gPermissionManager = {
|
||||||
|
|
||||||
_loadPermissions() {
|
_loadPermissions() {
|
||||||
// load permissions into a table.
|
// load permissions into a table.
|
||||||
let enumerator = Services.perms.enumerator;
|
for (let nextPermission of Services.perms.enumerator) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let nextPermission = enumerator.getNext().QueryInterface(Ci.nsIPermission);
|
|
||||||
this._addPermissionToList(nextPermission);
|
this._addPermissionToList(nextPermission);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -192,9 +192,7 @@ var gSitePermissionsManager = {
|
||||||
|
|
||||||
_loadPermissions() {
|
_loadPermissions() {
|
||||||
// load permissions into a table.
|
// load permissions into a table.
|
||||||
let enumerator = Services.perms.enumerator;
|
for (let nextPermission of Services.perms.enumerator) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let nextPermission = enumerator.getNext().QueryInterface(Ci.nsIPermission);
|
|
||||||
this._addPermissionToList(nextPermission);
|
this._addPermissionToList(nextPermission);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,7 @@ var gTranslationExceptions = {
|
||||||
|
|
||||||
// Load site permissions into an array.
|
// Load site permissions into an array.
|
||||||
this._sites = [];
|
this._sites = [];
|
||||||
let enumerator = Services.perms.enumerator;
|
for (let perm of Services.perms.enumerator) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let perm = enumerator.getNext().QueryInterface(Ci.nsIPermission);
|
|
||||||
|
|
||||||
if (perm.type == kPermissionType &&
|
if (perm.type == kPermissionType &&
|
||||||
perm.capability == Services.perms.DENY_ACTION) {
|
perm.capability == Services.perms.DENY_ACTION) {
|
||||||
this._sites.push(perm.principal.origin);
|
this._sites.push(perm.principal.origin);
|
||||||
|
|
|
||||||
|
|
@ -176,9 +176,8 @@ var SessionCookiesInternal = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let iter = Services.cookies.sessionEnumerator;
|
for (let cookie of Services.cookies.sessionEnumerator) {
|
||||||
while (iter.hasMoreElements()) {
|
this._addCookie(cookie);
|
||||||
this._addCookie(iter.getNext());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -597,9 +597,7 @@ var SessionStoreInternal = {
|
||||||
// in one of the currently open windows that was closed after the
|
// in one of the currently open windows that was closed after the
|
||||||
// last-closed window.
|
// last-closed window.
|
||||||
let tabTimestamps = [];
|
let tabTimestamps = [];
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let window = windowsEnum.getNext();
|
|
||||||
let windowState = this._windows[window.__SSi];
|
let windowState = this._windows[window.__SSi];
|
||||||
if (windowState && windowState._closedTabs[0]) {
|
if (windowState && windowState._closedTabs[0]) {
|
||||||
tabTimestamps.push(windowState._closedTabs[0].closedAt);
|
tabTimestamps.push(windowState._closedTabs[0].closedAt);
|
||||||
|
|
@ -2722,9 +2720,7 @@ var SessionStoreInternal = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for a tab.
|
// Check for a tab.
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let window = windowsEnum.getNext();
|
|
||||||
let windowState = this._windows[window.__SSi];
|
let windowState = this._windows[window.__SSi];
|
||||||
if (windowState) {
|
if (windowState) {
|
||||||
for (let j = 0, l = windowState._closedTabs.length; j < l; j++) {
|
for (let j = 0, l = windowState._closedTabs.length; j < l; j++) {
|
||||||
|
|
@ -2785,9 +2781,7 @@ var SessionStoreInternal = {
|
||||||
|
|
||||||
// This method deletes all the closedTabs matching userContextId.
|
// This method deletes all the closedTabs matching userContextId.
|
||||||
_forgetTabsWithUserContextId(userContextId) {
|
_forgetTabsWithUserContextId(userContextId) {
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let window = windowsEnum.getNext();
|
|
||||||
let windowState = this._windows[window.__SSi];
|
let windowState = this._windows[window.__SSi];
|
||||||
if (windowState) {
|
if (windowState) {
|
||||||
// In order to remove the tabs in the correct order, we store the
|
// In order to remove the tabs in the correct order, we store the
|
||||||
|
|
@ -2972,9 +2966,7 @@ var SessionStoreInternal = {
|
||||||
* Revive all crashed tabs and reset the crashed tabs count to 0.
|
* Revive all crashed tabs and reset the crashed tabs count to 0.
|
||||||
*/
|
*/
|
||||||
reviveAllCrashedTabs() {
|
reviveAllCrashedTabs() {
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let window = windowsEnum.getNext();
|
|
||||||
for (let tab of window.gBrowser.tabs) {
|
for (let tab of window.gBrowser.tabs) {
|
||||||
this.reviveCrashedTab(tab);
|
this.reviveCrashedTab(tab);
|
||||||
}
|
}
|
||||||
|
|
@ -4329,11 +4321,8 @@ var SessionStoreInternal = {
|
||||||
* setBrowserState to treat them as open windows.
|
* setBrowserState to treat them as open windows.
|
||||||
*/
|
*/
|
||||||
_handleClosedWindows: function ssi_handleClosedWindows() {
|
_handleClosedWindows: function ssi_handleClosedWindows() {
|
||||||
var windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
|
||||||
|
|
||||||
let promises = [];
|
let promises = [];
|
||||||
while (windowsEnum.hasMoreElements()) {
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
var window = windowsEnum.getNext();
|
|
||||||
if (window.closed) {
|
if (window.closed) {
|
||||||
promises.push(this.onClose(window));
|
promises.push(this.onClose(window));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,8 @@ const IS_MAC = navigator.platform.match(/Mac/);
|
||||||
*/
|
*/
|
||||||
function getBrowserWindowsCount() {
|
function getBrowserWindowsCount() {
|
||||||
let open = 0;
|
let open = 0;
|
||||||
let e = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (e.hasMoreElements()) {
|
if (!win.closed)
|
||||||
if (!e.getNext().closed)
|
|
||||||
++open;
|
++open;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,8 @@ add_task(async function() {
|
||||||
let state = ss.getBrowserState();
|
let state = ss.getBrowserState();
|
||||||
|
|
||||||
// verify our cookie got set during pageload
|
// verify our cookie got set during pageload
|
||||||
let enumerator = Services.cookies.enumerator;
|
|
||||||
let cookie;
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
while (enumerator.hasMoreElements()) {
|
for (var cookie of Services.cookies.enumerator) {
|
||||||
cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
Assert.equal(i, 1, "expected one cookie");
|
Assert.equal(i, 1, "expected one cookie");
|
||||||
|
|
@ -39,10 +36,7 @@ add_task(async function() {
|
||||||
await setBrowserState(state);
|
await setBrowserState(state);
|
||||||
|
|
||||||
// at this point, the cookie should be restored...
|
// at this point, the cookie should be restored...
|
||||||
enumerator = Services.cookies.enumerator;
|
for (var cookie2 of Services.cookies.enumerator) {
|
||||||
let cookie2;
|
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
cookie2 = enumerator.getNext().QueryInterface(Ci.nsICookie);
|
|
||||||
if (cookie.name == cookie2.name)
|
if (cookie.name == cookie2.name)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,8 @@ function test() {
|
||||||
|
|
||||||
function browserWindowsCount(expected) {
|
function browserWindowsCount(expected) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
let e = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (e.hasMoreElements()) {
|
if (!win.closed)
|
||||||
if (!e.getNext().closed)
|
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
is(count, expected,
|
is(count, expected,
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
function browserWindowsCount(expected) {
|
function browserWindowsCount(expected) {
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var e = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (e.hasMoreElements()) {
|
if (!win.closed)
|
||||||
if (!e.getNext().closed)
|
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
is(count, expected,
|
is(count, expected,
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,8 @@ function testBug600545() {
|
||||||
function done() {
|
function done() {
|
||||||
// Enumerate windows and close everything but our primary window. We can't
|
// Enumerate windows and close everything but our primary window. We can't
|
||||||
// use waitForFocus() because apparently it's buggy. See bug 599253.
|
// use waitForFocus() because apparently it's buggy. See bug 599253.
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
|
||||||
let closeWinPromises = [];
|
let closeWinPromises = [];
|
||||||
while (windowsEnum.hasMoreElements()) {
|
for (let currentWindow of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
let currentWindow = windowsEnum.getNext();
|
|
||||||
if (currentWindow != window)
|
if (currentWindow != window)
|
||||||
closeWinPromises.push(BrowserTestUtils.closeWindow(currentWindow));
|
closeWinPromises.push(BrowserTestUtils.closeWindow(currentWindow));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,8 @@ function runNextTest() {
|
||||||
if (tests.length) {
|
if (tests.length) {
|
||||||
// Enumerate windows and close everything but our primary window. We can't
|
// Enumerate windows and close everything but our primary window. We can't
|
||||||
// use waitForFocus() because apparently it's buggy. See bug 599253.
|
// use waitForFocus() because apparently it's buggy. See bug 599253.
|
||||||
var windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
|
||||||
let closeWinPromises = [];
|
let closeWinPromises = [];
|
||||||
while (windowsEnum.hasMoreElements()) {
|
for (let currentWindow of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
var currentWindow = windowsEnum.getNext();
|
|
||||||
if (currentWindow != window) {
|
if (currentWindow != window) {
|
||||||
closeWinPromises.push(BrowserTestUtils.closeWindow(currentWindow));
|
closeWinPromises.push(BrowserTestUtils.closeWindow(currentWindow));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,7 @@ function test() {
|
||||||
|
|
||||||
function countTabs() {
|
function countTabs() {
|
||||||
let needsRestore = 0, isRestoring = 0;
|
let needsRestore = 0, isRestoring = 0;
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
|
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let window = windowsEnum.getNext();
|
|
||||||
if (window.closed)
|
if (window.closed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,11 +136,8 @@ add_task(async function run_test() {
|
||||||
// Restore window with session cookies that have no originAttributes.
|
// Restore window with session cookies that have no originAttributes.
|
||||||
await setWindowState(win, SESSION_DATA, true);
|
await setWindowState(win, SESSION_DATA, true);
|
||||||
|
|
||||||
let enumerator = Services.cookies.getCookiesFromHost(TEST_HOST, {});
|
|
||||||
let cookie;
|
|
||||||
let cookieCount = 0;
|
let cookieCount = 0;
|
||||||
while (enumerator.hasMoreElements()) {
|
for (var cookie of Services.cookies.getCookiesFromHost(TEST_HOST, {})) {
|
||||||
cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
|
|
||||||
cookieCount++;
|
cookieCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,10 +153,8 @@ add_task(async function run_test() {
|
||||||
// Restore window with session cookies that have originAttributes within.
|
// Restore window with session cookies that have originAttributes within.
|
||||||
await setWindowState(win, SESSION_DATA_OA, true);
|
await setWindowState(win, SESSION_DATA_OA, true);
|
||||||
|
|
||||||
enumerator = Services.cookies.getCookiesFromHost(TEST_HOST, {});
|
|
||||||
cookieCount = 0;
|
cookieCount = 0;
|
||||||
while (enumerator.hasMoreElements()) {
|
for (cookie of Services.cookies.getCookiesFromHost(TEST_HOST, {})) {
|
||||||
cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
|
|
||||||
cookieCount++;
|
cookieCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -318,9 +318,7 @@ function r() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function* BrowserWindowIterator() {
|
function* BrowserWindowIterator() {
|
||||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let currentWindow of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windowsEnum.hasMoreElements()) {
|
|
||||||
let currentWindow = windowsEnum.getNext();
|
|
||||||
if (!currentWindow.closed) {
|
if (!currentWindow.closed) {
|
||||||
yield currentWindow;
|
yield currentWindow;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,7 @@ function getLanguageExceptions() {
|
||||||
|
|
||||||
function getDomainExceptions() {
|
function getDomainExceptions() {
|
||||||
let results = [];
|
let results = [];
|
||||||
let enumerator = Services.perms.enumerator;
|
for (let perm of Services.perms.enumerator) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let perm = enumerator.getNext().QueryInterface(Ci.nsIPermission);
|
|
||||||
|
|
||||||
if (perm.type == "translate" &&
|
if (perm.type == "translate" &&
|
||||||
perm.capability == Services.perms.DENY_ACTION)
|
perm.capability == Services.perms.DENY_ACTION)
|
||||||
results.push(perm.principal);
|
results.push(perm.principal);
|
||||||
|
|
|
||||||
|
|
@ -652,9 +652,7 @@ var UITour = {
|
||||||
// The browser message manager is disconnected when the <browser> is
|
// The browser message manager is disconnected when the <browser> is
|
||||||
// destroyed and we want to teardown at that point.
|
// destroyed and we want to teardown at that point.
|
||||||
case "message-manager-close": {
|
case "message-manager-close": {
|
||||||
let winEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (winEnum.hasMoreElements()) {
|
|
||||||
let window = winEnum.getNext();
|
|
||||||
if (window.closed)
|
if (window.closed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -1683,9 +1681,7 @@ var UITour = {
|
||||||
},
|
},
|
||||||
|
|
||||||
notify(eventName, params) {
|
notify(eventName, params) {
|
||||||
let winEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (winEnum.hasMoreElements()) {
|
|
||||||
let window = winEnum.getNext();
|
|
||||||
if (window.closed)
|
if (window.closed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,24 +47,16 @@ function getDialogDoc() {
|
||||||
// through all the open windows and all the <browsers> in each.
|
// through all the open windows and all the <browsers> in each.
|
||||||
|
|
||||||
// var enumerator = wm.getEnumerator("navigator:browser");
|
// var enumerator = wm.getEnumerator("navigator:browser");
|
||||||
var enumerator = Services.wm.getXULWindowEnumerator(null);
|
for (let {docShell} of Services.wm.getEnumerator(null)) {
|
||||||
|
var containedDocShells = docShell.getDocShellEnumerator(
|
||||||
while (enumerator.hasMoreElements()) {
|
docShell.typeChrome,
|
||||||
var win = enumerator.getNext();
|
docShell.ENUMERATE_FORWARDS);
|
||||||
var windowDocShell = win.QueryInterface(Ci.nsIXULWindow).docShell;
|
for (let childDocShell of containedDocShells) {
|
||||||
|
|
||||||
var containedDocShells = windowDocShell.getDocShellEnumerator(
|
|
||||||
Ci.nsIDocShellTreeItem.typeChrome,
|
|
||||||
Ci.nsIDocShell.ENUMERATE_FORWARDS);
|
|
||||||
while (containedDocShells.hasMoreElements()) {
|
|
||||||
// Get the corresponding document for this docshell
|
// Get the corresponding document for this docshell
|
||||||
var childDocShell = containedDocShells.getNext();
|
|
||||||
// We don't want it if it's not done loading.
|
// We don't want it if it's not done loading.
|
||||||
if (childDocShell.busyFlags != Ci.nsIDocShell.BUSY_FLAGS_NONE)
|
if (childDocShell.busyFlags != Ci.nsIDocShell.BUSY_FLAGS_NONE)
|
||||||
continue;
|
continue;
|
||||||
var childDoc = childDocShell.QueryInterface(Ci.nsIDocShell)
|
var childDoc = childDocShell.contentViewer.DOMDocument;
|
||||||
.contentViewer
|
|
||||||
.DOMDocument;
|
|
||||||
|
|
||||||
// ok(true, "Got window: " + childDoc.location.href);
|
// ok(true, "Got window: " + childDoc.location.href);
|
||||||
if (childDoc.location.href == "chrome://global/content/commonDialog.xul")
|
if (childDoc.location.href == "chrome://global/content/commonDialog.xul")
|
||||||
|
|
|
||||||
|
|
@ -128,11 +128,8 @@ this.formautofill = class extends ExtensionAPI {
|
||||||
|
|
||||||
Services.mm.removeMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup);
|
Services.mm.removeMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup);
|
||||||
|
|
||||||
let enumerator = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (enumerator.hasMoreElements()) {
|
let cachedStyleSheets = CACHED_STYLESHEETS.get(win);
|
||||||
let win = enumerator.getNext();
|
|
||||||
let domWindow = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
|
|
||||||
let cachedStyleSheets = CACHED_STYLESHEETS.get(domWindow);
|
|
||||||
|
|
||||||
if (!cachedStyleSheets) {
|
if (!cachedStyleSheets) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js",
|
||||||
const EXTENSION_ID = "formautofill@mozilla.org";
|
const EXTENSION_ID = "formautofill@mozilla.org";
|
||||||
|
|
||||||
AddonTestUtils.init(this);
|
AddonTestUtils.init(this);
|
||||||
|
AddonTestUtils.overrideCertDB();
|
||||||
|
|
||||||
async function loadExtension() {
|
async function loadExtension() {
|
||||||
AddonTestUtils.createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
AddonTestUtils.createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
||||||
|
|
|
||||||
|
|
@ -99,9 +99,7 @@ function getLocalizedStrings(path) {
|
||||||
Services.strings.createBundle("chrome://pdf.js/locale/" + path);
|
Services.strings.createBundle("chrome://pdf.js/locale/" + path);
|
||||||
|
|
||||||
var map = {};
|
var map = {};
|
||||||
var enumerator = stringBundle.getSimpleEnumeration();
|
for (let string of stringBundle.getSimpleEnumeration()) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
var string = enumerator.getNext().QueryInterface(Ci.nsIPropertyElement);
|
|
||||||
var key = string.key, property = "textContent";
|
var key = string.key, property = "textContent";
|
||||||
var i = key.lastIndexOf(".");
|
var i = key.lastIndexOf(".");
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
|
|
|
||||||
7
browser/extensions/pocket/bootstrap.js
vendored
7
browser/extensions/pocket/bootstrap.js
vendored
|
|
@ -538,9 +538,6 @@ function install() {
|
||||||
function uninstall() {
|
function uninstall() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function* browserWindows() {
|
function browserWindows() {
|
||||||
let windows = Services.wm.getEnumerator("navigator:browser");
|
return Services.wm.getEnumerator("navigator:browser");
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
yield windows.getNext();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -530,9 +530,7 @@ var pktUI = (function() {
|
||||||
pktUIMessaging.addMessageListener(iframe, _initL10NMessageId, function(panelId, data) {
|
pktUIMessaging.addMessageListener(iframe, _initL10NMessageId, function(panelId, data) {
|
||||||
var strings = {};
|
var strings = {};
|
||||||
var bundle = Services.strings.createBundle("chrome://pocket/locale/pocket.properties");
|
var bundle = Services.strings.createBundle("chrome://pocket/locale/pocket.properties");
|
||||||
var e = bundle.getSimpleEnumeration();
|
for (let str of bundle.getSimpleEnumeration()) {
|
||||||
while (e.hasMoreElements()) {
|
|
||||||
var str = e.getNext().QueryInterface(Ci.nsIPropertyElement);
|
|
||||||
if (str.key in data) {
|
if (str.key in data) {
|
||||||
strings[str.key] = bundle.formatStringFromName(str.key, data[str.key], data[str.key].length);
|
strings[str.key] = bundle.formatStringFromName(str.key, data[str.key], data[str.key].length);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -568,9 +566,7 @@ var pktUI = (function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let windows = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
let win = windows.getNext();
|
|
||||||
if (!PrivateBrowsingUtils.isWindowPrivate(win)) {
|
if (!PrivateBrowsingUtils.isWindowPrivate(win)) {
|
||||||
win.openWebLinkIn(url, "tab", {
|
win.openWebLinkIn(url, "tab", {
|
||||||
triggeringPrincipal: aTriggeringPrincipal
|
triggeringPrincipal: aTriggeringPrincipal
|
||||||
|
|
|
||||||
|
|
@ -155,10 +155,8 @@ var pktApi = (function() {
|
||||||
* The return format: { cookieName:cookieValue, cookieName:cookieValue, ... }
|
* The return format: { cookieName:cookieValue, cookieName:cookieValue, ... }
|
||||||
*/
|
*/
|
||||||
function getCookiesFromPocket() {
|
function getCookiesFromPocket() {
|
||||||
var pocketCookies = Services.cookies.getCookiesFromHost(pocketSiteHost, {});
|
|
||||||
var cookies = {};
|
var cookies = {};
|
||||||
while (pocketCookies.hasMoreElements()) {
|
for (let cookie of Services.cookies.getCookiesFromHost(pocketSiteHost, {})) {
|
||||||
var cookie = pocketCookies.getNext().QueryInterface(Ci.nsICookie2);
|
|
||||||
cookies[cookie.name] = cookie.value;
|
cookies[cookie.name] = cookie.value;
|
||||||
}
|
}
|
||||||
return cookies;
|
return cookies;
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,7 @@ function getOpenTabsAndWinsCounts() {
|
||||||
let tabCount = 0;
|
let tabCount = 0;
|
||||||
let winCount = 0;
|
let winCount = 0;
|
||||||
|
|
||||||
let browserEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (browserEnum.hasMoreElements()) {
|
|
||||||
let win = browserEnum.getNext();
|
|
||||||
winCount++;
|
winCount++;
|
||||||
tabCount += win.gBrowser.tabs.length;
|
tabCount += win.gBrowser.tabs.length;
|
||||||
}
|
}
|
||||||
|
|
@ -659,9 +657,8 @@ let BrowserUsageTelemetry = {
|
||||||
Services.obs.addObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC, true);
|
Services.obs.addObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC, true);
|
||||||
|
|
||||||
// Attach the tabopen handlers to the existing Windows.
|
// Attach the tabopen handlers to the existing Windows.
|
||||||
let browserEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (browserEnum.hasMoreElements()) {
|
this._registerWindow(win);
|
||||||
this._registerWindow(browserEnum.getNext());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the initial tab and windows max counts.
|
// Get the initial tab and windows max counts.
|
||||||
|
|
|
||||||
|
|
@ -169,19 +169,15 @@ var WindowHelper = {
|
||||||
// if we're lucky, this isn't a popup, and we can just return this
|
// if we're lucky, this isn't a popup, and we can just return this
|
||||||
if (win && !isSuitableBrowserWindow(win)) {
|
if (win && !isSuitableBrowserWindow(win)) {
|
||||||
win = null;
|
win = null;
|
||||||
let windowList = Services.wm.getEnumerator("navigator:browser");
|
|
||||||
// this is oldest to newest, so this gets a bit ugly
|
// this is oldest to newest, so this gets a bit ugly
|
||||||
while (windowList.hasMoreElements()) {
|
for (let nextWin of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
let nextWin = windowList.getNext();
|
|
||||||
if (isSuitableBrowserWindow(nextWin))
|
if (isSuitableBrowserWindow(nextWin))
|
||||||
win = nextWin;
|
win = nextWin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
let windowList = Services.wm.getZOrderDOMWindowEnumerator("navigator:browser", true);
|
for (let win of Services.wm.getZOrderDOMWindowEnumerator("navigator:browser", true)) {
|
||||||
while (windowList.hasMoreElements()) {
|
|
||||||
let win = windowList.getNext();
|
|
||||||
if (isSuitableBrowserWindow(win))
|
if (isSuitableBrowserWindow(win))
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -458,9 +458,7 @@ var TabCrashHandler = {
|
||||||
},
|
},
|
||||||
|
|
||||||
removeSubmitCheckboxesForSameCrash(childID) {
|
removeSubmitCheckboxesForSameCrash(childID) {
|
||||||
let enumerator = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let window = enumerator.getNext();
|
|
||||||
if (!window.gMultiProcessBrowser)
|
if (!window.gMultiProcessBrowser)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -1069,9 +1067,7 @@ var PluginCrashReporter = {
|
||||||
},
|
},
|
||||||
|
|
||||||
broadcastState(runID, state) {
|
broadcastState(runID, state) {
|
||||||
let enumerator = Services.wm.getEnumerator("navigator:browser");
|
for (let window of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let window = enumerator.getNext();
|
|
||||||
let mm = window.messageManager;
|
let mm = window.messageManager;
|
||||||
mm.broadcastAsyncMessage("BrowserPlugins:CrashReportSubmitted",
|
mm.broadcastAsyncMessage("BrowserPlugins:CrashReportSubmitted",
|
||||||
{ runID, state });
|
{ runID, state });
|
||||||
|
|
|
||||||
|
|
@ -1204,10 +1204,7 @@ function* allBrowserWindows(browserWindow = null) {
|
||||||
yield browserWindow;
|
yield browserWindow;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let windows = Services.wm.getEnumerator("navigator:browser");
|
yield* Services.wm.getEnumerator("navigator:browser");
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
yield windows.getNext();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -391,9 +391,7 @@ var ProcessHangMonitor = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (e.hasMoreElements()) {
|
for (let win of e) {
|
||||||
let win = e.getNext();
|
|
||||||
|
|
||||||
this.updateWindow(win);
|
this.updateWindow(win);
|
||||||
|
|
||||||
// Only listen for these events if there are active hang reports.
|
// Only listen for these events if there are active hang reports.
|
||||||
|
|
|
||||||
|
|
@ -351,9 +351,7 @@ var Sanitizer = {
|
||||||
TelemetryStopwatch.start("FX_SANITIZE_FORMDATA", refObj);
|
TelemetryStopwatch.start("FX_SANITIZE_FORMDATA", refObj);
|
||||||
try {
|
try {
|
||||||
// Clear undo history of all search bars.
|
// Clear undo history of all search bars.
|
||||||
let windows = Services.wm.getEnumerator("navigator:browser");
|
for (let currentWindow of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
let currentWindow = windows.getNext();
|
|
||||||
let currentDocument = currentWindow.document;
|
let currentDocument = currentWindow.document;
|
||||||
|
|
||||||
// searchBar.textbox may not exist due to the search bar binding
|
// searchBar.textbox may not exist due to the search bar binding
|
||||||
|
|
@ -466,10 +464,8 @@ var Sanitizer = {
|
||||||
let startDate = existingWindow.performance.now();
|
let startDate = existingWindow.performance.now();
|
||||||
|
|
||||||
// First check if all these windows are OK with being closed:
|
// First check if all these windows are OK with being closed:
|
||||||
let windowEnumerator = Services.wm.getEnumerator("navigator:browser");
|
|
||||||
let windowList = [];
|
let windowList = [];
|
||||||
while (windowEnumerator.hasMoreElements()) {
|
for (let someWin of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
let someWin = windowEnumerator.getNext();
|
|
||||||
windowList.push(someWin);
|
windowList.push(someWin);
|
||||||
// If someone says "no" to a beforeunload prompt, we abort here:
|
// If someone says "no" to a beforeunload prompt, we abort here:
|
||||||
if (!this._canCloseWindow(someWin)) {
|
if (!this._canCloseWindow(someWin)) {
|
||||||
|
|
@ -690,9 +686,7 @@ async function sanitizeOnShutdown(progress) {
|
||||||
await sanitizeSessionPrincipals();
|
await sanitizeSessionPrincipals();
|
||||||
|
|
||||||
// Let's see if we have to forget some particular site.
|
// Let's see if we have to forget some particular site.
|
||||||
let enumerator = Services.perms.enumerator;
|
for (let permission of Services.perms.enumerator) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
let permission = enumerator.getNext().QueryInterface(Ci.nsIPermission);
|
|
||||||
if (permission.type == "cookie" && permission.capability == Ci.nsICookiePermission.ACCESS_SESSION) {
|
if (permission.type == "cookie" && permission.capability == Ci.nsICookiePermission.ACCESS_SESSION) {
|
||||||
await sanitizeSessionPrincipal(permission.principal);
|
await sanitizeSessionPrincipal(permission.principal);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -459,9 +459,7 @@ class WindowWatcher {
|
||||||
this._errorCallback = errorCallback;
|
this._errorCallback = errorCallback;
|
||||||
|
|
||||||
// Add loadCallback to existing windows
|
// Add loadCallback to existing windows
|
||||||
const windows = Services.wm.getEnumerator("navigator:browser");
|
for (const win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
const win = windows.getNext();
|
|
||||||
try {
|
try {
|
||||||
this._loadCallback(win);
|
this._loadCallback(win);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|
@ -480,9 +478,7 @@ class WindowWatcher {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const windows = Services.wm.getEnumerator("navigator:browser");
|
for (const win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (windows.hasMoreElements()) {
|
|
||||||
const win = windows.getNext();
|
|
||||||
try {
|
try {
|
||||||
this._unloadCallback(win);
|
this._unloadCallback(win);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|
|
||||||
|
|
@ -173,9 +173,7 @@ var SiteDataManager = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_getAllCookies() {
|
_getAllCookies() {
|
||||||
let cookiesEnum = Services.cookies.enumerator;
|
for (let cookie of Services.cookies.enumerator) {
|
||||||
while (cookiesEnum.hasMoreElements()) {
|
|
||||||
let cookie = cookiesEnum.getNext().QueryInterface(Ci.nsICookie2);
|
|
||||||
let site = this._getOrInsertSite(cookie.rawHost);
|
let site = this._getOrInsertSite(cookie.rawHost);
|
||||||
site.cookies.push(cookie);
|
site.cookies.push(cookie);
|
||||||
if (site.lastAccessed < cookie.lastAccessed) {
|
if (site.lastAccessed < cookie.lastAccessed) {
|
||||||
|
|
|
||||||
|
|
@ -729,9 +729,7 @@ var AeroPeek = {
|
||||||
// (rather than this code running on startup because the pref was
|
// (rather than this code running on startup because the pref was
|
||||||
// already set to true), we must initialize previews for open windows:
|
// already set to true), we must initialize previews for open windows:
|
||||||
if (this.initialized) {
|
if (this.initialized) {
|
||||||
let browserWindows = Services.wm.getEnumerator("navigator:browser");
|
for (let win of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (browserWindows.hasMoreElements()) {
|
|
||||||
let win = browserWindows.getNext();
|
|
||||||
if (!win.closed) {
|
if (!win.closed) {
|
||||||
this.onOpenWindow(win);
|
this.onOpenWindow(win);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ function checkEvents(events, expectedEvents) {
|
||||||
*/
|
*/
|
||||||
function makeMockPermissionRequest(browser) {
|
function makeMockPermissionRequest(browser) {
|
||||||
let type = {
|
let type = {
|
||||||
options: [],
|
options: Cc["@mozilla.org/array;1"].createInstance(Ci.nsIArray),
|
||||||
QueryInterface: ChromeUtils.generateQI([Ci.nsIContentPermissionType]),
|
QueryInterface: ChromeUtils.generateQI([Ci.nsIContentPermissionType]),
|
||||||
};
|
};
|
||||||
let types = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
let types = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
||||||
|
|
|
||||||
|
|
@ -1090,9 +1090,7 @@ function updateIndicators(data, target) {
|
||||||
indicators.showScreenSharingIndicator = data.showScreenSharingIndicator;
|
indicators.showScreenSharingIndicator = data.showScreenSharingIndicator;
|
||||||
}
|
}
|
||||||
|
|
||||||
let browserWindowEnum = Services.wm.getEnumerator("navigator:browser");
|
for (let chromeWin of Services.wm.getEnumerator("navigator:browser")) {
|
||||||
while (browserWindowEnum.hasMoreElements()) {
|
|
||||||
let chromeWin = browserWindowEnum.getNext();
|
|
||||||
if (webrtcUI.showGlobalIndicator) {
|
if (webrtcUI.showGlobalIndicator) {
|
||||||
showOrCreateMenuForWindow(chromeWin);
|
showOrCreateMenuForWindow(chromeWin);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,15 @@ AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If we are debugging, profiling, using sanitizers, or on win32 we want a
|
# If we are debugging, profiling, using sanitizers, or on win32 we want a
|
||||||
# frame pointer.
|
# frame pointer. It is not required to enable frame pointers on AArch64
|
||||||
|
# Windows, but we enable it for compatibility with ETW.
|
||||||
if test -z "$MOZ_OPTIMIZE" -o \
|
if test -z "$MOZ_OPTIMIZE" -o \
|
||||||
-n "$MOZ_PROFILING" -o \
|
-n "$MOZ_PROFILING" -o \
|
||||||
-n "$MOZ_DEBUG" -o \
|
-n "$MOZ_DEBUG" -o \
|
||||||
-n "$MOZ_MSAN" -o \
|
-n "$MOZ_MSAN" -o \
|
||||||
-n "$MOZ_ASAN" -o \
|
-n "$MOZ_ASAN" -o \
|
||||||
"$OS_ARCH:$CPU_ARCH" = "WINNT:x86"; then
|
"$OS_ARCH:$CPU_ARCH" = "WINNT:x86" -o \
|
||||||
|
"$OS_ARCH:$CPU_ARCH" = "WINNT:aarch64"; then
|
||||||
MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
|
MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
|
||||||
else
|
else
|
||||||
MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
|
MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"llvm_revision": "338869",
|
"llvm_revision": "340494",
|
||||||
"stages": "3",
|
"stages": "3",
|
||||||
"build_libcxx": true,
|
"build_libcxx": true,
|
||||||
"build_type": "Release",
|
"build_type": "Release",
|
||||||
"assertions": false,
|
"assertions": false,
|
||||||
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc1",
|
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc2",
|
||||||
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc1",
|
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc2",
|
||||||
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/rc1",
|
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/rc2",
|
||||||
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/rc1",
|
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/rc2",
|
||||||
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/rc1",
|
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/rc2",
|
||||||
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/rc1",
|
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/rc2",
|
||||||
"python_path": "/usr/bin/python2.7",
|
"python_path": "/usr/bin/python2.7",
|
||||||
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
|
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
|
||||||
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
|
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
"as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
|
"as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
|
||||||
"patches": [
|
"patches": [
|
||||||
"find_symbolizer_linux.patch",
|
"find_symbolizer_linux.patch",
|
||||||
"rename_gcov_flush.patch",
|
"rename_gcov_flush.patch"
|
||||||
"r339636.patch"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,18 @@
|
||||||
{
|
{
|
||||||
"llvm_revision": "338869",
|
"llvm_revision": "340494",
|
||||||
"stages": "3",
|
"stages": "3",
|
||||||
"build_libcxx": true,
|
"build_libcxx": true,
|
||||||
"build_type": "Release",
|
"build_type": "Release",
|
||||||
"assertions": false,
|
"assertions": false,
|
||||||
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc1",
|
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc2",
|
||||||
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc1",
|
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc2",
|
||||||
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/rc1",
|
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/rc2",
|
||||||
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/rc1",
|
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/rc2",
|
||||||
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/rc1",
|
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/rc2",
|
||||||
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/rc1",
|
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/rc2",
|
||||||
"python_path": "/usr/bin/python2.7",
|
"python_path": "/usr/bin/python2.7",
|
||||||
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
|
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
|
||||||
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
|
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
|
||||||
"cxx": "/builds/worker/workspace/build/src/gcc/bin/g++",
|
"cxx": "/builds/worker/workspace/build/src/gcc/bin/g++",
|
||||||
"as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
|
"as": "/builds/worker/workspace/build/src/gcc/bin/gcc"
|
||||||
"patches": [
|
|
||||||
"r339636.patch"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,8 @@ if [ -e "$topsrcdir/gcc/bin/ld" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ac_add_options --enable-lto
|
ac_add_options --enable-lto
|
||||||
|
# Until it's either made the default or we figure a way to remove the
|
||||||
|
# copy locations that LTO induces in non-PIE executables.
|
||||||
|
ac_add_options --enable-pie
|
||||||
|
|
||||||
. "$topsrcdir/build/unix/mozconfig.stdcxx"
|
. "$topsrcdir/build/unix/mozconfig.stdcxx"
|
||||||
|
|
|
||||||
|
|
@ -217,9 +217,15 @@ function getMappedExpression(expression) {
|
||||||
sourceMaps
|
sourceMaps
|
||||||
}) {
|
}) {
|
||||||
const mappings = (0, _selectors.getSelectedScopeMappings)(getState());
|
const mappings = (0, _selectors.getSelectedScopeMappings)(getState());
|
||||||
const bindings = (0, _selectors.getSelectedFrameBindings)(getState());
|
const bindings = (0, _selectors.getSelectedFrameBindings)(getState()); // We bail early if we do not need to map the expression. This is important
|
||||||
|
// because mapping an expression can be slow if the parser worker is
|
||||||
|
// busy doing other work.
|
||||||
|
//
|
||||||
|
// 1. there are no mappings - we do not need to map original expressions
|
||||||
|
// 2. does not contain `await` - we do not need to map top level awaits
|
||||||
|
// 3. does not contain `=` - we do not need to map assignments
|
||||||
|
|
||||||
if (!mappings && !bindings && !expression.includes("await")) {
|
if (!mappings && !expression.match(/(await|=)/)) {
|
||||||
return expression;
|
return expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -410,12 +410,20 @@ function getFrameScope(state, sourceId, frameId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSelectedScope(state) {
|
function getSelectedScope(state) {
|
||||||
const sourceRecord = (0, _sources.getSelectedSource)(state);
|
const source = (0, _sources.getSelectedSource)(state);
|
||||||
const frameId = getSelectedFrameId(state);
|
const frameId = getSelectedFrameId(state);
|
||||||
const {
|
|
||||||
scope
|
if (!source) {
|
||||||
} = getFrameScope(state, sourceRecord && sourceRecord.id, frameId) || {};
|
return null;
|
||||||
return scope || null;
|
}
|
||||||
|
|
||||||
|
const frameScope = getFrameScope(state, source.id, frameId);
|
||||||
|
|
||||||
|
if (!frameScope) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return frameScope.scope || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSelectedScopeMappings(state) {
|
function getSelectedScopeMappings(state) {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ add_task(async function() {
|
||||||
|
|
||||||
info(`Test previewing in the original location`);
|
info(`Test previewing in the original location`);
|
||||||
await assertPreviews(dbg, [
|
await assertPreviews(dbg, [
|
||||||
{ line: 2, column: 10, result: 4, expression: "x;" }
|
{ line: 2, column: 10, result: 4, expression: "x" }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
info(`Test previewing in the generated location`);
|
info(`Test previewing in the generated location`);
|
||||||
|
|
|
||||||
|
|
@ -743,9 +743,7 @@ Services.obs.addObserver(gDevToolsBrowser, "devtools:loader:destroy");
|
||||||
|
|
||||||
// Fake end of browser window load event for all already opened windows
|
// Fake end of browser window load event for all already opened windows
|
||||||
// that is already fully loaded.
|
// that is already fully loaded.
|
||||||
const enumerator = Services.wm.getEnumerator(gDevTools.chromeWindowType);
|
for (const win of Services.wm.getEnumerator(gDevTools.chromeWindowType)) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
const win = enumerator.getNext();
|
|
||||||
if (win.gBrowserInit && win.gBrowserInit.delayedStartupFinished) {
|
if (win.gBrowserInit && win.gBrowserInit.delayedStartupFinished) {
|
||||||
gDevToolsBrowser._registerBrowserWindow(win);
|
gDevToolsBrowser._registerBrowserWindow(win);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,7 @@ function toolRegistered(toolId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllBrowserWindows() {
|
function getAllBrowserWindows() {
|
||||||
const wins = [];
|
return Array.from(Services.wm.getEnumerator("navigator:browser"));
|
||||||
const enumerator = Services.wm.getEnumerator("navigator:browser");
|
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
wins.push(enumerator.getNext());
|
|
||||||
}
|
|
||||||
return wins;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testUnregister() {
|
function testUnregister() {
|
||||||
|
|
|
||||||
|
|
@ -97,12 +97,7 @@ function testToolRegistered() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllBrowserWindows() {
|
function getAllBrowserWindows() {
|
||||||
const wins = [];
|
return Array.from(Services.wm.getEnumerator("navigator:browser"));
|
||||||
const enumerator = Services.wm.getEnumerator("navigator:browser");
|
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
wins.push(enumerator.getNext());
|
|
||||||
}
|
|
||||||
return wins;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testUnregister() {
|
function testUnregister() {
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,7 @@ this.ScratchpadManager = {
|
||||||
// such objects are not primitive-values-only anymore so they
|
// such objects are not primitive-values-only anymore so they
|
||||||
// can leak.
|
// can leak.
|
||||||
|
|
||||||
const enumerator = Services.wm.getEnumerator("devtools:scratchpad");
|
for (const win of Services.wm.getEnumerator("devtools:scratchpad")) {
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
const win = enumerator.getNext();
|
|
||||||
if (!win.closed && win.Scratchpad.initialized) {
|
if (!win.closed && win.Scratchpad.initialized) {
|
||||||
this._scratchpads.push(clone(win.Scratchpad.getState()));
|
this._scratchpads.push(clone(win.Scratchpad.getState()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,11 +132,7 @@ exports.viewSourceInDebugger = async function(toolbox, sourceURL, sourceLine,
|
||||||
*/
|
*/
|
||||||
exports.viewSourceInScratchpad = async function(sourceURL, sourceLine) {
|
exports.viewSourceInScratchpad = async function(sourceURL, sourceLine) {
|
||||||
// Check for matching top level scratchpad window.
|
// Check for matching top level scratchpad window.
|
||||||
const wins = Services.wm.getEnumerator("devtools:scratchpad");
|
for (const win of Services.wm.getEnumerator("devtools:scratchpad")) {
|
||||||
|
|
||||||
while (wins.hasMoreElements()) {
|
|
||||||
const win = wins.getNext();
|
|
||||||
|
|
||||||
if (!win.closed && win.Scratchpad.uniqueName === sourceURL) {
|
if (!win.closed && win.Scratchpad.uniqueName === sourceURL) {
|
||||||
win.focus();
|
win.focus();
|
||||||
win.Scratchpad.editor.setCursor({ line: sourceLine, ch: 0 });
|
win.Scratchpad.editor.setCursor({ line: sourceLine, ch: 0 });
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue