merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2015-10-01 12:39:25 +02:00
commit cbff0f93a2
507 changed files with 9889 additions and 5876 deletions

View File

@ -39,6 +39,7 @@
#include "nsIWebBrowserChrome.h"
#include "nsReadableUtils.h"
#include "nsFocusManager.h"
#include "nsGlobalWindow.h"
#ifdef MOZ_XUL
#include "nsIXULDocument.h"
@ -482,10 +483,9 @@ RootAccessible::RelationByType(RelationType aType)
if (!mDocumentNode || aType != RelationType::EMBEDS)
return DocAccessibleWrap::RelationByType(aType);
nsIDOMWindow* rootWindow = mDocumentNode->GetWindow();
nsPIDOMWindow* rootWindow = mDocumentNode->GetWindow();
if (rootWindow) {
nsCOMPtr<nsIDOMWindow> contentWindow;
rootWindow->GetContent(getter_AddRefs(contentWindow));
nsCOMPtr<nsIDOMWindow> contentWindow = nsGlobalWindow::Cast(rootWindow)->GetContent();
if (contentWindow) {
nsCOMPtr<nsIDOMDocument> contentDOMDocument;
contentWindow->GetDocument(getter_AddRefs(contentDOMDocument));

View File

@ -20,7 +20,7 @@ MailtoProtocolHandler.prototype = {
Ci.nsIProtocolHandler.URI_NOAUTH |
Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE |
Ci.nsIProtocolHandler.URI_DOES_NOT_RETURN_DATA,
allowPort: function() false,
allowPort: () => false,
newURI: function Proto_newURI(aSpec, aOriginCharset) {
let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);

View File

@ -62,13 +62,13 @@ function hookScreen(window) {
};
Object.defineProperty(screen, 'width', {
get: function () GlobalSimulatorScreen.width
get: () => GlobalSimulatorScreen.width
});
Object.defineProperty(screen, 'height', {
get: function () GlobalSimulatorScreen.height
get: () => GlobalSimulatorScreen.height
});
Object.defineProperty(screen, 'mozOrientation', {
get: function () GlobalSimulatorScreen.mozOrientation
get: () => GlobalSimulatorScreen.mozOrientation
});
}

View File

@ -29,7 +29,7 @@ SmsProtocolHandler.prototype = {
Ci.nsIProtocolHandler.URI_NOAUTH |
Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE |
Ci.nsIProtocolHandler.URI_DOES_NOT_RETURN_DATA,
allowPort: function() false,
allowPort: () => false,
newURI: function Proto_newURI(aSpec, aOriginCharset) {
let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);

View File

@ -28,7 +28,7 @@ TelProtocolHandler.prototype = {
Ci.nsIProtocolHandler.URI_NOAUTH |
Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE |
Ci.nsIProtocolHandler.URI_DOES_NOT_RETURN_DATA,
allowPort: function() false,
allowPort: () => false,
newURI: function Proto_newURI(aSpec, aOriginCharset) {
let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);

View File

@ -185,6 +185,7 @@
@RESPATH@/components/dom.xpt
@RESPATH@/components/dom_activities.xpt
@RESPATH@/components/dom_apps.xpt
@RESPATH@/components/dom_newapps.xpt
@RESPATH@/components/dom_audiochannel.xpt
@RESPATH@/components/dom_base.xpt
@RESPATH@/components/dom_system.xpt
@ -729,6 +730,10 @@
@RESPATH@/components/@DLL_PREFIX@mozgnome@DLL_SUFFIX@
#endif
; Signed Packaged Content
@RESPATH@/components/InstallPackagedWebapp.manifest
@RESPATH@/components/InstallPackagedWebapp.js
; ANGLE on Win32
#ifdef XP_WIN32
#ifndef HAVE_64BIT_BUILD

View File

@ -57,7 +57,7 @@ $(DIST)/branding:
libs::
@if test -f '$(LOCALE_SRCDIR)/existing-profile-defaults.js'; then \
$(PYTHON) -m mozbuild.action.preprocessor $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$(PYTHON) -m mozbuild.action.preprocessor $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) \
$(LOCALE_SRCDIR)/existing-profile-defaults.js -o $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
fi

View File

@ -21,10 +21,10 @@ const { EventEmitter } = Cu.import("resource://gre/modules/devtools/shared/event
// have trailing newlines. And note that registerLogHandler actually registers
// an error handler, despite its name.
Subprocess.registerLogHandler(
function(s) console.error("subprocess: " + s.trim())
s => console.error("subprocess: " + s.trim())
);
Subprocess.registerDebugHandler(
function(s) console.debug("subprocess: " + s.trim())
s => console.debug("subprocess: " + s.trim())
);
function SimulatorProcess(options) {
@ -38,7 +38,9 @@ function SimulatorProcess(options) {
SimulatorProcess.prototype = {
// check if b2g is running
get isRunning() !!this.process,
get isRunning() {
return !!this.process;
},
/**
* Start the process and connect the debugger client.

View File

@ -54,7 +54,7 @@ var gGestureSupport = {
}
// Create a preference object with some defaults
let def = function(aThreshold, aLatched)
let def = (aThreshold, aLatched) =>
({ threshold: aThreshold, latched: !!aLatched });
switch (aEvent.type) {

View File

@ -533,12 +533,10 @@ var LoopUI;
}
this.PlacesUtils.promiseFaviconLinkUrl(pageURI).then(uri => {
uri = this.PlacesUtils.getImageURLForResolution(window, uri.spec);
// We XHR the favicon to get a File object, which we can pass to the FileReader
// object. The FileReader turns the File object into a data-uri.
let xhr = new XMLHttpRequest();
xhr.open("get", uri, true);
xhr.open("get", uri.spec, true);
xhr.responseType = "blob";
xhr.overrideMimeType("image/x-icon");
xhr.onload = () => {

View File

@ -30,7 +30,7 @@ var StarUI = {
get _blockedCommands() {
delete this._blockedCommands;
return this._blockedCommands =
["cmd_close", "cmd_closeWindow"].map(function (id) this._element(id), this);
["cmd_close", "cmd_closeWindow"].map(id => this._element(id));
},
_blockCommands: function SU__blockCommands() {
@ -1498,7 +1498,7 @@ var BookmarkingUI = {
// calls back. For such an edge case, retain all unique entries from both
// arrays.
this._itemIds = this._itemIds.filter(
function (id) aItemIds.indexOf(id) == -1
id => aItemIds.indexOf(id) == -1
).concat(aItemIds);
this._updateStar();

View File

@ -253,7 +253,7 @@ var gSyncUI = {
doSync() {
this._needsSetup().then(needsSetup => {
if (!needsSetup) {
setTimeout(function () Weave.Service.errorHandler.syncAndReportErrors(), 0);
setTimeout(() => Weave.Service.errorHandler.syncAndReportErrors(), 0);
}
Services.obs.notifyObservers(null, "cloudsync:user-sync", null);
}).catch(err => {

View File

@ -225,7 +225,7 @@ var TabView = {
self._SSWindowStateReadyListener = null;
}
self._initFrameCallbacks.forEach(function (cb) cb());
self._initFrameCallbacks.forEach(cb => cb());
self._initFrameCallbacks = [];
}, false);

View File

@ -3270,7 +3270,7 @@ function FillInHTMLTooltip(tipElement)
}
var browserDragAndDrop = {
canDropLink: function (aEvent) Services.droppedLinkHandler.canDropLink(aEvent, true),
canDropLink: aEvent => Services.droppedLinkHandler.canDropLink(aEvent, true),
dragOver: function (aEvent)
{
@ -3418,7 +3418,7 @@ const BrowserSearch = {
// Check to see whether we've already added an engine with this title
if (browser.engines) {
if (browser.engines.some(function (e) e.title == engine.title))
if (browser.engines.some(e => e.title == engine.title))
return;
}
@ -3785,7 +3785,6 @@ function FillHistoryMenu(aParent) {
PlacesUtils.favicons.getFaviconURLForPage(entryURI, function (aURI) {
if (aURI) {
let iconURL = PlacesUtils.favicons.getFaviconLinkForIcon(aURI).spec;
iconURL = PlacesUtils.getImageURLForResolution(window, iconURL);
item.style.listStyleImage = "url(" + iconURL + ")";
}
});
@ -4521,7 +4520,9 @@ var LinkTargetDisplay = {
DELAY_HIDE: 250,
_timer: 0,
get _isVisible () XULBrowserWindow.statusTextField.label != "",
get _isVisible () {
return XULBrowserWindow.statusTextField.label != "";
},
update: function () {
clearTimeout(this._timer);
@ -4918,7 +4919,7 @@ nsBrowserAccess.prototype = {
},
isTabContentWindow: function (aWindow) {
return gBrowser.browsers.some(function (browser) browser.contentWindow == aWindow);
return gBrowser.browsers.some(browser => browser.contentWindow == aWindow);
},
}
@ -5149,9 +5150,9 @@ var TabsInTitlebar = {
},
_update: function (aForce=false) {
function $(id) document.getElementById(id);
function rect(ele) ele.getBoundingClientRect();
function verticalMargins(cstyle) parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
let $ = id => document.getElementById(id);
let rect = ele => ele.getBoundingClientRect();
let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
if (!this._initialized || window.fullScreen)
return;
@ -7359,8 +7360,12 @@ function getTabModalPromptBox(aWindow) {
};
/* DEPRECATED */
function getBrowser() gBrowser;
function getNavToolbox() gNavToolbox;
function getBrowser() {
return gBrowser;
}
function getNavToolbox() {
return gNavToolbox;
}
var gPrivateBrowsingUI = {
init: function PBUI_init() {

View File

@ -128,7 +128,9 @@ chatBrowserAccess.prototype = {
return browser ? browser.QueryInterface(Ci.nsIFrameLoaderOwner) : null;
},
isTabContentWindow: function (aWindow) this.contentWindow == aWindow,
isTabContentWindow: function (aWindow) {
return this.contentWindow == aWindow;
},
};
</script>

View File

@ -673,12 +673,10 @@ ContentSearchUIController.prototype = {
return row;
},
// Converts favicon array buffer into data URI of the right size and dpi.
// Converts favicon array buffer into a data URI.
_getFaviconURIFromBuffer: function (buffer) {
let blob = new Blob([buffer]);
let dpiSize = Math.round(16 * window.devicePixelRatio);
let sizeStr = dpiSize + "," + dpiSize;
return URL.createObjectURL(blob) + "#-moz-resolution=" + sizeStr;
return URL.createObjectURL(blob);
},
// Adds "@2x" to the name of the given PNG url for "retina" screens.

View File

@ -435,8 +435,8 @@ Sanitizer.prototype = {
let count = 0;
let countDone = {
handleResult : function(aResult) count = aResult,
handleError : function(aError) Components.utils.reportError(aError),
handleResult : aResult => count = aResult,
handleError : aError => Components.utils.reportError(aError),
handleCompletion :
function(aReason) { aCallback("formdata", aReason == 0 && count > 0, aArg); }
};

View File

@ -51,7 +51,9 @@ var gSyncSetup = {
server: false
},
get _remoteSites() [Weave.Service.serverURL, RECAPTCHA_DOMAIN],
get _remoteSites() {
return [Weave.Service.serverURL, RECAPTCHA_DOMAIN];
},
get _usingMainServers() {
if (this._settingUpNew)
@ -79,7 +81,7 @@ var gSyncSetup = {
});
};
addRem(true);
window.addEventListener("unload", function() addRem(false), false);
window.addEventListener("unload", () => addRem(false), false);
window.setTimeout(function () {
// Force Service to be loaded so that engines are registered.

View File

@ -50,7 +50,7 @@
<getter><![CDATA[
if (!this._visibleTabs)
this._visibleTabs = Array.filter(this.tabs,
function (tab) !tab.hidden && !tab.closing);
tab => !tab.hidden && !tab.closing);
return this._visibleTabs;
]]></getter>
</property>
@ -904,9 +904,6 @@
}
let sizedIconUrl = browser.mIconURL || "";
if (sizedIconUrl) {
sizedIconUrl = this.PlacesUtils.getImageURLForResolution(window, sizedIconUrl);
}
if (sizedIconUrl != aTab.getAttribute("image")) {
if (sizedIconUrl)
aTab.setAttribute("image", sizedIconUrl);
@ -2702,7 +2699,7 @@
<body>
<![CDATA[
this.mProgressListeners =
this.mProgressListeners.filter(function (l) l != aListener);
this.mProgressListeners.filter(l => l != aListener);
]]>
</body>
</method>
@ -2719,7 +2716,7 @@
<body>
<![CDATA[
this.mTabsProgressListeners =
this.mTabsProgressListeners.filter(function (l) l != aListener);
this.mTabsProgressListeners.filter(l => l != aListener);
]]>
</body>
</method>
@ -2833,7 +2830,7 @@
<getter>
<![CDATA[
return this._browsers ||
(this._browsers = Array.map(this.tabs, function (tab) tab.linkedBrowser));
(this._browsers = Array.map(this.tabs, tab => tab.linkedBrowser));
]]>
</getter>
</property>
@ -5522,7 +5519,9 @@
// positioned relative to the corner of the new window created upon
// dragend such that the mouse appears to have the same position
// relative to the corner of the dragged tab.
function clientX(ele) ele.getBoundingClientRect().left;
function clientX(ele) {
return ele.getBoundingClientRect().left;
}
let tabOffsetX = clientX(tab) - clientX(this);
tab._dragData = {
offsetX: event.screenX - window.screenX - tabOffsetX,

View File

@ -37,8 +37,7 @@ add_task(function* () {
let result = gURLBar.popup.richlistbox.children[0];
ok(result.hasAttribute("image"), "Result should have an image attribute");
// Image attribute gets a suffix (-moz-resolution) added in the value.
ok(result.getAttribute("image").startsWith(engine.iconURI.spec),
ok(result.getAttribute("image") === engine.iconURI.spec,
"Image attribute should have the search engine's icon");
EventUtils.synthesizeKey("VK_RETURN" , { });

View File

@ -1,7 +1,7 @@
var expected = ["TabOpen", "onStateChange", "onLocationChange", "onLinkIconAvailable"];
var actual = [];
var tabIndex = -1;
this.__defineGetter__("tab", function () gBrowser.tabs[tabIndex]);
this.__defineGetter__("tab", () => gBrowser.tabs[tabIndex]);
function test() {
waitForExplicitFinish();

View File

@ -38,7 +38,7 @@ function test() {
gBrowser.removeTab(tabs.pop());
}
});
texts.forEach(function(aText) addTabWithText(aText));
texts.forEach(aText => addTabWithText(aText));
// Set up the first tab
gBrowser.selectedTab = tabs[0];

View File

@ -6,7 +6,9 @@ function test() {
waitForExplicitFinish();
function testState(aPinned) {
function elemAttr(id, attr) document.getElementById(id).getAttribute(attr);
function elemAttr(id, attr) {
return document.getElementById(id).getAttribute(attr);
}
if (aPinned) {
is(elemAttr("key_close", "disabled"), "true",

View File

@ -1,5 +1,6 @@
function numClosedTabs()
SessionStore.getClosedTabCount(window);
function numClosedTabs() {
return SessionStore.getClosedTabCount(window);
}
function isUndoCloseEnabled() {
updateTabContextMenu();

View File

@ -21,7 +21,7 @@ function test() {
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
if (BookmarkingUI.status == BookmarkingUI.STATUS_UPDATING) {
waitForCondition(function() BookmarkingUI.status != BookmarkingUI.STATUS_UPDATING, finishTest, "BookmarkingUI was updating for too long");
waitForCondition(() => BookmarkingUI.status != BookmarkingUI.STATUS_UPDATING, finishTest, "BookmarkingUI was updating for too long");
} else {
finishTest();
}

View File

@ -69,7 +69,7 @@ function testNavigation() {
function waitForNextTurn() {
let deferred = Promise.defer();
setTimeout(function () deferred.resolve(), 0);
setTimeout(() => deferred.resolve(), 0);
return deferred.promise;
}

View File

@ -35,7 +35,7 @@ function test() {
// execute should only be called when need, like when you are opening
// web pages on the test. If calling executeSoon() is not necesary, then
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
executeSoon(function() aCallback(aWin));
executeSoon(() => aCallback(aWin));
});
};

View File

@ -45,7 +45,7 @@ function test() {
function testOnWindow(aIsPrivate, aCallback) {
whenNewWindowLoaded({private: aIsPrivate}, function(win) {
executeSoon(function() aCallback(win));
executeSoon(() => aCallback(win));
});
}

View File

@ -52,7 +52,7 @@ function MixedTest1A() {
gIdentityHandler.disableMixedContentProtection();
}
function MixedTest1B() {
waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest1C, "Waited too long for mixed script to run in Test 1");
waitForCondition(() => content.document.getElementById('p1').innerHTML == "hello", MixedTest1C, "Waited too long for mixed script to run in Test 1");
}
function MixedTest1C() {
ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 1");
@ -89,10 +89,10 @@ function MixedTest3A() {
gIdentityHandler.disableMixedContentProtection();
}
function MixedTest3B() {
waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest3C, "Waited too long for mixed script to run in Test 3");
waitForCondition(() => content.document.getElementById('p1').innerHTML == "hello", MixedTest3C, "Waited too long for mixed script to run in Test 3");
}
function MixedTest3C() {
waitForCondition(function() content.document.getElementById('p2').innerHTML == "bye", MixedTest3D, "Waited too long for mixed image to load in Test 3");
waitForCondition(() => content.document.getElementById('p2').innerHTML == "bye", MixedTest3D, "Waited too long for mixed image to load in Test 3");
}
function MixedTest3D() {
ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 3");
@ -118,7 +118,7 @@ function MixedTest4A() {
gIdentityHandler.disableMixedContentProtection();
}
function MixedTest4B() {
waitForCondition(function() content.document.location == gHttpTestRoot + "file_bug822367_4B.html", MixedTest4C, "Waited too long for mixed script to run in Test 4");
waitForCondition(() => content.document.location == gHttpTestRoot + "file_bug822367_4B.html", MixedTest4C, "Waited too long for mixed script to run in Test 4");
}
function MixedTest4C() {
ok(content.document.location == gHttpTestRoot + "file_bug822367_4B.html", "Location didn't change in test 4");
@ -126,7 +126,7 @@ function MixedTest4C() {
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
let {gIdentityHandler} = gTestBrowser.ownerGlobal;
waitForCondition(function() content.document.getElementById('p1').innerHTML == "", MixedTest4D, "Mixed script loaded in test 4 after location change!");
waitForCondition(() => content.document.getElementById('p1').innerHTML == "", MixedTest4D, "Mixed script loaded in test 4 after location change!");
}
function MixedTest4D() {
ok(content.document.getElementById('p1').innerHTML == "","p1.innerHTML changed; mixed script loaded after location change in Test 4");
@ -150,7 +150,7 @@ function MixedTest5A() {
gIdentityHandler.disableMixedContentProtection();
}
function MixedTest5B() {
waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest5C, "Waited too long for mixed script to run in Test 5");
waitForCondition(() => content.document.getElementById('p1').innerHTML == "hello", MixedTest5C, "Waited too long for mixed script to run in Test 5");
}
function MixedTest5C() {
ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 5");

View File

@ -60,7 +60,7 @@ function test1A() {
function test1B() {
var expected = "Mixed Content Blocker disabled";
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test1C, "Error: Waited too long for mixed script to run in Test 1B");
}
@ -115,7 +115,7 @@ function test2A() {
function test2B() {
var expected = "Mixed Content Blocker disabled";
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test2C, "Error: Waited too long for mixed script to run in Test 2B");
}

View File

@ -154,7 +154,7 @@ function checkPopUpNotification() {
function reloadedTabAfterDisablingMCB() {
var expected = "Mixed Content Blocker disabled";
waitForCondition(
function() gTestWin.content.document.getElementById('mctestdiv').innerHTML == expected,
() => gTestWin.content.document.getElementById('mctestdiv').innerHTML == expected,
makeSureMCBisDisabled, "Error: Waited too long for mixed script to run in " + curTestName + "!");
}

View File

@ -218,7 +218,7 @@ var gClickHandler = {
if (gInvokedMethods.length != gCurrentTest.expectedInvokedMethods.length) {
ok(false, "Wrong number of invoked methods");
gInvokedMethods.forEach(function (method) info(method + " was invoked"));
gInvokedMethods.forEach(method => info(method + " was invoked"));
}
event.preventDefault();

View File

@ -90,14 +90,17 @@ function test() {
/* private utility functions */
function pressCtrlTab(aShiftKey)
function pressCtrlTab(aShiftKey) {
EventUtils.synthesizeKey("VK_TAB", { ctrlKey: true, shiftKey: !!aShiftKey });
}
function releaseCtrl()
function releaseCtrl() {
EventUtils.synthesizeKey("VK_CONTROL", { type: "keyup" });
}
function isOpen()
ctrlTab.isOpen;
function isOpen() {
return ctrlTab.isOpen;
}
function checkTabs(aTabs) {
var tabs = gBrowser.tabs.length;

View File

@ -1,6 +1,8 @@
var browser;
function doc() browser.contentDocument;
function doc() {
return browser.contentDocument;
}
function setHandlerFunc(aResultFunc) {
gBrowser.addEventListener("DOMLinkAdded", function (event) {

View File

@ -283,7 +283,7 @@ function test_emitLatchedEvents(eventPrefix, initialDelta, cmd)
for (let dir in cmd)
cmd[dir].callCount = expect[dir] = 0;
let check = function(aDir, aMsg) ok(cmd[aDir].callCount == expect[aDir], aMsg);
let check = (aDir, aMsg) => ok(cmd[aDir].callCount == expect[aDir], aMsg);
let checkBoth = function(aNum, aInc, aDec) {
let prefix = "Step " + aNum + ": ";
check("inc", prefix + aInc);

View File

@ -24,12 +24,16 @@ function test() {
gBrowser.removeTab(testTab, {animate: true});
// Make sure the tab gets removed at the end of the animation by polling
(function checkRemoved() setTimeout(function() {
if (gBrowser.tabs.length != 1)
return checkRemoved();
(function checkRemoved() {
return setTimeout(function() {
if (gBrowser.tabs.length != 1) {
checkRemoved();
return;
}
is(numVisBeforeHide, 1, "animated remove has in 1 tab left");
is(numVisAfterHide, 1, "hiding a removing tab is also has 1 tab");
finish();
}, 50))();
is(numVisBeforeHide, 1, "animated remove has in 1 tab left");
is(numVisAfterHide, 1, "hiding a removing tab is also has 1 tab");
finish();
}, 50);
})();
}

View File

@ -112,7 +112,7 @@ function checkUIForTest1() {
var expected = "script blocked";
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test2, "Error: Waited too long for status in Test 1!",
"OK: Expected result in innerHTML for Test1!");
}
@ -132,7 +132,7 @@ function checkUIForTest2() {
var expected = "script executed";
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test3, "Error: Waited too long for status in Test 2!",
"OK: Expected result in innerHTML for Test2!");
}
@ -150,7 +150,7 @@ function checkLoadEventForTest3() {
var expected = "image blocked"
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test4, "Error: Waited too long for status in Test 3!",
"OK: Expected result in innerHTML for Test3!");
}
@ -168,7 +168,7 @@ function checkLoadEventForTest4() {
var expected = "image loaded"
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test5, "Error: Waited too long for status in Test 4!",
"OK: Expected result in innerHTML for Test4!");
}
@ -191,7 +191,7 @@ function checkLoadEventForTest5() {
var expected = "image loaded"
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test6, "Error: Waited too long for status in Test 5!",
"OK: Expected result in innerHTML for Test5!");
// Go back online
@ -216,7 +216,7 @@ function checkLoadEventForTest6() {
var expected = "image blocked"
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test7, "Error: Waited too long for status in Test 6!",
"OK: Expected result in innerHTML for Test6!");
// Go back online
@ -236,7 +236,7 @@ function checkLoadEventForTest7() {
var expected = "image loaded"
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test8, "Error: Waited too long for status in Test 7!",
"OK: Expected result in innerHTML for Test7!");
}
@ -259,7 +259,7 @@ function checkLoadEventForTest8() {
var expected = "image loaded"
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
test9, "Error: Waited too long for status in Test 8!",
"OK: Expected result in innerHTML for Test8!");
// Go back online
@ -284,7 +284,7 @@ function checkLoadEventForTest9() {
var expected = "image blocked"
waitForCondition(
function() content.document.getElementById('mctestdiv').innerHTML == expected,
() => content.document.getElementById('mctestdiv').innerHTML == expected,
cleanUpAfterTests, "Error: Waited too long for status in Test 9!",
"OK: Expected result in innerHTML for Test9!");
// Go back online

View File

@ -69,7 +69,7 @@ function test1A() {
var expected = "Verifying MCB does not trigger warning/error for an http page ";
expected += "with https css that includes http image";
waitForCondition(
function() content.document.getElementById('testDiv').innerHTML == expected,
() => content.document.getElementById('testDiv').innerHTML == expected,
test1B, "Error: Waited too long for status in Test 1!",
"OK: Expected result in innerHTML!");
}
@ -89,7 +89,7 @@ function test2A() {
var expected = "Verifying MCB does not trigger warning/error for an http page ";
expected += "with https css that includes http font";
waitForCondition(
function() content.document.getElementById('testDiv').innerHTML == expected,
() => content.document.getElementById('testDiv').innerHTML == expected,
test2B, "Error: Waited too long for status in Test 2!",
"OK: Expected result in innerHTML!");
}
@ -109,7 +109,7 @@ function test3() {
var expected = "Verifying MCB does not trigger warning/error for an http page "
expected += "with https css that imports another http css which includes http font";
waitForCondition(
function() content.document.getElementById('testDiv').innerHTML == expected,
() => content.document.getElementById('testDiv').innerHTML == expected,
cleanUpAfterTests, "Error: Waited too long for status in Test 3!",
"OK: Expected result in innerHTML!");
}

View File

@ -3,16 +3,16 @@ var scrollbox = tabstrip._scrollbox;
var originalSmoothScroll = tabstrip.smoothScroll;
var tabs = gBrowser.tabs;
function rect(ele) ele.getBoundingClientRect();
function width(ele) rect(ele).width;
function left(ele) rect(ele).left;
function right(ele) rect(ele).right;
function isLeft(ele, msg) is(left(ele) + tabstrip._tabMarginLeft, left(scrollbox), msg);
function isRight(ele, msg) is(right(ele) - tabstrip._tabMarginRight, right(scrollbox), msg);
function elementFromPoint(x) tabstrip._elementFromPoint(x);
function nextLeftElement() elementFromPoint(left(scrollbox) - 1);
function nextRightElement() elementFromPoint(right(scrollbox) + 1);
function firstScrollable() tabs[gBrowser._numPinnedTabs];
let rect = ele => ele.getBoundingClientRect();
let width = ele => rect(ele).width;
let left = ele => rect(ele).left;
let right = ele => rect(ele).right;
let isLeft = (ele, msg) => is(left(ele) + tabstrip._tabMarginLeft, left(scrollbox), msg);
let isRight = (ele, msg) => is(right(ele) - tabstrip._tabMarginRight, right(scrollbox), msg);
let elementFromPoint = x => tabstrip._elementFromPoint(x);
let nextLeftElement = () => elementFromPoint(left(scrollbox) - 1);
let nextRightElement = () => elementFromPoint(right(scrollbox) + 1);
let firstScrollable = () => tabs[gBrowser._numPinnedTabs];
function test() {
requestLongerTimeout(2);

View File

@ -32,7 +32,7 @@ function checkPageStyleMenu() {
" with rel=\"" + rel + "\"" +
(media ? " and media=\"" + media + "\"" : "");
var item = items.filter(function (item) item.getAttribute("label") == title);
var item = items.filter(item => item.getAttribute("label") == title);
var found = item.length == 1;
var checked = found && (item[0].getAttribute("checked") == "true");

View File

@ -1,6 +1,8 @@
var tabs;
function index(tab) Array.indexOf(gBrowser.tabs, tab);
function index(tab) {
return Array.indexOf(gBrowser.tabs, tab);
}
function indexTest(tab, expectedIndex, msg) {
var diag = "tab " + tab + " should be at index " + expectedIndex;

View File

@ -59,7 +59,7 @@ function countEntries(name, message, check) {
obj.fieldname = name;
let count;
FormHistory.count(obj, { handleResult: function (result) count = result,
FormHistory.count(obj, { handleResult: result => count = result,
handleError: function (error) {
do_throw("Error occurred searching form history: " + error);
deferred.reject(error)
@ -472,9 +472,9 @@ function setupHistory() {
addPlace(makeURI("http://before-today.com/"), "Before Today", lastYear.getTime() * 1000);
PlacesUtils.asyncHistory.updatePlaces(places, {
handleError: function () ok(false, "Unexpected error in adding visit."),
handleResult: function () { },
handleCompletion: function () deferred.resolve()
handleError: () => ok(false, "Unexpected error in adding visit."),
handleResult: () => { },
handleCompletion: () => deferred.resolve()
});
return deferred.promise;
@ -486,7 +486,7 @@ function setupFormHistory() {
let deferred = Promise.defer();
let results = [];
FormHistory.search(terms, params, { handleResult: function (result) results.push(result),
FormHistory.search(terms, params, { handleResult: result => results.push(result),
handleError: function (error) {
do_throw("Error occurred searching form history: " + error);
deferred.reject(error);

View File

@ -977,7 +977,7 @@ function formNameExists(name)
let count = 0;
FormHistory.count({ fieldname: name },
{ handleResult: function (result) count = result,
{ handleResult: result => count = result,
handleError: function (error) {
do_throw("Error occurred searching form history: " + error);
deferred.reject(error);

View File

@ -80,7 +80,7 @@ function triggerSave(aWindow, aCallback) {
ok(downloadSuccess, "Link should have been downloaded successfully");
aWindow.close();
executeSoon(function() aCallback());
executeSoon(() => aCallback());
}
}

View File

@ -116,7 +116,7 @@ function test() {
// execute should only be called when need, like when you are opening
// web pages on the test. If calling executeSoon() is not necesary, then
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
executeSoon(function() aCallback(aWin));
executeSoon(() => aCallback(aWin));
});
};

View File

@ -221,7 +221,7 @@ function checkAutocompleteResults(aExpected, aCallback)
},
setSelectedIndex: function() {},
get searchCount() { return this.searches.length; },
getSearchAt: function(aIndex) this.searches[aIndex],
getSearchAt: function(aIndex) { return this.searches[aIndex]; },
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIAutoCompleteInput,
Ci.nsIAutoCompletePopup,

View File

@ -12,7 +12,7 @@ function test() {
// execute should only be called when need, like when you are opening
// web pages on the test. If calling executeSoon() is not necesary, then
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
executeSoon(function() aCallback(aWin));
executeSoon(() => aCallback(aWin));
});
};

View File

@ -206,7 +206,7 @@ add_task(function*() {
is(focused, "Focus is button2", "focusedElement in second browser after focus in unfocused tab");
// When focus is in the tab bar, it should be retained there
yield expectFocusShift(function () gBrowser.selectedTab.focus(),
yield expectFocusShift(() => gBrowser.selectedTab.focus(),
"main-window", "tab2", true,
"focusing tab element");
yield* expectFocusShiftAfterTabSwitch(tab1, "main-window", "tab1", true,
@ -233,7 +233,7 @@ add_task(function*() {
yield switchWaiter;
}
yield expectFocusShift(function () gBrowser.selectedTab.blur(),
yield expectFocusShift(() => gBrowser.selectedTab.blur(),
"main-window", null, true,
"blurring tab element");
@ -241,7 +241,7 @@ add_task(function*() {
// not clear what would be the focus in the browser
focusElementInChild("button1", "focus");
yield expectFocusShift(function () gURLBar.focus(),
yield expectFocusShift(() => gURLBar.focus(),
"main-window", "urlbar", true,
"focusedWindow after url field focused");
focused = yield getFocusedElementForBrowser(browser1, true);
@ -249,7 +249,7 @@ add_task(function*() {
focused = yield getFocusedElementForBrowser(browser2, true);
is(focused, "Focus is button2", "focusedElement after url field focused, second browser");
yield expectFocusShift(function () gURLBar.blur(),
yield expectFocusShift(() => gURLBar.blur(),
"main-window", null, true,
"blurring url field");
@ -274,7 +274,7 @@ add_task(function*() {
is(fm.getFocusedElementForWindow(window, false, focusedWindow), browser1, "focusedElement after blur in focused tab, parent");
// blurring an non-focused url field should have no effect
yield expectFocusShift(function () gURLBar.blur(),
yield expectFocusShift(() => gURLBar.blur(),
"window1", null, false,
"after blur in unfocused url field");
@ -289,7 +289,7 @@ add_task(function*() {
// clearing focus on the chrome window should switch the focus to the
// chrome window
yield expectFocusShift(function () fm.clearFocus(window),
yield expectFocusShift(() => fm.clearFocus(window),
"main-window", null, true,
"after switch to chrome with no focused element");
@ -333,7 +333,7 @@ add_task(function*() {
_browser_tabfocus_test_lastfocus = "urlbar";
_browser_tabfocus_test_lastfocuswindow = "main-window";
yield expectFocusShift(function () EventUtils.synthesizeKey("VK_F6", { }),
yield expectFocusShift(() => EventUtils.synthesizeKey("VK_F6", { }),
"window1", "html1",
true, "switch document forward with f6");

View File

@ -29,7 +29,7 @@ if (Services.appinfo.OS == "WINNT" || Services.appinfo.OS == "Darwin") {
// TabsInTitlebar._update causes a reflow on OS X and Windows trying to do calculations
// since layout info is already dirty. This doesn't seem to happen before
// MozAfterPaint on Linux.
EXPECTED_REFLOWS.push("rect@chrome://browser/content/browser.js|" +
EXPECTED_REFLOWS.push("TabsInTitlebar._update/rect@chrome://browser/content/browser.js|" +
"TabsInTitlebar._update@chrome://browser/content/browser.js|" +
"updateAppearance@chrome://browser/content/browser.js|" +
"handleEvent@chrome://browser/content/tabbrowser.xml|");

View File

@ -46,7 +46,7 @@ function promiseAddFakeVisits() {
};
return new Promise((resolve, reject) => {
PlacesUtils.asyncHistory.updatePlaces(place, {
handleError: function () reject(new Error("Couldn't add visit")),
handleError: () => reject(new Error("Couldn't add visit")),
handleResult: function () {},
handleCompletion: function () {
NewTabUtils.links.populateCache(function () {

View File

@ -310,7 +310,7 @@ function fillHistory(aLinks, aCallback = TestRunner.next) {
};
PlacesUtils.asyncHistory.updatePlaces(place, {
handleError: function () ok(false, "couldn't add visit to history"),
handleError: () => ok(false, "couldn't add visit to history"),
handleResult: function () {},
handleCompletion: function () {
if (--numLinks == 0 && aCallback)

View File

@ -68,7 +68,7 @@ add_task(function* () {
yield promise;
// Simulate clicking the "Allow Always" button.
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);
PopupNotifications.panel.firstChild._primaryButton.click();
@ -185,7 +185,7 @@ add_task(function* () {
yield promise;
// Simulate clicking the "Allow Always" button.
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);
PopupNotifications.panel.firstChild._primaryButton.click();
@ -243,7 +243,7 @@ add_task(function* () {
yield promise;
// Simulate clicking the "Allow Always" button.
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);
PopupNotifications.panel.firstChild._primaryButton.click();

View File

@ -83,7 +83,7 @@ add_task(function* () {
utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
});
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gNewWindow.gBrowser.selectedBrowser).dismissed && gNewWindow.PopupNotifications.panel.firstChild;
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gNewWindow.gBrowser.selectedBrowser).dismissed && gNewWindow.PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);
});

View File

@ -52,7 +52,7 @@ add_task(function* () {
pluginInfo = yield promiseForPluginInfo("plugin");
ok(!pluginInfo.activated, "1b plugin should not be activated");
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);
PopupNotifications.panel.firstChild._primaryButton.click();

View File

@ -239,7 +239,7 @@ add_task(function* () {
utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
});
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed;
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed;
yield promiseForCondition(condition);
});
@ -269,7 +269,7 @@ add_task(function* () {
utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
});
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed;
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed;
yield promiseForCondition(condition);
});
@ -296,7 +296,7 @@ add_task(function* () {
utils.sendMouseEvent("mouseup", 50, 50, 0, 1, 0, false, 0, 0);
});
let condition = function() !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);
PopupNotifications.panel.firstChild._primaryButton.click();
@ -379,7 +379,7 @@ add_task(function* () {
utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
});
let condition = function() !notification.dismissed && !!PopupNotifications.panel.firstChild;
let condition = () => !notification.dismissed && !!PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);
PopupNotifications.panel.firstChild._primaryButton.click();

View File

@ -114,7 +114,7 @@ add_task(function* () {
let pluginInfo = yield promiseForPluginInfo("pluginone");
ok(!pluginInfo.activated, "Test 8, test plugin should be activated");
let condition = function() !notification.dismissed &&
let condition = () => !notification.dismissed &&
PopupNotifications.panel.firstChild;
yield promiseForCondition(condition);

View File

@ -119,7 +119,7 @@ function test2a() {
promiseShown.then(() => {
PopupNotifications.panel.firstChild._secondaryButton.click();
let condition = function() objLoadingContent.activated;
let condition = () => objLoadingContent.activated;
waitForCondition(condition, test2b, "Test 2a, Waited too long for plugin to activate");
});
}
@ -169,7 +169,7 @@ function test3a() {
promiseShown.then(() => {
PopupNotifications.panel.firstChild._secondaryButton.click();
let condition = function() objLoadingContent.activated;
let condition = () => objLoadingContent.activated;
waitForCondition(condition, test3b, "Test 3a, Waited too long for plugin to activate");
});
}

View File

@ -253,12 +253,12 @@ var tests = {
let port1 = openChat(Social.providers[1], function() {
let port2 = openChat(Social.providers[2], function() {
let chats = document.getElementById("pinnedchats");
waitForCondition(function() chats.children.length == Social.providers.length,
waitForCondition(() => chats.children.length == Social.providers.length,
function() {
ok(true, "one chat window per provider opened");
// test logout of a single provider
port2.postMessage({topic: "test-logout"});
waitForCondition(function() chats.children.length == Social.providers.length - 1,
waitForCondition(() => chats.children.length == Social.providers.length - 1,
function() {
Task.spawn(closeAllChats).then(next);
},
@ -288,7 +288,7 @@ var tests = {
ok(true, "got a chat window opened");
if (opened) {
port.postMessage({topic: "test-logout"});
waitForCondition(function() document.getElementById("pinnedchats").firstChild == null,
waitForCondition(() => document.getElementById("pinnedchats").firstChild == null,
function() {
next();
},

View File

@ -35,7 +35,7 @@ function openChatViaWorkerMessage(port, data, callback) {
let chatbar = getChatBar();
let numExpected = chatbar.childElementCount + 1;
port.postMessage({topic: "test-worker-chat", data: data});
waitForCondition(function() chatbar.childElementCount == numExpected,
waitForCondition(() => chatbar.childElementCount == numExpected,
function() {
// so the child has been added, but we don't know if it
// has been intialized - re-request it and the callback
@ -107,7 +107,7 @@ function test() {
// tab.linkedBrowser.contentWindow.focus()
// but instead we must do:
tab.linkedBrowser.contentDocument.getElementById("theinput").focus();
waitForCondition(function() isTabFocused(), cb, "tab should have focus");
waitForCondition(() => isTabFocused(), cb, "tab should have focus");
}
let postSubTest = function(cb) {
Task.spawn(closeAllChats).then(cb);
@ -144,7 +144,7 @@ var tests = {
ok(isTabFocused(), "tab should still be focused");
// re-request the same chat via user event.
openChatViaUser();
waitForCondition(function() isChatFocused(chatbar.selectedChat),
waitForCondition(() => isChatFocused(chatbar.selectedChat),
function() {
is(chatbar.childElementCount, 1, "still exactly 1 chat open");
is(chatbar.selectedChat, chatbar.firstElementChild, "chat should be selected");
@ -162,7 +162,7 @@ var tests = {
let chatbar = getChatBar();
openChatViaUser();
ok(chatbar.firstElementChild, "chat opened");
waitForCondition(function() isChatFocused(chatbar.selectedChat),
waitForCondition(() => isChatFocused(chatbar.selectedChat),
function() {
is(chatbar.selectedChat, chatbar.firstElementChild, "chat is selected");
next();

View File

@ -134,7 +134,7 @@ var tests = {
function() { // the "load" callback.
todo_is(panelCallbackCount, 0, "Bug 833207 - should be no callback when error page loads.");
let chat = getChatBar().selectedChat;
waitForCondition(function() chat.content != null && chat.contentDocument.documentURI.indexOf("about:socialerror?mode=tryAgainOnly")==0,
waitForCondition(() => chat.content != null && chat.contentDocument.documentURI.indexOf("about:socialerror?mode=tryAgainOnly")==0,
function() {
chat.close();
next();
@ -162,14 +162,14 @@ var tests = {
chat.swapWindows().then(
chat => {
ok(!!chat.content, "we have chat content 1");
waitForCondition(function() chat.content != null && chat.contentDocument.readyState == "complete",
waitForCondition(() => chat.content != null && chat.contentDocument.readyState == "complete",
function() {
// now go offline and reload the chat - about:socialerror should be loaded.
goOffline().then(function() {
ok(!!chat.content, "we have chat content 2");
chat.contentDocument.location.reload();
info("chat reload called");
waitForCondition(function() chat.contentDocument.documentURI.indexOf("about:socialerror?mode=tryAgainOnly")==0,
waitForCondition(() => chat.contentDocument.documentURI.indexOf("about:socialerror?mode=tryAgainOnly")==0,
function() {
chat.close();
next();

View File

@ -157,7 +157,7 @@ var tests = {
EventUtils.synthesizeMouseAtCenter(btn, {});
// wait for the button to be marked, click to open panel
is(btn.panel.state, "closed", "panel should not be visible yet");
waitForCondition(function() btn.isMarked, function() {
waitForCondition(() => btn.isMarked, function() {
EventUtils.synthesizeMouseAtCenter(btn, {});
}, "button is marked");
break;
@ -174,7 +174,7 @@ var tests = {
} else {
// page should no longer be marked
port.close();
waitForCondition(function() !btn.isMarked, function() {
waitForCondition(() => !btn.isMarked, function() {
// cleanup after the page has been unmarked
ensureBrowserTabClosed(tab).then(() => {
ok(btn.disabled, "button is disabled");
@ -245,7 +245,7 @@ var tests = {
ok(true, "test-init-done received");
ok(provider.profile.userName, "profile was set by test worker");
port.postMessage({topic: "test-logout"});
waitForCondition(function() !provider.profile.userName,
waitForCondition(() => !provider.profile.userName,
function() {
// when the provider has not indicated to us that a user is
// logged in, the first click opens the page.
@ -268,7 +268,7 @@ var tests = {
} else {
// page should no longer be marked
port.close();
waitForCondition(function() !btn.isMarked, function() {
waitForCondition(() => !btn.isMarked, function() {
// cleanup after the page has been unmarked
ensureBrowserTabClosed(tab).then(() => {
ok(btn.disabled, "button is disabled");

View File

@ -52,7 +52,7 @@ var tests = {
oneWorkerTest(p);
}
waitForCondition(function() messageReceived == Social.providers.length,
waitForCondition(() => messageReceived == Social.providers.length,
next, "received messages from all workers",
/* increase timeout because shutting down a child process is slow */ 60);
},

View File

@ -96,7 +96,7 @@ var tests = {
SocialService.addProvider(manifest, function() {
SocialService.addProvider(manifest2, function (provider) {
SocialSidebar.show();
waitForCondition(function() SocialSidebar.opened,
waitForCondition(() => SocialSidebar.opened,
function() {
ok(SocialSidebar.opened, "first window sidebar is open");
openWindowAndWaitForInit(window, function(w1) {
@ -140,7 +140,7 @@ var tests = {
SocialService.addProvider(manifest, function() {
openWindowAndWaitForInit(window, function(w1) {
w1.SocialSidebar.show();
waitForCondition(function() w1.SocialSidebar.opened,
waitForCondition(() => w1.SocialSidebar.opened,
function() {
ok(Services.prefs.prefHasUserValue("social.sidebar.provider"), "global state set");
ok(!SocialSidebar.opened, "1. main sidebar is still closed");

View File

@ -154,7 +154,7 @@ function runSocialTestWithProvider(manifest, callback, finishcallback) {
registerCleanupFunction(function () {
finishSocialTest(true);
});
waitForCondition(function() provider.enabled,
waitForCondition(() => provider.enabled,
function() {
info("provider has been enabled");
callback(finishSocialTest);
@ -589,7 +589,7 @@ function resizeAndCheckWidths(first, second, third, checks, cb) {
checkPopup();
ok(sizedOk, count+": window resized correctly");
function collapsedObserver(r, m) {
if ([first, second, third].filter(function(item) !item.collapsed).length == numExpectedVisible) {
if ([first, second, third].filter(item => !item.collapsed).length == numExpectedVisible) {
if (m) {
m.disconnect();
}

View File

@ -603,7 +603,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
// are hard to read when encoded
if (!uri.schemeIs("javascript") && !uri.schemeIs("data")) {
// Parentheses are known to confuse third-party applications (bug 458565).
selectedVal = uri.spec.replace(/[()]/g, function (c) escape(c));
selectedVal = uri.spec.replace(/[()]/g, c => escape(c));
}
return selectedVal;

View File

@ -214,7 +214,7 @@ const CustomizableWidgets = [
onHistoryVisit(uri, aEvent, item);
});
if (icon) {
let iconURL = PlacesUtils.getImageURLForResolution(win, "moz-anno:favicon:" + icon);
let iconURL = "moz-anno:favicon:" + icon;
item.setAttribute("image", iconURL);
}
fragment.appendChild(item);

View File

@ -388,8 +388,7 @@ PlacesViewBase.prototype = {
let icon = aPlacesNode.icon;
if (icon)
element.setAttribute("image",
PlacesUtils.getImageURLForResolution(window, icon));
element.setAttribute("image", icon);
}
element._placesNode = aPlacesNode;
@ -527,8 +526,7 @@ PlacesViewBase.prototype = {
if (!icon)
elt.removeAttribute("image");
else if (icon != elt.getAttribute("image"))
elt.setAttribute("image",
PlacesUtils.getImageURLForResolution(window, icon));
elt.setAttribute("image", icon);
},
nodeAnnotationChanged:
@ -1058,8 +1056,7 @@ PlacesToolbar.prototype = {
button.setAttribute("label", aChild.title || "");
let icon = aChild.icon;
if (icon)
button.setAttribute("image",
PlacesUtils.getImageURLForResolution(window, icon));
button.setAttribute("image", icon);
if (PlacesUtils.containerTypes.indexOf(type) != -1) {
button.setAttribute("type", "menu");
@ -1886,8 +1883,7 @@ PlacesPanelMenuView.prototype = {
button.setAttribute("label", aChild.title || "");
let icon = aChild.icon;
if (icon)
button.setAttribute("image",
PlacesUtils.getImageURLForResolution(window, icon));
button.setAttribute("image", icon);
if (PlacesUtils.containerTypes.indexOf(type) != -1) {
button.setAttribute("container", "true");

View File

@ -1414,9 +1414,6 @@ PlacesTreeView.prototype = {
return "";
let node = this._getNodeForRow(aRow);
if (PlacesUtils.nodeIsURI(node) && node.icon)
return PlacesUtils.getImageURLForResolution(window, node.icon);
return node.icon;
},

View File

@ -6,7 +6,6 @@
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
Components.utils.import("resource://gre/modules/LoadContextInfo.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/BrowserUtils.jsm");
var gAdvancedPane = {
_inited: false,
@ -572,7 +571,7 @@ var gAdvancedPane = {
var list = document.getElementById("offlineAppsList");
var item = list.selectedItem;
var origin = item.getAttribute("origin");
var principal = BrowserUtils.principalFromOrigin(origin);
var principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);

View File

@ -116,8 +116,7 @@ var gSearchPane = {
let item = list.appendItem(e.name);
item.setAttribute("class", "menuitem-iconic searchengine-menuitem menuitem-with-favicon");
if (e.iconURI) {
let uri = PlacesUtils.getImageURLForResolution(window, e.iconURI.spec);
item.setAttribute("image", uri);
item.setAttribute("image", e.iconURI.spec);
}
item.engine = e;
if (e.name == currentEngine)
@ -488,8 +487,7 @@ EngineView.prototype = {
getImageSrc: function(index, column) {
if (column.id == "engineName" && this._engineStore.engines[index].iconURI) {
let uri = this._engineStore.engines[index].iconURI.spec;
return PlacesUtils.getImageURLForResolution(window, uri);
return this._engineStore.engines[index].iconURI.spec;
}
return "";
},

View File

@ -9,7 +9,6 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/BrowserUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "gLangBundle", () =>
Services.strings.createBundle("chrome://global/locale/languageNames.properties"));
@ -214,7 +213,7 @@ var gTranslationExceptions = {
onSiteDeleted: function() {
let removedSites = this._siteTree.getSelectedItems();
for (let origin of removedSites) {
let principal = BrowserUtils.principalFromOrigin(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
Services.perms.removeFromPrincipal(principal, kPermissionType);
}
},
@ -227,7 +226,7 @@ var gTranslationExceptions = {
this._siteTree.boxObject.rowCountChanged(0, -removedSites.length);
for (let origin of removedSites) {
let principal = BrowserUtils.principalFromOrigin(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
Services.perms.removeFromPrincipal(principal, kPermissionType);
}

View File

@ -265,9 +265,6 @@
<parameter name="element"/>
<parameter name="uri"/>
<body><![CDATA[
if (uri) {
uri = this.PlacesUtils.getImageURLForResolution(window, uri);
}
element.setAttribute("src", uri);
]]></body>
</method>
@ -1091,8 +1088,7 @@
let currentEngine = Services.search.currentEngine;
let uri = currentEngine.iconURI;
if (uri) {
uri = uri.spec;
this.setAttribute("src", PlacesUtils.getImageURLForResolution(window, uri));
this.setAttribute("src", uri.spec);
}
else {
// If the default has just been changed to a provider without icon,
@ -1254,8 +1250,7 @@
button.setAttribute("tooltiptext", engine.uri);
button.setAttribute("uri", engine.uri);
if (engine.icon) {
let uri = PlacesUtils.getImageURLForResolution(window, engine.icon);
button.setAttribute("image", uri);
button.setAttribute("image", engine.icon);
}
button.setAttribute("title", engine.title);
addEngineList.appendChild(button);
@ -1328,7 +1323,7 @@
button.id = "searchbar-engine-one-off-item-" + engine.name.replace(/ /g, '-');
let uri = "chrome://browser/skin/search-engine-placeholder.png";
if (engine.iconURI) {
uri = PlacesUtils.getImageURLForResolution(window, engine.iconURI.spec);
uri = engine.iconURI.spec;
}
button.setAttribute("image", uri);
button.setAttribute("class", "searchbar-engine-one-off-item");

View File

@ -169,7 +169,7 @@ this.RecentlyClosedTabsAndWindowsMenuUtils = {
};
function setImage(aWindow, aItem, aElement) {
let iconURL = PlacesUtils.getImageURLForResolution(aWindow, aItem.image);
let iconURL = aItem.image;
// don't initiate a connection just to fetch a favicon (see bug 467828)
if (/^https?:/.test(iconURL))
iconURL = "moz-anno:favicon:" + iconURL;

View File

@ -9,7 +9,6 @@ this.EXPORTED_SYMBOLS = ["SessionStorage"];
const Cu = Components.utils;
const Ci = Components.interfaces;
Cu.import("resource://gre/modules/BrowserUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -105,7 +104,7 @@ var SessionStorageInternal = {
restore: function (aDocShell, aStorageData) {
for (let origin of Object.keys(aStorageData)) {
let data = aStorageData[origin];
let principal = BrowserUtils.principalFromOrigin(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);
let window = aDocShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);

View File

@ -91,10 +91,6 @@ var FavIcons = {
tabImage = this._favIconService.getFaviconLinkForIcon(tabImageURI).spec;
}
if (tabImage) {
tabImage = PlacesUtils.getImageURLForResolution(window, tabImage);
}
callback(tabImage);
},
@ -107,8 +103,7 @@ var FavIcons = {
let {currentURI} = tab.linkedBrowser;
this._favIconService.getFaviconURLForPage(currentURI, function (uri) {
if (uri) {
let icon = PlacesUtils.getImageURLForResolution(window,
this._favIconService.getFaviconLinkForIcon(uri).spec);
let icon = this._favIconService.getFaviconLinkForIcon(uri).spec;
callback(icon);
} else {
callback(this.defaultFavicon);

View File

@ -2223,7 +2223,7 @@ this.Experiments.PreviousExperimentProvider = function (experiments) {
}
this.Experiments.PreviousExperimentProvider.prototype = Object.freeze({
get name() "PreviousExperimentProvider",
name: "PreviousExperimentProvider",
startup: function () {
this._log.trace("startup()");

View File

@ -18,34 +18,34 @@ var Utilities = {
get bookmarks() {
let bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
this.__defineGetter__("bookmarks", function() bookmarks);
this.__defineGetter__("bookmarks", () => bookmarks);
return this.bookmarks;
},
get bookmarksObserver() {
let bookmarksObserver = new BookmarksObserver();
this.__defineGetter__("bookmarksObserver", function() bookmarksObserver);
this.__defineGetter__("bookmarksObserver", () => bookmarksObserver);
return this.bookmarksObserver;
},
get annotations() {
let annotations = Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
this.__defineGetter__("annotations", function() annotations);
this.__defineGetter__("annotations", () => annotations);
return this.annotations;
},
get history() {
let history = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
this.__defineGetter__("history", function() history);
this.__defineGetter__("history", () => history);
return this.history;
},
get windowMediator() {
let windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
this.__defineGetter__("windowMediator", function() windowMediator);
this.__defineGetter__("windowMediator", () => windowMediator);
return this.windowMediator;
},

View File

@ -136,10 +136,10 @@ function test() {
// test names array - NOTE: "bookmarkProperties/description" is an annotation too
var names = testBookmark.annotations.names;
ok(names.some(function (f) f == "bookmarkProperties/description"), "Checking for description annotation");
ok(names.some(function (f) f == "testing/bookmark/string"), "Checking for string test annotation");
ok(names.some(function (f) f == "testing/bookmark/int"), "Checking for int test annotation");
ok(names.some(function (f) f == "testing/bookmark/double"), "Checking for double test annotation");
ok(names.some(f => f == "bookmarkProperties/description"), "Checking for description annotation");
ok(names.some(f => f == "testing/bookmark/string"), "Checking for string test annotation");
ok(names.some(f => f == "testing/bookmark/int"), "Checking for int test annotation");
ok(names.some(f => f == "testing/bookmark/double"), "Checking for double test annotation");
// test adding a separator
var testSeparator = testFolder.addSeparator();

View File

@ -85,10 +85,10 @@ function test() {
onPageBLoadComplete();
}
},
onLocationChange: function () 0,
onProgressChange: function () 0,
onStatusChange: function () 0,
onSecurityChange: function () 0
onLocationChange: () => 0,
onProgressChange: () => 0,
onStatusChange: () => 0,
onSecurityChange: () => 0
});
// test loading new content with a frame into a tab

View File

@ -193,6 +193,7 @@
@RESPATH@/components/dom_messages.xpt
#endif
@RESPATH@/components/dom_apps.xpt
@RESPATH@/components/dom_newapps.xpt
@RESPATH@/components/dom_base.xpt
@RESPATH@/components/dom_system.xpt
#ifdef MOZ_B2G_BT
@ -638,6 +639,10 @@
@RESPATH@/components/PrivateBrowsing.manifest
@RESPATH@/components/PrivateBrowsingTrackingProtectionWhitelist.js
; Signed Packaged Content
@RESPATH@/components/InstallPackagedWebapp.manifest
@RESPATH@/components/InstallPackagedWebapp.js
; ANGLE GLES-on-D3D rendering library
#ifdef MOZ_ANGLE_RENDERER
@BINPATH@/libEGL.dll

View File

@ -152,9 +152,7 @@
locale/browser/syncQuota.properties (%chrome/browser/syncQuota.properties)
#endif
% resource search-plugins chrome://browser/locale/searchplugins/
# little trick to make the test below work
#define en_US en-US
#if AB_CD == en_US
#if BUILD_FASTER
locale/browser/searchplugins/list.txt (%searchplugins/list.txt)
locale/browser/searchplugins/ (%searchplugins/*.xml)
#else

View File

@ -713,18 +713,24 @@ this.BrowserUITelemetry = {
/**
* Default bucket name, when no other bucket is active.
*/
get BUCKET_DEFAULT() BUCKET_DEFAULT,
get BUCKET_DEFAULT() {
return BUCKET_DEFAULT;
},
/**
* Bucket prefix, for named buckets.
*/
get BUCKET_PREFIX() BUCKET_PREFIX,
get BUCKET_PREFIX() {
return BUCKET_PREFIX;
},
/**
* Standard separator to use between different parts of a bucket name, such
* as primary name and the time step string.
*/
get BUCKET_SEPARATOR() BUCKET_SEPARATOR,
get BUCKET_SEPARATOR() {
return BUCKET_SEPARATOR;
},
get currentBucket() {
return this._bucket;

View File

@ -144,7 +144,7 @@ this.ContentLinkHandler = {
/^about:blocked\?/,
/^about:certerror\?/,
/^about:home$/,
].some(function (re) re.test(targetDoc.documentURI));
].some(re => re.test(targetDoc.documentURI));
if (!isAllowedPage || !uri.schemeIs("chrome")) {
var ssm = Services.scriptSecurityManager;

View File

@ -159,12 +159,14 @@ var DirectoryLinksProvider = {
*/
_newTabHasInadjacentSite: false,
get _observedPrefs() Object.freeze({
enhanced: PREF_NEWTAB_ENHANCED,
linksURL: PREF_DIRECTORY_SOURCE,
matchOSLocale: PREF_MATCH_OS_LOCALE,
prefSelectedLocale: PREF_SELECTED_LOCALE,
}),
get _observedPrefs() {
return Object.freeze({
enhanced: PREF_NEWTAB_ENHANCED,
linksURL: PREF_DIRECTORY_SOURCE,
matchOSLocale: PREF_MATCH_OS_LOCALE,
prefSelectedLocale: PREF_SELECTED_LOCALE,
});
},
get _linksURL() {
if (!this.__linksURL) {

View File

@ -213,7 +213,7 @@ this.Social = {
}]
};
PlacesUtils.asyncHistory.updatePlaces(place, {
handleError: function () Cu.reportError("couldn't update history for socialmark annotation"),
handleError: () => Cu.reportError("couldn't update history for socialmark annotation"),
handleResult: function () {},
handleCompletion: function () {
promiseSetAnnotation(aURI, providerList).then(function() {

View File

@ -31,7 +31,7 @@ const Windows8WindowFrameColor = {
// Zero-pad the number just to make sure that it is 8 digits.
customizationColorHex = ("00000000" + customizationColorHex).substr(-8);
let customizationColorArray = customizationColorHex.match(/../g);
let [unused, fgR, fgG, fgB] = customizationColorArray.map(function(val) parseInt(val, 16));
let [unused, fgR, fgG, fgB] = customizationColorArray.map(val => parseInt(val, 16));
let colorizationColorBalance = Registry.readRegKey(HKCU, dwmKey,
"ColorizationColorBalance") || 78;
// Window frame base color when Color Intensity is at 0, see bug 1004576.

View File

@ -102,8 +102,8 @@ var tasksCfg = [
*/
// Open new tab
{
get title() _getString("taskbar.tasks.newTab.label"),
get description() _getString("taskbar.tasks.newTab.description"),
get title() { return _getString("taskbar.tasks.newTab.label"); },
get description() { return _getString("taskbar.tasks.newTab.description"); },
args: "-new-tab about:blank",
iconIndex: 3, // New window icon
open: true,
@ -114,8 +114,8 @@ var tasksCfg = [
// Open new window
{
get title() _getString("taskbar.tasks.newWindow.label"),
get description() _getString("taskbar.tasks.newWindow.description"),
get title() { return _getString("taskbar.tasks.newWindow.label"); },
get description() { return _getString("taskbar.tasks.newWindow.description"); },
args: "-browser",
iconIndex: 2, // New tab icon
open: true,
@ -125,8 +125,8 @@ var tasksCfg = [
// Open new private window
{
get title() _getString("taskbar.tasks.newPrivateWindow.label"),
get description() _getString("taskbar.tasks.newPrivateWindow.description"),
get title() { return _getString("taskbar.tasks.newPrivateWindow.label"); },
get description() { return _getString("taskbar.tasks.newPrivateWindow.description"); },
args: "-private-window",
iconIndex: 4, // Private browsing mode icon
open: true,

View File

@ -315,8 +315,7 @@ PreviewController.prototype = {
},
drawPreview: function (ctx) {
let self = this;
this.win.tabbrowser.previewTab(this.tab, function () self.previewTabCallback(ctx));
this.win.tabbrowser.previewTab(this.tab, () => this.previewTabCallback(ctx));
// We must avoid having the frame drawn around the window. See bug 520807
return false;
@ -749,7 +748,7 @@ this.AeroPeek = {
}
};
XPCOMUtils.defineLazyGetter(AeroPeek, "cacheTimer", function ()
XPCOMUtils.defineLazyGetter(AeroPeek, "cacheTimer", () =>
Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer)
);

View File

@ -106,14 +106,17 @@ function test() {
is(nPreviews, aPreviews, msg || "Got expected number of previews");
}
function getPreviewForTab(tab)
window.gTaskbarTabGroup.previewFromTab(tab);
function getPreviewForTab(tab) {
return window.gTaskbarTabGroup.previewFromTab(tab);
}
function checkSelectedTab()
getPreviewForTab(gBrowser.selectedTab).active;
function checkSelectedTab() {
return getPreviewForTab(gBrowser.selectedTab).active;
}
function isTabSelected(idx)
gBrowser.tabs[idx].selected;
function isTabSelected(idx) {
return gBrowser.tabs[idx].selected;
}
function createThumbnailSurface(p) {
let thumbnailWidth = 200,

View File

@ -1637,11 +1637,19 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
}
.alltabs-endimage[muted] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted);
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-muted);
}
.alltabs-endimage[soundplaying] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio);
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu);
}
menuitem:hover > hbox > .alltabs-endimage[muted] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-muted-hover);
}
menuitem:hover > hbox > .alltabs-endimage[soundplaying] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-hover);
}
/* Sidebar */

View File

@ -2959,11 +2959,19 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
}
.alltabs-endimage[muted] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted);
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-muted);
}
.alltabs-endimage[soundplaying] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio);
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu);
}
menuitem:hover > hbox > .alltabs-endimage[muted] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-muted-hover);
}
menuitem:hover > hbox > .alltabs-endimage[soundplaying] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-hover);
}
/* Bookmarks toolbar */

View File

@ -99,7 +99,7 @@
skin/classic/browser/social/gear_clicked.png (../shared/social/gear_clicked.png)
skin/classic/browser/tabbrowser/crashed.svg (../shared/tabbrowser/crashed.svg)
skin/classic/browser/tabbrowser/pendingpaint.png (../shared/tabbrowser/pendingpaint.png)
skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg)
* skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg)
skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg)
skin/classic/browser/tabbrowser/tab-overflow-indicator.png (../shared/tabbrowser/tab-overflow-indicator.png)
skin/classic/browser/theme-switcher-icon.png (../shared/theme-switcher-icon.png)

View File

@ -35,6 +35,17 @@
fill-opacity: .5;
}
.icon.menu {
fill: MenuText;
}
.icon.menu.hover {
#ifdef XP_MACOSX
fill: -moz-mac-menutextselect;
#else
fill: -moz-menuhovertext;
#endif
}
.icon.backgroundTab,
.icon.backgroundTab.hover,
.icon.backgroundTab.pressed {
@ -84,4 +95,9 @@
<path d="M12.5,3.4L9,6.3V2L5.2,5H4C2.9,5,2,5.9,2,7v2c0,0.9,0.6,1.6,1.4,1.9l-1.9,1.5l1,1.2l11-9L12.5,3.4z M9,14v-4l-2.5,2L9,14z"/>
</g>
<path id="tab-audio-menu" class="icon menu" d="M4,5C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.2L9,14V2L5.2,5H4z M11,8c0-0.6-0.4-1-1-1v2C10.6,9,11,8.6,11,8z M13,8 c0-1.4-1-2.6-2.3-2.9L10.4,6C11.3,6.2,12,7,12,8s-0.7,1.8-1.6,2l0.4,0.9C12,10.6,13,9.4,13,8z M11.4,3.2l-0.4,0.9 C12.8,4.6,14,6.2,14,8s-1.2,3.4-2.9,3.8l0.4,0.9C13.5,12.2,15,10.3,15,8S13.5,3.8,11.4,3.2z"/>
<path id="tab-audio-menu-muted" class="icon menu" d="M12.5,3.4L9,6.3V2L5.2,5H4C2.9,5,2,5.9,2,7v2c0,0.9,0.6,1.6,1.4,1.9l-1.9,1.5l1,1.2l11-9L12.5,3.4z M9,14v-4l-2.5,2L9,14z"/>
<path id="tab-audio-menu-hover" class="icon menu hover" d="M4,5C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.2L9,14V2L5.2,5H4z M11,8c0-0.6-0.4-1-1-1v2C10.6,9,11,8.6,11,8z M13,8 c0-1.4-1-2.6-2.3-2.9L10.4,6C11.3,6.2,12,7,12,8s-0.7,1.8-1.6,2l0.4,0.9C12,10.6,13,9.4,13,8z M11.4,3.2l-0.4,0.9 C12.8,4.6,14,6.2,14,8s-1.2,3.4-2.9,3.8l0.4,0.9C13.5,12.2,15,10.3,15,8S13.5,3.8,11.4,3.2z"/>
<path id="tab-audio-menu-muted-hover" class="icon menu hover" d="M12.5,3.4L9,6.3V2L5.2,5H4C2.9,5,2,5.9,2,7v2c0,0.9,0.6,1.6,1.4,1.9l-1.9,1.5l1,1.2l11-9L12.5,3.4z M9,14v-4l-2.5,2L9,14z"/>
</svg>

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -2195,11 +2195,19 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
}
.alltabs-endimage[muted] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted);
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-muted);
}
.alltabs-endimage[soundplaying] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio);
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu);
}
menuitem:hover > hbox > .alltabs-endimage[muted] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-muted-hover);
}
menuitem:hover > hbox > .alltabs-endimage[soundplaying] {
list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-menu-hover);
}
toolbarbutton.chevron {

View File

@ -137,8 +137,6 @@ MOZ_ARG_WITH_STRING(debug-label,
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
done])
MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
if test -n "$MOZ_DEBUG"; then
AC_MSG_CHECKING([for valid debug flags])
_SAVE_CFLAGS=$CFLAGS
@ -152,8 +150,14 @@ if test -n "$MOZ_DEBUG"; then
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
fi
CFLAGS=$_SAVE_CFLAGS
MOZ_DEBUG_DEFINES="$MOZ_DEBUG_ENABLE_DEFS"
else
MOZ_DEBUG_DEFINES="-DNDEBUG -DTRIMMED"
fi
AC_SUBST(MOZ_DEBUG_DEFINES)
dnl ========================================================
dnl = Enable generation of debug symbols
dnl ========================================================

View File

@ -46,6 +46,9 @@ export HOST_LDFLAGS="-g"
ac_add_options --target=x86_64-apple-darwin
ac_add_options --with-macos-private-frameworks=$CROSS_PRIVATE_FRAMEWORKS
# Enable static analysis checks by default on OSX cross builds.
ac_add_options --enable-clang-plugin
. "$topsrcdir/build/mozconfig.cache"
export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=/builds/crash-stats-api.token

View File

@ -53,8 +53,6 @@ bool OriginAttributes::CopyFromLoadContext(nsILoadContext* aLoadContext)
void
OriginAttributes::CreateSuffix(nsACString& aStr) const
{
MOZ_RELEASE_ASSERT(mAppId != nsIScriptSecurityManager::UNKNOWN_APP_ID);
UniquePtr<URLParams> params(new URLParams());
nsAutoString value;
@ -127,10 +125,6 @@ public:
return false;
}
if (mOriginAttributes->mAppId == nsIScriptSecurityManager::UNKNOWN_APP_ID) {
return false;
}
return true;
}
@ -222,14 +216,6 @@ BasePrincipal::GetOrigin(nsACString& aOrigin)
nsresult rv = GetOriginInternal(aOrigin);
NS_ENSURE_SUCCESS(rv, rv);
// OriginAttributes::CreateSuffix asserts against UNKNOWN_APP_ID. It's trivial
// to trigger this getter from script on such a principal, so we handle it
// here at the API entry point.
if (mOriginAttributes.mAppId == nsIScriptSecurityManager::UNKNOWN_APP_ID) {
NS_WARNING("Refusing to provide canonical origin string to principal with UNKNOWN_APP_ID");
return NS_ERROR_FAILURE;
}
nsAutoCString suffix;
mOriginAttributes.CreateSuffix(suffix);
aOrigin.Append(suffix);
@ -325,8 +311,6 @@ BasePrincipal::GetIsNullPrincipal(bool* aIsNullPrincipal)
NS_IMETHODIMP
BasePrincipal::GetJarPrefix(nsACString& aJarPrefix)
{
MOZ_ASSERT(AppId() != nsIScriptSecurityManager::UNKNOWN_APP_ID);
mozilla::GetJarPrefix(mOriginAttributes.mAppId, mOriginAttributes.mInBrowser, aJarPrefix);
return NS_OK;
}
@ -426,6 +410,28 @@ BasePrincipal::CreateCodebasePrincipal(nsIURI* aURI, OriginAttributes& aAttrs)
return codebase.forget();
}
already_AddRefed<BasePrincipal>
BasePrincipal::CreateCodebasePrincipal(const nsACString& aOrigin)
{
MOZ_ASSERT(!StringBeginsWith(aOrigin, NS_LITERAL_CSTRING("[")),
"CreateCodebasePrincipal does not support System and Expanded principals");
MOZ_ASSERT(!StringBeginsWith(aOrigin, NS_LITERAL_CSTRING(NS_NULLPRINCIPAL_SCHEME ":")),
"CreateCodebasePrincipal does not support nsNullPrincipal");
nsAutoCString originNoSuffix;
mozilla::OriginAttributes attrs;
if (!attrs.PopulateFromOrigin(aOrigin, originNoSuffix)) {
return nullptr;
}
nsCOMPtr<nsIURI> uri;
nsresult rv = NS_NewURI(getter_AddRefs(uri), originNoSuffix);
NS_ENSURE_SUCCESS(rv, nullptr);
return BasePrincipal::CreateCodebasePrincipal(uri, attrs);
}
bool
BasePrincipal::AddonAllowsLoad(nsIURI* aURI)
{

View File

@ -160,6 +160,7 @@ public:
static BasePrincipal* Cast(nsIPrincipal* aPrin) { return static_cast<BasePrincipal*>(aPrin); }
static already_AddRefed<BasePrincipal> CreateCodebasePrincipal(nsIURI* aURI, OriginAttributes& aAttrs);
static already_AddRefed<BasePrincipal> CreateCodebasePrincipal(const nsACString& aOrigin);
const OriginAttributes& OriginAttributesRef() { return mOriginAttributes; }
uint32_t AppId() const { return mOriginAttributes.mAppId; }

View File

@ -26,7 +26,7 @@ class DomainPolicyClone;
[ptr] native JSObjectPtr(JSObject);
[ptr] native DomainPolicyClonePtr(mozilla::dom::DomainPolicyClone);
[scriptable, uuid(6e8a4d1e-d9c6-4d86-bf53-d73f58f36148)]
[scriptable, uuid(b7ae2310-576e-11e5-a837-0800200c9a66)]
interface nsIScriptSecurityManager : nsISupports
{
/**
@ -197,6 +197,13 @@ interface nsIScriptSecurityManager : nsISupports
[implicit_jscontext]
nsIPrincipal createCodebasePrincipal(in nsIURI uri, in jsval originAttributes);
/**
* Returns a principal whose origin is the one we pass in.
* See nsIPrincipal.idl for a description of origin attributes, and
* ChromeUtils.webidl for a list of origin attributes and their defaults.
*/
nsIPrincipal createCodebasePrincipalFromOrigin(in ACString origin);
/**
* Returns a unique nonce principal with |originAttributes|.
* See nsIPrincipal.idl for a description of origin attributes, and

View File

@ -57,7 +57,6 @@ nsresult
nsNullPrincipal::Init(const OriginAttributes& aOriginAttributes)
{
mOriginAttributes = aOriginAttributes;
MOZ_ASSERT(AppId() != nsIScriptSecurityManager::UNKNOWN_APP_ID);
mURI = nsNullPrincipalURI::Create();
NS_ENSURE_TRUE(mURI, NS_ERROR_NOT_AVAILABLE);
@ -173,9 +172,6 @@ nsNullPrincipal::Read(nsIObjectInputStream* aStream)
NS_IMETHODIMP
nsNullPrincipal::Write(nsIObjectOutputStream* aStream)
{
NS_ENSURE_TRUE(mOriginAttributes.mAppId != nsIScriptSecurityManager::UNKNOWN_APP_ID,
NS_ERROR_INVALID_ARG);
nsAutoCString suffix;
OriginAttributesRef().CreateSuffix(suffix);

Some files were not shown because too many files have changed in this diff Show More