merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-08-10 15:54:26 +02:00
Родитель 5a14c558ee 6ed5110691
Коммит 553a2da922
494 изменённых файлов: 3161 добавлений и 1934 удалений

Просмотреть файл

@ -27,6 +27,10 @@ sys.dont_write_bytecode = old_bytecode
def FlagsForFile(filename):
mach = mach_module.get_mach()
out = StringIO()
# Mach calls sys.stdout.fileno(), so we need to fake it when capturing it.
# Returning an invalid file descriptor does the trick.
out.fileno = lambda: -1
out.encoding = None
mach.run(['compileflags', filename], stdout=out, stderr=out)

Просмотреть файл

@ -247,7 +247,7 @@ this.AccessFu = { // jshint ignore:line
_output: function _output(aPresentationData, aBrowser) {
if (!Utils.isAliveAndVisible(
Utils.AccRetrieval.getAccessibleFor(aBrowser))) {
Utils.AccService.getAccessibleFor(aBrowser))) {
return;
}
for (let presenter of aPresentationData) {

Просмотреть файл

@ -222,7 +222,7 @@ this.ContentControl.prototype = {
// (via ARIA roles, etc.), so we need to generate a click.
// Could possibly be made simpler in the future. Maybe core
// engine could expose nsCoreUtiles::DispatchMouseEvent()?
let docAcc = Utils.AccRetrieval.getAccessibleFor(this.document);
let docAcc = Utils.AccService.getAccessibleFor(this.document);
let docX = {}, docY = {}, docW = {}, docH = {};
docAcc.getBounds(docX, docY, docW, docH);
@ -249,7 +249,7 @@ this.ContentControl.prototype = {
}
};
let focusedAcc = Utils.AccRetrieval.getAccessibleFor(
let focusedAcc = Utils.AccService.getAccessibleFor(
this.document.activeElement);
if (focusedAcc && this.vc.position === focusedAcc
&& focusedAcc.role === Roles.ENTRY) {
@ -478,7 +478,7 @@ this.ContentControl.prototype = {
}
if (aOptions.moveToFocused) {
acc = Utils.AccRetrieval.getAccessibleFor(
acc = Utils.AccService.getAccessibleFor(
this.document.activeElement) || acc;
}

Просмотреть файл

@ -559,7 +559,7 @@ this.EventManager.prototype = {
}
if (tabstate) {
let docAcc = Utils.AccRetrieval.getAccessibleFor(aWebProgress.DOMWindow.document);
let docAcc = Utils.AccService.getAccessibleFor(aWebProgress.DOMWindow.document);
this.present(Presentation.tabStateChanged(docAcc, tabstate));
}
},
@ -567,7 +567,7 @@ this.EventManager.prototype = {
onProgressChange: function onProgressChange() {},
onLocationChange: function onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
let docAcc = Utils.AccRetrieval.getAccessibleFor(aWebProgress.DOMWindow.document);
let docAcc = Utils.AccService.getAccessibleFor(aWebProgress.DOMWindow.document);
this.present(Presentation.tabStateChanged(docAcc, 'newdoc'));
},

Просмотреть файл

@ -52,7 +52,7 @@ var OutputGenerator = {
output.push.apply(output, self.genForObject(aAccessible, aContext));
};
let ignoreSubtree = function ignoreSubtree(aAccessible) {
let roleString = Utils.AccRetrieval.getStringRole(aAccessible.role);
let roleString = Utils.AccService.getStringRole(aAccessible.role);
let nameRule = self.roleRuleMap[roleString] || 0;
// Ignore subtree if the name is explicit and the role's name rule is the
// NAME_FROM_SUBTREE_RULE.
@ -108,7 +108,7 @@ var OutputGenerator = {
* determined by {@link roleRuleMap}.
*/
genForObject: function genForObject(aAccessible, aContext) {
let roleString = Utils.AccRetrieval.getStringRole(aAccessible.role);
let roleString = Utils.AccService.getStringRole(aAccessible.role);
let func = this.objectOutputFunctions[
OutputGenerator._getOutputName(roleString)] ||
this.objectOutputFunctions.defaultFunc;

Просмотреть файл

@ -382,7 +382,7 @@ this.TraversalHelper = {
getHelperPivot: function TraversalHelper_getHelperPivot(aRoot) {
let pivot = this.helperPivotCache.get(aRoot.DOMNode);
if (!pivot) {
pivot = Utils.AccRetrieval.createAccessiblePivot(aRoot);
pivot = Utils.AccService.createAccessiblePivot(aRoot);
this.helperPivotCache.set(aRoot.DOMNode, pivot);
}

Просмотреть файл

@ -69,13 +69,13 @@ this.Utils = { // jshint ignore:line
Ci.nsIDOMWindowUtils);
},
get AccRetrieval() {
if (!this._AccRetrieval) {
this._AccRetrieval = Cc['@mozilla.org/accessibleRetrieval;1'].
getService(Ci.nsIAccessibleRetrieval);
get AccService() {
if (!this._AccService) {
this._AccService = Cc['@mozilla.org/accessibilityService;1'].
getService(Ci.nsIAccessibilityService);
}
return this._AccRetrieval;
return this._AccService;
},
set MozBuildApp(value) {
@ -295,7 +295,7 @@ this.Utils = { // jshint ignore:line
getVirtualCursor: function getVirtualCursor(aDocument) {
let doc = (aDocument instanceof Ci.nsIAccessible) ? aDocument :
this.AccRetrieval.getAccessibleFor(aDocument);
this.AccService.getAccessibleFor(aDocument);
return doc.QueryInterface(Ci.nsIAccessibleDocument).virtualCursor;
},
@ -539,7 +539,7 @@ State.prototype = {
return !!(this.base & other.base || this.extended & other.extended);
},
toString: function State_toString() {
let stateStrings = Utils.AccRetrieval.
let stateStrings = Utils.AccService.
getStringStates(this.base, this.extended);
let statesArray = new Array(stateStrings.length);
for (let i = 0; i < statesArray.length; i++) {
@ -640,7 +640,7 @@ this.Logger = { // jshint ignore:line
}
try {
return'[ ' + Utils.AccRetrieval.getStringRole(aAccessible.role) +
return'[ ' + Utils.AccService.getStringRole(aAccessible.role) +
' | ' + aAccessible.name + ' ]';
} catch (x) {
return '[ defunct ]';
@ -648,12 +648,12 @@ this.Logger = { // jshint ignore:line
},
eventToString: function eventToString(aEvent) {
let str = Utils.AccRetrieval.getStringEventType(aEvent.eventType);
let str = Utils.AccService.getStringEventType(aEvent.eventType);
if (aEvent.eventType == Events.STATE_CHANGE) {
let event = aEvent.QueryInterface(Ci.nsIAccessibleStateChangeEvent);
let stateStrings = event.isExtraState ?
Utils.AccRetrieval.getStringStates(0, event.state) :
Utils.AccRetrieval.getStringStates(event.state, 0);
Utils.AccService.getStringStates(0, event.state) :
Utils.AccService.getStringStates(event.state, 0);
str += ' (' + stateStrings.item(0) + ')';
}
@ -887,7 +887,7 @@ PivotContext.prototype = {
hints.push(hint);
} else if (aAccessible.actionCount > 0) {
hints.push({
string: Utils.AccRetrieval.getStringRole(
string: Utils.AccService.getStringRole(
aAccessible.role).replace(/\s/g, '') + '-hint'
});
}

Просмотреть файл

@ -121,7 +121,7 @@ addMessageListener(
eventManager.start();
function contentStarted() {
let accDoc = Utils.AccRetrieval.getAccessibleFor(content.document);
let accDoc = Utils.AccService.getAccessibleFor(content.document);
if (accDoc && !Utils.getState(accDoc).contains(States.BUSY)) {
sendAsyncMessage('AccessFu:ContentStarted');
} else {

Просмотреть файл

@ -49,8 +49,8 @@ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
function A(o) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var acc = Components.classes['@mozilla.org/accessibleRetrieval;1']
.getService(Components.interfaces.nsIAccessibleRetrieval);
var acc = Components.classes['@mozilla.org/accessibilityService;1']
.getService(Components.interfaces.nsIAccessibilityService);
return acc.getAccessibleFor(o);
}

Просмотреть файл

@ -9,15 +9,15 @@
<![CDATA[
function doTest()
{
var accRetrieval = SpecialPowers.Cc["@mozilla.org/accessibleRetrieval;1"].
getService(SpecialPowers.Ci.nsIAccessibleRetrieval);
var accService = SpecialPowers.Cc["@mozilla.org/accessibilityService;1"].
getService(SpecialPowers.Ci.nsIAccessibilityService);
var treecol = document.getElementById("col");
var x = treecol.boxObject.screenX;
var y = treecol.boxObject.screenY;
var tree = document.getElementById("tree");
var treeAcc = accRetrieval.getAccessibleFor(tree);
var treeAcc = accService.getAccessibleFor(tree);
treeAcc.getChildAtPoint(x + 1, y + 1);
}
]]>

Просмотреть файл

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////
// Interfaces
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
const nsIAccessibilityService = Components.interfaces.nsIAccessibilityService;
const nsIAccessibleEvent = Components.interfaces.nsIAccessibleEvent;
const nsIAccessibleStateChangeEvent =
@ -94,25 +94,25 @@ const MAX_TRIM_LENGTH = 100;
Components.utils.import('resource://gre/modules/Services.jsm');
/**
* nsIAccessibleRetrieval service.
* nsIAccessibilityService service.
*/
var gAccRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(nsIAccessibleRetrieval);
var gAccService = Components.classes["@mozilla.org/accessibilityService;1"].
getService(nsIAccessibilityService);
/**
* Enable/disable logging.
*/
function enableLogging(aModules)
{
gAccRetrieval.setLogging(aModules);
gAccService.setLogging(aModules);
}
function disableLogging()
{
gAccRetrieval.setLogging("");
gAccService.setLogging("");
}
function isLogged(aModule)
{
return gAccRetrieval.isLogged(aModule);
return gAccService.isLogged(aModule);
}
/**
@ -272,7 +272,7 @@ function getAccessible(aAccOrElmOrID, aInterfaces, aElmObj, aDoNotFailIf)
var acc = (aAccOrElmOrID instanceof nsIAccessible) ? aAccOrElmOrID : null;
if (!acc) {
try {
acc = gAccRetrieval.getAccessibleFor(elm);
acc = gAccService.getAccessibleFor(elm);
} catch (e) {
}
@ -363,7 +363,7 @@ function getTabDocAccessible(aAccOrElmOrID)
*/
function getApplicationAccessible()
{
return gAccRetrieval.getApplicationAccessible().
return gAccService.getApplicationAccessible().
QueryInterface(nsIAccessibleApplication);
}
@ -584,7 +584,7 @@ function testAccessibleTree(aAccOrElmOrID, aAccTree, aFlags)
function isAccessibleInCache(aNodeOrId)
{
var node = getNode(aNodeOrId);
return gAccRetrieval.getAccessibleFromCache(node) ? true : false;
return gAccService.getAccessibleFromCache(node) ? true : false;
}
/**
@ -671,7 +671,7 @@ function testDefunctAccessible(aAcc, aNodeOrId)
*/
function roleToString(aRole)
{
return gAccRetrieval.getStringRole(aRole);
return gAccService.getStringRole(aRole);
}
/**
@ -679,7 +679,7 @@ function roleToString(aRole)
*/
function statesToString(aStates, aExtraStates)
{
var list = gAccRetrieval.getStringStates(aStates, aExtraStates);
var list = gAccService.getStringStates(aStates, aExtraStates);
var str = "";
for (var index = 0; index < list.length - 1; index++)
@ -696,7 +696,7 @@ function statesToString(aStates, aExtraStates)
*/
function eventTypeToString(aEventType)
{
return gAccRetrieval.getStringEventType(aEventType);
return gAccService.getStringEventType(aEventType);
}
/**
@ -704,7 +704,7 @@ function eventTypeToString(aEventType)
*/
function relationTypeToString(aRelationType)
{
return gAccRetrieval.getStringRelationType(aRelationType);
return gAccService.getStringRelationType(aRelationType);
}
function getLoadContext() {

Просмотреть файл

@ -4,15 +4,15 @@
<script>
const STATE_BUSY = Components.interfaces.nsIAccessibleStates.STATE_BUSY;
var gRetrieval = null;
var gService = null;
function waitForDocLoad()
{
if (!gRetrieval) {
gRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
if (!gService) {
gService = Components.classes["@mozilla.org/accessibilityService;1"].
getService(Components.interfaces.nsIAccessibilityService);
}
var accDoc = gRetrieval.getAccessibleFor(document);
var accDoc = gService.getAccessibleFor(document);
var state = {};
accDoc.getState(state, {});
@ -27,7 +27,7 @@
function hideIFrame()
{
var iframe = document.getElementById("iframe");
gRetrieval.getAccessibleFor(iframe.contentDocument);
gService.getAccessibleFor(iframe.contentDocument);
iframe.style.display = 'none';
}
</script>

Просмотреть файл

@ -23,7 +23,7 @@
// Force the creation of an accessible for the hidden window's document.
var doc = Services.appShell.hiddenDOMWindow.document;
gAccRetrieval.getAccessibleFor(doc);
gAccService.getAccessibleFor(doc);
// The private hidden window will be lazily created that's why we need to do
// it here *before* loading '../events.js' or else we'll have a duplicate
@ -31,7 +31,7 @@
var privateDoc = Services.appShell.hiddenPrivateDOMWindow.document;
// Force the creation of an accessible for the private hidden window's doc.
gAccRetrieval.getAccessibleFor(privateDoc);
gAccService.getAccessibleFor(privateDoc);
</script>
<script type="application/javascript"

Просмотреть файл

@ -519,7 +519,7 @@ function removeVCRootChecker(aPivot)
*/
function removeVCRootInvoker(aRootNode)
{
this.pivot = gAccRetrieval.createAccessiblePivot(getAccessible(aRootNode));
this.pivot = gAccService.createAccessiblePivot(getAccessible(aRootNode));
this.invoke = function removeVCRootInvoker_invoke()
{
this.pivot.position = this.pivot.root.firstChild;

Просмотреть файл

@ -3,9 +3,9 @@
<script>
function replaceBody()
{
var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
accRetrieval.getAccessibleFor(document);
var accService = Components.classes["@mozilla.org/accessibilityService;1"].
getService(Components.interfaces.nsIAccessibilityService);
accService.getAccessibleFor(document);
var newBody = document.createElement("body");
newBody.setAttribute("contentEditable", "true");

Просмотреть файл

@ -25,5 +25,7 @@ def package_moztt(value):
set_define('PACKAGE_MOZTT', package_moztt)
imply_option('MOZ_ENABLE_WARNINGS_AS_ERRORS',
depends(target)(lambda t: t.os == 'Android'), reason='--target')
include('../toolkit/moz.configure')

Просмотреть файл

@ -18,9 +18,6 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=

Просмотреть файл

@ -18,9 +18,6 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=

Просмотреть файл

@ -18,9 +18,6 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=

Просмотреть файл

@ -17,9 +17,6 @@ export MOZ_TELEMETRY_REPORTING=1
#ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# B2G Stuff
ac_add_options --enable-application=b2g
ac_add_options --enable-debug-symbols

Просмотреть файл

@ -18,9 +18,6 @@ export MOZ_TELEMETRY_REPORTING=1
#ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# B2G Stuff
ac_add_options --enable-application=b2g
ac_add_options --enable-debug-symbols

Просмотреть файл

@ -52,10 +52,6 @@ MOZ_PAY=1
MOZ_TOOLKIT_SEARCH=
MOZ_B2G=1
if test "$OS_TARGET" = "Android"; then
MOZ_ENABLE_WARNINGS_AS_ERRORS=1
fi
MOZ_JSDOWNLOADS=1
MOZ_BUNDLED_FONTS=1

Просмотреть файл

@ -17,9 +17,6 @@ export MOZILLA_OFFICIAL=1
ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -14,9 +14,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -15,9 +15,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -14,9 +14,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -15,9 +15,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -13,9 +13,6 @@ export MOZILLA_OFFICIAL=1
#ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# graphene Stuff
ac_add_options --enable-debug-symbols
ac_add_options --enable-debug

Просмотреть файл

@ -16,9 +16,6 @@ export MOZILLA_OFFICIAL=1
#ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# graphene Stuff
ac_add_options --enable-debug-symbols
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP

Просмотреть файл

@ -20,9 +20,6 @@ ac_add_options --with-google-oauth-api-keyfile=${_google_oauth_api_keyfile}
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -14,9 +14,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -15,9 +15,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -14,9 +14,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -15,9 +15,6 @@ STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"

Просмотреть файл

@ -13,9 +13,6 @@ export MOZILLA_OFFICIAL=1
#ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# graphene Stuff
ac_add_options --enable-debug-symbols
ac_add_options --enable-debug

Просмотреть файл

@ -16,9 +16,6 @@ export MOZILLA_OFFICIAL=1
#ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# graphene Stuff
ac_add_options --enable-debug-symbols
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP

Просмотреть файл

@ -20,9 +20,6 @@ ac_add_options --with-google-oauth-api-keyfile=${_google_oauth_api_keyfile}
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -47,10 +47,6 @@ MOZ_TOOLKIT_SEARCH=
MOZ_PLACES=
MOZ_B2G=1
if test "$OS_TARGET" = "Android"; then
MOZ_ENABLE_WARNINGS_AS_ERRORS=1
fi
MOZ_JSDOWNLOADS=1
MOZ_BUNDLED_FONTS=1

Просмотреть файл

@ -13,7 +13,6 @@
#include "nsIScriptSecurityManager.h"
#include "nsIProtocolHandler.h"
#include "mozilla/ArrayUtils.h"
#include "nsDOMString.h"
#include "nsServiceManagerUtils.h"
namespace mozilla {
@ -25,7 +24,6 @@ struct RedirEntry {
const char* id;
const char* url;
uint32_t flags;
const char* idbOriginPostfix;
};
/*
@ -224,29 +222,6 @@ AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result)
return NS_ERROR_ILLEGAL_VALUE;
}
NS_IMETHODIMP
AboutRedirector::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
{
NS_ENSURE_ARG_POINTER(aURI);
nsAutoCString name = GetAboutModuleName(aURI);
for (int i = 0; i < kRedirTotal; i++) {
if (name.Equals(kRedirMap[i].id)) {
const char* postfix = kRedirMap[i].idbOriginPostfix;
if (!postfix) {
break;
}
result.AssignASCII(postfix);
return NS_OK;
}
}
SetDOMStringToNull(result);
return NS_ERROR_ILLEGAL_VALUE;
}
nsresult
AboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **result)
{

Просмотреть файл

@ -4,9 +4,15 @@
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "styleSheetService",
"@mozilla.org/content/style-sheet-service;1",
"nsIStyleSheetService");
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
Cu.import("resource://gre/modules/AppConstants.jsm");
@ -42,18 +48,14 @@ function promisePopupShown(popup) {
});
}
XPCOMUtils.defineLazyGetter(global, "stylesheets", () => {
let styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"]
.getService(Components.interfaces.nsIStyleSheetService);
let styleSheetURI = Services.io.newURI("chrome://browser/content/extension.css",
null, null);
XPCOMUtils.defineLazyGetter(this, "stylesheets", () => {
let styleSheetURI = NetUtil.newURI("chrome://browser/content/extension.css");
let styleSheet = styleSheetService.preloadSheet(styleSheetURI,
styleSheetService.AGENT_SHEET);
let stylesheets = [styleSheet];
if (AppConstants.platform === "macosx") {
styleSheetURI = Services.io.newURI("chrome://browser/content/extension-mac.css",
null, null);
styleSheetURI = NetUtil.newURI("chrome://browser/content/extension-mac.css");
let macStyleSheet = styleSheetService.preloadSheet(styleSheetURI,
styleSheetService.AGENT_SHEET);
stylesheets.push(macStyleSheet);
@ -61,6 +63,24 @@ XPCOMUtils.defineLazyGetter(global, "stylesheets", () => {
return stylesheets;
});
XPCOMUtils.defineLazyGetter(this, "standaloneStylesheets", () => {
let stylesheets = [];
if (AppConstants.platform === "macosx") {
let styleSheetURI = NetUtil.newURI("chrome://browser/content/extension-mac-panel.css");
let macStyleSheet = styleSheetService.preloadSheet(styleSheetURI,
styleSheetService.AGENT_SHEET);
stylesheets.push(macStyleSheet);
}
if (AppConstants.platform === "win") {
let styleSheetURI = NetUtil.newURI("chrome://browser/content/extension-win-panel.css");
let winStyleSheet = styleSheetService.preloadSheet(styleSheetURI,
styleSheetService.AGENT_SHEET);
stylesheets.push(winStyleSheet);
}
return stylesheets;
});
class BasePopup {
constructor(extension, viewNode, popupURL, browserStyle) {
let popupURI = Services.io.newURI(popupURL, null, extension.baseURI);
@ -123,11 +143,20 @@ class BasePopup {
break;
case "DOMWindowCreated":
if (this.browserStyle && event.target === this.browser.contentDocument) {
if (event.target === this.browser.contentDocument) {
let winUtils = this.browser.contentWindow
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
for (let stylesheet of global.stylesheets) {
winUtils.addSheet(stylesheet, winUtils.AGENT_SHEET);
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
if (this.browserStyle) {
for (let stylesheet of stylesheets) {
winUtils.addSheet(stylesheet, winUtils.AGENT_SHEET);
}
}
if (!this.fixedWidth) {
for (let stylesheet of standaloneStylesheets) {
winUtils.addSheet(stylesheet, winUtils.AGENT_SHEET);
}
}
}
break;
@ -174,6 +203,8 @@ class BasePopup {
this.browser = document.createElementNS(XUL_NS, "browser");
this.browser.setAttribute("type", "content");
this.browser.setAttribute("disableglobalhistory", "true");
this.browser.setAttribute("transparent", "true");
this.browser.setAttribute("class", "webextension-popup-browser");
this.browser.setAttribute("webextension-view-type", "popup");
// We only need flex sizing for the sake of the slide-in sub-views of the

Просмотреть файл

@ -0,0 +1,3 @@
body {
border-radius: 3.5px;
}

Просмотреть файл

@ -0,0 +1,7 @@
@media (-moz-os-version: windows-xp),
(-moz-os-version: windows-vista),
(-moz-os-version: windows-win7) {
body {
border-radius: 4px;
}
}

Просмотреть файл

@ -11,7 +11,7 @@ input {
/* Variables */
html,
body {
background-color: #fcfcfc;
background: transparent;
box-sizing: border-box;
color: #222426;
cursor: default;

Просмотреть файл

@ -4,7 +4,13 @@
browser.jar:
content/browser/extension.css
#ifdef XP_MACOSX
content/browser/extension-mac.css
content/browser/extension-mac-panel.css
#endif
#ifdef XP_WIN
content/browser/extension-win-panel.css
#endif
content/browser/extension.svg
content/browser/ext-bookmarks.js
content/browser/ext-browserAction.js

Просмотреть файл

@ -43,6 +43,7 @@ support-files =
[browser_ext_pageAction_popup_resize.js]
[browser_ext_pageAction_simple.js]
[browser_ext_popup_api_injection.js]
[browser_ext_popup_corners.js]
[browser_ext_runtime_openOptionsPage.js]
[browser_ext_runtime_openOptionsPage_uninstall.js]
[browser_ext_runtime_setUninstallURL.js]

Просмотреть файл

@ -20,8 +20,8 @@ function* testInArea(area) {
"popup-a.html": scriptPage("popup-a.js"),
"popup-a.js": function() {
window.onload = () => {
let background = window.getComputedStyle(document.body).backgroundColor;
browser.test.assertEq("rgb(252, 252, 252)", background);
let color = window.getComputedStyle(document.body).color;
browser.test.assertEq("rgb(34, 36, 38)", color);
browser.runtime.sendMessage("from-popup-a");
};
browser.runtime.onMessage.addListener(msg => {

Просмотреть файл

@ -0,0 +1,101 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
function* awaitPanel(extension, win = window) {
let {target} = yield BrowserTestUtils.waitForEvent(win.document, "load", true, (event) => {
return event.target.location && event.target.location.href.endsWith("popup.html");
});
return target.defaultView
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDocShell)
.chromeEventHandler;
}
add_task(function* testPopupBorderRadius() {
let extension = ExtensionTestUtils.loadExtension({
background() {
browser.tabs.query({active: true, currentWindow: true}, tabs => {
browser.pageAction.show(tabs[0].id);
});
},
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": false,
},
"page_action": {
"default_popup": "popup.html",
"browser_style": false,
},
},
files: {
"popup.html": `<!DOCTYPE html>
<html>
<head><meta charset="utf-8"></head>
<body style="width: 100px; height: 100px;"></body>
</html>`,
},
});
yield extension.startup();
function* testPanel(browser, standAlone = true) {
let panel = getPanelForNode(browser);
let arrowContent = document.getAnonymousElementByAttribute(panel, "class", "panel-arrowcontent");
let panelStyle = getComputedStyle(arrowContent);
let viewNode = browser.parentNode === panel ? browser : browser.parentNode;
let viewStyle = getComputedStyle(viewNode);
let win = browser.contentWindow;
let bodyStyle = win.getComputedStyle(win.document.body);
for (let prop of ["borderTopLeftRadius", "borderTopRightRadius",
"borderBottomRightRadius", "borderBottomLeftRadius"]) {
if (standAlone) {
is(viewStyle[prop], panelStyle[prop], `Panel and view ${prop} should be the same`);
is(bodyStyle[prop], panelStyle[prop], `Panel and body ${prop} should be the same`);
} else {
is(viewStyle[prop], "0px", `View node ${prop} should be 0px`);
is(bodyStyle[prop], "0px", `Body node ${prop} should be 0px`);
}
}
}
{
info("Test stand-alone browserAction popup");
clickBrowserAction(extension);
let browser = yield awaitPanel(extension);
yield testPanel(browser);
yield closeBrowserAction(extension);
}
{
info("Test menu panel browserAction popup");
let widget = getBrowserActionWidget(extension);
CustomizableUI.addWidgetToArea(widget.id, CustomizableUI.AREA_PANEL);
clickBrowserAction(extension);
let browser = yield awaitPanel(extension);
yield testPanel(browser, false);
yield closeBrowserAction(extension);
}
{
info("Test pageAction popup");
clickPageAction(extension);
let browser = yield awaitPanel(extension);
yield testPanel(browser);
yield closePageAction(extension);
}
yield extension.unload();
});

Просмотреть файл

@ -10,7 +10,7 @@
* promisePopupShown promisePopupHidden
* openContextMenu closeContextMenu
* openExtensionContextMenu closeExtensionContextMenu
* imageBuffer getListStyleImage
* imageBuffer getListStyleImage getPanelForNode
*/
var {AppConstants} = Cu.import("resource://gre/modules/AppConstants.jsm");
@ -83,6 +83,13 @@ function promisePopupHidden(popup) {
});
}
function getPanelForNode(node) {
while (node.localName != "panel") {
node = node.parentNode;
}
return node;
}
function getBrowserActionWidget(extension) {
return CustomizableUI.getWidget(makeWidgetId(extension.id) + "-browser-action");
}

Просмотреть файл

@ -12,8 +12,5 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -15,9 +15,6 @@ export MOZ_TELEMETRY_REPORTING=1
#Use ccache
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -12,8 +12,5 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -13,9 +13,6 @@ export MOZILLA_OFFICIAL=1
# Enable Telemetry
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -14,9 +14,6 @@ export CXX="$topsrcdir/clang/bin/clang++"
# Add the static checker
ac_add_options --enable-clang-plugin
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/unix/mozconfig.stdcxx"
export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig

Просмотреть файл

@ -13,9 +13,6 @@ CXX="$topsrcdir/clang/bin/clang++"
# Add the static checker
ac_add_options --enable-clang-plugin
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/unix/mozconfig.stdcxx"
export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig

Просмотреть файл

@ -15,8 +15,5 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -15,9 +15,6 @@ if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -7,9 +7,6 @@ MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-debug
ac_add_options --enable-dmd
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
ac_add_options --enable-clang-plugin
. "$topsrcdir/build/mozconfig.common.override"

Просмотреть файл

@ -13,9 +13,6 @@ if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -8,9 +8,6 @@ ac_add_options --disable-debug
ac_add_options --enable-optimize
ac_add_options --enable-dmd
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
ac_add_options --enable-clang-plugin
. "$topsrcdir/build/mozconfig.rust"

Просмотреть файл

@ -28,9 +28,6 @@ export MOZ_TELEMETRY_REPORTING=1
. $topsrcdir/build/win32/mozconfig.vs-latest
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Enable Adobe Primetime CDM on 32-bit Windows in Mozilla builds.
# Enabled here on the assumption that downstream vendors will not be using
# these build configs.

Просмотреть файл

@ -23,9 +23,6 @@ export MOZ_TELEMETRY_REPORTING=1
. $topsrcdir/build/win32/mozconfig.vs-latest
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -12,9 +12,6 @@ ac_add_options --enable-clang-plugin
. $topsrcdir/build/win32/mozconfig.vs-latest
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

Просмотреть файл

@ -24,9 +24,6 @@ export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
. $topsrcdir/build/win64/mozconfig.vs-latest
# Enable Adobe Primetime CDM on 64-bit Windows in Mozilla builds.

Просмотреть файл

@ -23,9 +23,6 @@ export MOZILLA_OFFICIAL=1
# Enable Telemetry
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors (modulo ALLOW_COMPILER_WARNINGS).
ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

Просмотреть файл

@ -1955,6 +1955,15 @@ notification.pluginVulnerable > .notification-inner > .messageCloseButton:not(:h
overflow: hidden;
}
.webextension-popup-browser {
margin-right: -1px;
border-radius: inherit;
}
#PanelUI-popup .webextension-popup-browser {
margin: 0;
}
.menuitem-iconic[usercontextid] > .menu-iconic-left > .menu-iconic-icon {
visibility: visible;
}

Просмотреть файл

@ -3462,3 +3462,16 @@ menulist.translate-infobar-element > .menulist-dropmarker {
padding: 0;
overflow: hidden;
}
.cui-widget-panelview[id^=PanelUI-webext-] {
border-radius: 3.5px;
}
.webextension-popup-browser {
margin-right: -1px;
border-radius: inherit;
}
#PanelUI-popup .webextension-popup-browser {
margin: 0;
}

Просмотреть файл

@ -273,10 +273,6 @@ panelmultiview[nosubviews=true] > .panel-viewcontainer > .panel-viewstack > .pan
padding: 0;
}
.cui-widget-panelview[id^=PanelUI-webext-] {
border-radius: 3.5px;
}
panelview[id^=PanelUI-webext-] {
overflow: hidden;
}

Просмотреть файл

@ -2718,3 +2718,20 @@ notification.pluginVulnerable > .notification-inner > .messageCloseButton {
padding: 0;
overflow: hidden;
}
@media (-moz-os-version: windows-xp),
(-moz-os-version: windows-vista),
(-moz-os-version: windows-win7) {
.cui-widget-panelview[id^=PanelUI-webext-] {
border-radius: 4px;
}
}
.webextension-popup-browser {
margin-right: -1px;
border-radius: inherit;
}
#PanelUI-popup .webextension-popup-browser {
margin: 0;
}

Просмотреть файл

@ -294,189 +294,3 @@ if test -n "$GCC_USE_GNU_LD"; then
fi
])
dnl GCC and clang will fail if given an unknown warning option like -Wfoobar.
dnl But later versions won't fail if given an unknown negated warning option
dnl like -Wno-foobar. So when we are check for support of negated warning
dnl options, we actually test the positive form, but add the negated form to
dnl the flags variable.
AC_DEFUN([MOZ_C_SUPPORTS_WARNING],
[
AC_CACHE_CHECK(whether the C compiler supports $1$2, $3,
[
AC_LANG_SAVE
AC_LANG_C
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -W$2"
AC_TRY_COMPILE([],
[return(0);],
$3="yes",
$3="no")
CFLAGS="$_SAVE_CFLAGS"
AC_LANG_RESTORE
])
if test "${$3}" = "yes"; then
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} $1$2"
fi
])
AC_DEFUN([MOZ_CXX_SUPPORTS_WARNING],
[
AC_CACHE_CHECK(whether the C++ compiler supports $1$2, $3,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -Werror -W$2"
AC_TRY_COMPILE([],
[return(0);],
$3="yes",
$3="no")
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])
if test "${$3}" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} $1$2"
fi
])
AC_DEFUN([MOZ_SET_WARNINGS_CFLAGS],
[
# Turn on gcc/clang warnings:
# https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html
# -Wall - lots of useful warnings
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Wignored-qualifiers - catches return types with qualifiers like const
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wsign-compare - catches comparing signed/unsigned ints
# -Wtype-limits - catches overflow bugs, few false positives
# -Wunreachable-code - catches some dead code
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wempty-body"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wignored-qualifiers"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wpointer-arith"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wsign-compare"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wunreachable-code"
# -Wclass-varargs - catches objects passed by value to variadic functions.
# -Wloop-analysis - catches issues around loops
# -Wnon-literal-null-conversion - catches expressions used as a null pointer constant
# -Wstring-conversion - catches string literals used in boolean expressions
# -Wthread-safety - catches inconsistent use of mutexes
#
# XXX: at the time of writing, the version of clang used on the OS X test
# machines has a bug that causes it to reject some valid files if both
# -Wnon-literal-null-conversion and -Wsometimes-uninitialized are
# specified. We work around this by instead using
# -Werror=non-literal-null-conversion, but we only do that when
# --enable-warnings-as-errors is specified so that no unexpected fatal
# warnings are produced.
MOZ_C_SUPPORTS_WARNING(-W, class-varargs, ac_c_has_wclass_varargs)
MOZ_C_SUPPORTS_WARNING(-W, loop-analysis, ac_c_has_wloop_analysis)
if test "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
MOZ_C_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_c_has_non_literal_null_conversion)
fi
MOZ_C_SUPPORTS_WARNING(-W, string-conversion, ac_c_has_wstring_conversion)
MOZ_C_SUPPORTS_WARNING(-W, thread-safety, ac_c_has_wthread_safety)
# Turn off some non-useful warnings that -Wall turns on.
# Prevent the following GCC warnings from being treated as errors:
# -Wmaybe-uninitialized - too many false positives
# -Wdeprecated-declarations - we don't want our builds held hostage when a
# platform-specific API becomes deprecated.
# -Wfree-nonheap-object - false positives during PGO
# -Warray-bounds - false positives depending on optimization
MOZ_C_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_c_has_noerror_maybe_uninitialized)
MOZ_C_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_c_has_noerror_deprecated_declarations)
MOZ_C_SUPPORTS_WARNING(-W, no-error=array-bounds, ac_c_has_noerror_array_bounds)
if test -n "$MOZ_PGO"; then
MOZ_C_SUPPORTS_WARNING(-W, no-error=coverage-mismatch, ac_c_has_noerror_coverage_mismatch)
MOZ_C_SUPPORTS_WARNING(-W, no-error=free-nonheap-object, ac_c_has_noerror_free_nonheap_object)
fi
])
AC_DEFUN([MOZ_SET_WARNINGS_CXXFLAGS],
[
# Turn on gcc/clang warnings:
# https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html
# -Wall - lots of useful warnings
# -Wc++1[14z]-compat[-pedantic] - catches C++ version forward-compat issues
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Wignored-qualifiers - catches return types with qualifiers like const
# -Woverloaded-virtual - function declaration hides virtual function from base class
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wsign-compare - catches comparing signed/unsigned ints
# -Wtype-limits - catches overflow bugs, few false positives
# -Wunreachable-code - catches some dead code
# -Wwrite-strings - catches treating string literals as non-const
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wc++11-compat"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wempty-body"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wignored-qualifiers"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Woverloaded-virtual"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wpointer-arith"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wsign-compare"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wtype-limits"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wunreachable-code"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wwrite-strings"
# -Wclass-varargs - catches objects passed by value to variadic functions.
# -Wimplicit-fallthrough - catches unintentional switch case fallthroughs
# -Wloop-analysis - catches issues around loops
# -Wnon-literal-null-conversion - catches expressions used as a null pointer constant
# -Wstring-conversion - catches string literals used in boolean expressions
# -Wthread-safety - catches inconsistent use of mutexes
#
# XXX: at the time of writing, the version of clang used on the OS X test
# machines has a bug that causes it to reject some valid files if both
# -Wnon-literal-null-conversion and -Wsometimes-uninitialized are
# specified. We work around this by instead using
# -Werror=non-literal-null-conversion, but we only do that when
# --enable-warnings-as-errors is specified so that no unexpected fatal
# warnings are produced.
MOZ_CXX_SUPPORTS_WARNING(-W, c++11-compat-pedantic, ac_cxx_has_wcxx11_compat_pedantic)
MOZ_CXX_SUPPORTS_WARNING(-W, c++14-compat, ac_cxx_has_wcxx14_compat)
MOZ_CXX_SUPPORTS_WARNING(-W, c++14-compat-pedantic, ac_cxx_has_wcxx14_compat_pedantic)
MOZ_CXX_SUPPORTS_WARNING(-W, c++1z-compat, ac_cxx_has_wcxx1z_compat)
MOZ_CXX_SUPPORTS_WARNING(-W, class-varargs, ac_cxx_has_wclass_varargs)
MOZ_CXX_SUPPORTS_WARNING(-W, implicit-fallthrough, ac_cxx_has_wimplicit_fallthrough)
MOZ_CXX_SUPPORTS_WARNING(-W, loop-analysis, ac_cxx_has_wloop_analysis)
if test "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
MOZ_CXX_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_cxx_has_non_literal_null_conversion)
fi
MOZ_CXX_SUPPORTS_WARNING(-W, string-conversion, ac_cxx_has_wstring_conversion)
MOZ_CXX_SUPPORTS_WARNING(-W, thread-safety, ac_cxx_has_wthread_safety)
# Turn off some non-useful warnings that -Wall turns on.
# -Wno-invalid-offsetof - we use offsetof on non-POD types frequently
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof"
# -Wno-inline-new-delete - we inline 'new' and 'delete' in mozalloc
MOZ_CXX_SUPPORTS_WARNING(-Wno-, inline-new-delete, ac_cxx_has_wno_inline_new_delete)
# Prevent the following GCC warnings from being treated as errors:
# -Wmaybe-uninitialized - too many false positives
# -Wdeprecated-declarations - we don't want our builds held hostage when a
# platform-specific API becomes deprecated.
# -Wfree-nonheap-object - false positives during PGO
# -Warray-bounds - false positives depending on optimization
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_cxx_has_noerror_maybe_uninitialized)
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_cxx_has_noerror_deprecated_declarations)
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=array-bounds, ac_cxx_has_noerror_array_bounds)
if test -n "$MOZ_PGO"; then
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=coverage-mismatch, ac_cxx_has_noerror_coverage_mismatch)
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=free-nonheap-object, ac_cxx_has_noerror_free_nonheap_object)
fi
])

Просмотреть файл

@ -75,3 +75,81 @@ def check_headers(*headers, **kwargs):
for header in headers:
checks.append(check_header(header, **kwargs))
return checks
@depends(c_compiler)
def warnings_cflags(c_compiler):
return []
@depends(cxx_compiler)
def warnings_cxxflags(cxx_compiler):
return []
# Tests whether GCC or clang support the given warning flag, and if it is,
# add it to the list of warning flags for the build.
# - `warning` is the warning flag (e.g. -Wfoo)
# - `compiler` (optional) is the compiler to test against (c_compiler or
# cxx_compiler, from toolchain.configure). When omitted, both compilers
# are tested.
# - `when` (optional) is a @depends function or option name conditioning
# when the warning flag is wanted.
# - `check`, when not set, skips checking whether the flag is supported and
# adds it to the list of warning flags unconditionally. This is only meant
# for add_gcc_warning().
@template
def check_and_add_gcc_warning(warning, compiler=None, when=None, check=True):
if compiler:
compilers = (compiler,)
else:
compilers = (c_compiler, cxx_compiler)
if not when:
when = depends('--help')(lambda _: True)
for c in compilers:
assert c in (c_compiler, cxx_compiler)
lang, warnings_flags = {
c_compiler: ('C', warnings_cflags),
cxx_compiler: ('C++', warnings_cxxflags),
}[c]
# GCC and clang will fail if given an unknown warning option like
# -Wfoobar. But later versions won't fail if given an unknown negated
# warning option like -Wno-foobar. So when we are checking for support
# of a negated warning option, we actually test the positive form, but
# add the negated form to the flags variable.
if (warning.startswith('-Wno-') and
not warning.startswith('-Wno-error=')):
flags = ['-Werror', '-W' + warning[5:]]
elif warning.startswith('-Werror='):
flags = [warning]
else:
flags = ['-Werror', warning]
@depends(c, when)
def result(c, when):
if when and c.type in ('clang', 'gcc'):
return True
if check:
result = c.try_compile(
flags=flags, when=result,
check_msg='whether the %s compiler supports %s' % (lang,
warning))
@depends(result, warnings_flags)
def maybe_add_flag(result, warnings_flags):
if result is not None:
warnings_flags.append(warning)
# Add the given warning to the list of warning flags for the build.
# - `warning` is the warning flag (e.g. -Wfoo)
# - `compiler` (optional) is the compiler to add the flag for (c_compiler or
# cxx_compiler, from toolchain.configure). When omitted, the warning flag
# is added for both compilers.
# - `when` (optional) is a @depends function or option name conditioning
# when the warning flag is wanted.
@template
def add_gcc_warning(warning, compiler=None, when=None):
check_and_add_gcc_warning(warning, compiler, when, check=False)

Просмотреть файл

@ -22,7 +22,7 @@ def compiler_class(compiler):
# - `check_msg` is the message to be printed to accompany compiling the
# test program.
def try_compile(self, includes=None, body='', flags=None,
check_msg=None, onerror=lambda: None):
check_msg=None, when=None, onerror=lambda: None):
includes = includes or []
source_lines = ['#include <%s>' % f for f in includes]
source = '\n'.join(source_lines) + '\n'
@ -48,7 +48,7 @@ def compiler_class(compiler):
if flags:
return flags[:]
@depends(self, extra_toolchain_flags)
@depends_when(self, extra_toolchain_flags, when=when)
@checking_fn
def func(compiler, extra_flags):
flags = get_flags() or []

Просмотреть файл

@ -71,6 +71,10 @@ set_config('MOZ_BUILD_ROOT', delayed_getattr(check_build_environment,
set_config('DIST', delayed_getattr(check_build_environment, 'dist'))
option(env='MOZ_AUTOMATION', help='Enable options for automated builds')
set_config('MOZ_AUTOMATION', depends_if('MOZ_AUTOMATION')(lambda x: True))
option(env='OLD_CONFIGURE', nargs=1, help='Path to the old configure script')
option(env='MOZ_CURRENT_PROJECT', nargs=1, help='Current build project')

Просмотреть файл

@ -256,7 +256,6 @@ def old_configure_options(*options):
'--enable-url-classifier',
'--enable-valgrind',
'--enable-verify-mar',
'--enable-warnings-as-errors',
'--enable-webapp-runtime',
'--enable-webrtc',
'--enable-websms-backend',

Просмотреть файл

@ -32,12 +32,16 @@ def rustc_info(rustc):
@depends_if(cargo)
@checking('cargo support for --frozen')
@imports('subprocess')
@imports('os')
def cargo_supports_frozen(cargo):
try:
lines = subprocess.check_output(
[cargo, 'help', 'build']
).splitlines()
return any(' --frozen' in l for l in lines)
supported = any(' --frozen' in l for l in lines)
if 'MOZ_AUTOMATION' in os.environ and not supported:
die('cargo in automation must support --frozen')
return supported
except subprocess.CalledProcessError as e:
die('Failed to call cargo: %s', e.message)
@ -54,7 +58,7 @@ def rust_compiler(value, rustc, rustc_info):
See https//www.rust-lang.org/ for more information.
'''))
version = rustc_info.version
min_version = Version('1.5')
min_version = Version('1.10')
if version < min_version:
die(dedent('''\
Rust compiler {} is too old.

Просмотреть файл

@ -4,6 +4,13 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# PGO
# ==============================================================
option(env='MOZ_PGO', help='Build with profile guided optimizations')
set_config('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
add_old_configure_assignment('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
# yasm detection
# ==============================================================
yasm = check_prog('YASM', ['yasm'], allow_missing=True)
@ -757,7 +764,7 @@ host_cxx_compiler = compiler('C++', host, c_compiler=host_c_compiler,
other_compiler=cxx_compiler,
other_c_compiler=c_compiler)
include('compilechecks.configure')
include('compile-checks.configure')
@depends(c_compiler)
def default_debug_flags(compiler_info):

Просмотреть файл

@ -349,6 +349,9 @@ def depends_when(*args, **kwargs):
if not len(kwargs) == 1 and kwargs.get('when'):
die('depends_when requires a single keyword argument, "when"')
when = kwargs['when']
if not when:
return depends(*args)
def decorator(fn):
@depends(when, *args)
def wrapper(val, *args):

Просмотреть файл

@ -0,0 +1,111 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
js_option('--enable-warnings-as-errors', env='MOZ_ENABLE_WARNINGS_AS_ERRORS',
default=depends('MOZ_AUTOMATION', '--help')(lambda x, _: bool(x)),
help='Enable treating warnings as errors')
add_old_configure_assignment(
'MOZ_ENABLE_WARNINGS_AS_ERRORS',
depends('--enable-warnings-as-errors')(lambda x: bool(x)))
# GCC/Clang warnings:
# https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Warning-Options.html
# lots of useful warnings
add_gcc_warning('-Wall')
# catches C++ version forward-compat issues
add_gcc_warning('-Wc++11-compat', cxx_compiler)
# catches bugs, e.g. "if (c); foo();", few false positives
add_gcc_warning('-Wempty-body')
# catches return types with qualifiers like const
add_gcc_warning('-Wignored-qualifiers')
# function declaration hides virtual function from base class
add_gcc_warning('-Woverloaded-virtual', cxx_compiler)
# catches pointer arithmetic using NULL or sizeof(void)
add_gcc_warning('-Wpointer-arith')
# catches comparing signed/unsigned ints
add_gcc_warning('-Wsign-compare')
# catches overflow bugs, few false positives
add_gcc_warning('-Wtype-limits')
# catches some dead code
add_gcc_warning('-Wunreachable-code')
# catches treating string literals as non-const
add_gcc_warning('-Wwrite-strings', cxx_compiler)
# turned on by -Wall, but we use offsetof on non-POD types frequently
add_gcc_warning('-Wno-invalid-offsetof', cxx_compiler)
# catches objects passed by value to variadic functions.
check_and_add_gcc_warning('-Wclass-varargs')
# catches issues around loops
check_and_add_gcc_warning('-Wloop-analysis')
# catches C++ version forward-compat issues
check_and_add_gcc_warning('-Wc++11-compat-pedantic', cxx_compiler)
check_and_add_gcc_warning('-Wc++14-compat', cxx_compiler)
check_and_add_gcc_warning('-Wc++14-compat-pedantic', cxx_compiler)
check_and_add_gcc_warning('-Wc++1z-compat', cxx_compiler)
# catches unintentional switch case fallthroughs
check_and_add_gcc_warning('-Wimplicit-fallthrough', cxx_compiler)
# catches expressions used as a null pointer constant
# XXX: at the time of writing, the version of clang used on the OS X test
# machines has a bug that causes it to reject some valid files if both
# -Wnon-literal-null-conversion and -Wsometimes-uninitialized are
# specified. We work around this by instead using
# -Werror=non-literal-null-conversion, but we only do that when
# --enable-warnings-as-errors is specified so that no unexpected fatal
# warnings are produced.
check_and_add_gcc_warning('-Werror=non-literal-null-conversion',
when='--enable-warnings-as-errors')
# catches string literals used in boolean expressions
check_and_add_gcc_warning('-Wstring-conversion')
# catches inconsistent use of mutexes
check_and_add_gcc_warning('-Wthread-safety')
# we inline 'new' and 'delete' in mozalloc
check_and_add_gcc_warning('-Wno-inline-new-delete', cxx_compiler)
# Prevent the following GCC warnings from being treated as errors:
# too many false positives
check_and_add_gcc_warning('-Wno-error=maybe-uninitialized')
# we don't want our builds held hostage when a platform-specific API
# becomes deprecated.
check_and_add_gcc_warning('-Wno-error=deprecated-declarations')
# false positives depending on optimization
check_and_add_gcc_warning('-Wno-error=array-bounds')
# can't get rid of those PGO warnings
check_and_add_gcc_warning('-Wno-error=coverage-mismatch', when='MOZ_PGO')
# false positives during PGO
check_and_add_gcc_warning('-Wno-error=free-nonheap-object', when='MOZ_PGO')
# We use mix of both POSIX and Win32 printf format across the tree, so format
# warnings are useless on mingw.
check_and_add_gcc_warning('-Wno-format',
when=depends(target)(lambda t: t.kernel == 'WINNT'))
# Please keep these last in this file
add_old_configure_assignment('_WARNINGS_CFLAGS', warnings_cflags)
add_old_configure_assignment('_WARNINGS_CXXFLAGS', warnings_cxxflags)

Просмотреть файл

@ -136,7 +136,6 @@ PYTHON_PATH = $(PYTHON) $(topsrcdir)/config/pythonpath.py
_DEBUG_ASFLAGS :=
_DEBUG_CFLAGS :=
_DEBUG_LDFLAGS :=
_DEBUG_RUSTFLAGS :=
ifneq (,$(MOZ_DEBUG)$(MOZ_DEBUG_SYMBOLS))
ifeq ($(AS),$(YASM))
@ -152,14 +151,12 @@ ifneq (,$(MOZ_DEBUG)$(MOZ_DEBUG_SYMBOLS))
endif
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
_DEBUG_RUSTFLAGS += -g
endif
ASFLAGS += $(_DEBUG_ASFLAGS)
OS_CFLAGS += $(_DEBUG_CFLAGS)
OS_CXXFLAGS += $(_DEBUG_CFLAGS)
OS_LDFLAGS += $(_DEBUG_LDFLAGS)
RUSTFLAGS += $(_DEBUG_RUSTFLAGS)
# XXX: What does this? Bug 482434 filed for better explanation.
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
@ -289,7 +286,6 @@ CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
endif # MOZ_OPTIMIZE == 1
LDFLAGS += $(MOZ_OPTIMIZE_LDFLAGS)
RUSTFLAGS += $(MOZ_OPTIMIZE_RUSTFLAGS)
endif # MOZ_OPTIMIZE
HOST_CFLAGS += $(_DEPEND_CFLAGS)

Просмотреть файл

@ -8,7 +8,6 @@
#include "nsNetUtil.h"
#include "nsAboutProtocolUtils.h"
#include "mozilla/ArrayUtils.h"
#include "nsDOMString.h"
#include "nsIProtocolHandler.h"
NS_IMPL_ISUPPORTS(nsAboutRedirector, nsIAboutModule)
@ -217,13 +216,6 @@ nsAboutRedirector::GetURIFlags(nsIURI* aURI, uint32_t* aResult)
return NS_ERROR_ILLEGAL_VALUE;
}
NS_IMETHODIMP
nsAboutRedirector::GetIndexedDBOriginPostfix(nsIURI* aURI, nsAString& aResult)
{
SetDOMStringToNull(aResult);
return NS_ERROR_NOT_IMPLEMENTED;
}
nsresult
nsAboutRedirector::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult)
{

Просмотреть файл

@ -9605,7 +9605,7 @@ public:
}
NS_IMETHOD
Run()
Run() override
{
return mDocShell->InternalLoad(mURI, mOriginalURI,
mLoadReplace,
@ -13684,7 +13684,7 @@ public:
nsIInputStream* aHeadersDataStream,
bool aIsTrusted);
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsAutoPopupStatePusher popupStatePusher(mPopupState);

Просмотреть файл

@ -257,7 +257,7 @@ public:
{
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
if (mViewer) {
mViewer->Destroy();

Просмотреть файл

@ -112,7 +112,7 @@ public:
, mReason(aReason)
{}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();

Просмотреть файл

@ -321,8 +321,8 @@ public:
return NS_OK;
}
NS_IMETHODIMP
Run()
NS_IMETHOD
Run() override
{
mReq->FireSuccess(JS::Handle<JS::Value>::fromMarkedLocation(mResult.address()));
return NS_OK;
@ -343,8 +343,8 @@ public:
{
}
NS_IMETHODIMP
Run()
NS_IMETHOD
Run() override
{
mReq->FireError(mError);
return NS_OK;

Просмотреть файл

@ -1276,7 +1276,7 @@ public:
}
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsAutoScriptBlocker scriptBlocker;
uint32_t len = mSubtreeRoots.Length();

Просмотреть файл

@ -33,7 +33,7 @@ public:
// It retrieves a SourceSurface reference and convert color format on main
// thread and passes DataSourceSurface to caller thread.
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
// It guarantees the reference will be released on main thread.
nsCountedRef<nsMainThreadSourceSurfaceRef> surface;
surface.own(mImage->GetAsSourceSurface().take());

Просмотреть файл

@ -389,7 +389,7 @@ public:
MOZ_ASSERT(mNode);
}
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
return nsContentUtils::DispatchTrustedEvent(mNode->OwnerDoc(),
mNode,
mSuccess ? NS_LITERAL_STRING("load")

Просмотреть файл

@ -271,7 +271,7 @@ public:
aWebSocketImpl->AssertIsOnTargetThread();
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
mWebSocketImpl->AssertIsOnTargetThread();
mWebSocketImpl->DispatchConnectionCloseEvents();

Просмотреть файл

@ -4858,7 +4858,7 @@ public:
mParent = mContent->GetParent();
mDoc = mContent->OwnerDoc();
}
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
mContent->UnbindFromTree();
return NS_OK;
}

Просмотреть файл

@ -860,7 +860,7 @@ nsDOMMutationObserver::HandleMutation()
class AsyncMutationHandler : public mozilla::Runnable
{
public:
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsDOMMutationObserver::HandleMutations();
return NS_OK;

Просмотреть файл

@ -1360,7 +1360,7 @@ protected:
}
public:
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
return NS_OK;
}
@ -9105,7 +9105,7 @@ nsDocument::UnblockOnload(bool aFireSync)
class nsUnblockOnloadEvent : public Runnable {
public:
explicit nsUnblockOnloadEvent(nsDocument* aDoc) : mDoc(aDoc) {}
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
mDoc->DoUnblockOnload();
return NS_OK;
}
@ -9990,7 +9990,7 @@ public:
}
virtual ~nsDelayedEventDispatcher() {}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
FireOrClearDelayedEvents(mDocuments, true);
return NS_OK;
@ -11445,7 +11445,7 @@ public:
explicit nsCallRequestFullScreen(UniquePtr<FullscreenRequest>&& aRequest)
: mRequest(Move(aRequest)) { }
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
mRequest->GetDocument()->RequestFullScreen(Move(mRequest));
return NS_OK;

Просмотреть файл

@ -1995,7 +1995,7 @@ public:
{
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
InternalFocusEvent event(true, mEventMessage);
event.mFlags.mBubbles = false;
@ -3490,7 +3490,7 @@ public:
}
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
if (PointerUnlocker::sActiveUnlocker == this) {
PointerUnlocker::sActiveUnlocker = nullptr;

Просмотреть файл

@ -2741,7 +2741,7 @@ public:
{
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsInProcessTabChildGlobal* tabChild =
static_cast<nsInProcessTabChildGlobal*>(mFrameLoader->mChildMessageManager.get());

Просмотреть файл

@ -1917,7 +1917,7 @@ public:
nsAsyncMessageToSameProcessChild(JSContext* aCx, JS::Handle<JSObject*> aCpows)
: nsSameProcessAsyncMessageBase(aCx, aCpows)
{ }
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsFrameMessageManager* ppm = nsFrameMessageManager::GetChildProcessManager();
ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(ppm), nullptr, ppm);

Просмотреть файл

@ -320,7 +320,7 @@ private:
class MyAsyncMessage : public nsSameProcessAsyncMessageBase, public Runnable
{
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
ReceiveMessage(..., ...);
return NS_OK;
}

Просмотреть файл

@ -8481,7 +8481,7 @@ public:
return rv;
}
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
if (mWindow) {
if (mIndirect) {
return PostCloseEvent(mWindow, false);
@ -8789,11 +8789,11 @@ nsGlobalWindow::EnterModalState()
}
if (topWin->mModalStateDepth == 0) {
NS_ASSERTION(!mSuspendedDoc, "Shouldn't have mSuspendedDoc here!");
NS_ASSERTION(!topWin->mSuspendedDoc, "Shouldn't have mSuspendedDoc here!");
mSuspendedDoc = topDoc;
if (mSuspendedDoc) {
mSuspendedDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
topWin->mSuspendedDoc = topDoc;
if (topDoc) {
topDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
}
}
topWin->mModalStateDepth++;
@ -8851,7 +8851,7 @@ public:
NS_ASSERTION(mWindow, "mWindow is null.");
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsGlobalWindow::RunPendingTimeoutsRecursive(mWindow, mWindow);
@ -8881,11 +8881,11 @@ nsGlobalWindow::LeaveModalState()
if (NS_FAILED(NS_DispatchToCurrentThread(runner)))
NS_WARNING("failed to dispatch pending timeout runnable");
if (mSuspendedDoc) {
if (topWin->mSuspendedDoc) {
nsCOMPtr<nsIDocument> currentDoc = topWin->GetExtantDoc();
mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
currentDoc == mSuspendedDoc);
mSuspendedDoc = nullptr;
topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
currentDoc == topWin->mSuspendedDoc);
topWin->mSuspendedDoc = nullptr;
}
}
@ -8952,7 +8952,7 @@ public:
mWindow = do_GetWeakReference(aWindow);
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
@ -9378,7 +9378,7 @@ public:
const nsAString& aAction)
: mWindow(aWindow), mTabChild(aTabChild), mAction(aAction) {}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsCOMPtr<nsPIWindowRoot> root = mWindow->GetTopWindowRoot();
if (!root) {
@ -9407,7 +9407,7 @@ public:
const nsAString& aAction)
: mDispatcher(aDispatcher), mAction(aAction) {}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
return mDispatcher->UpdateCommands(mAction);
}
@ -10199,7 +10199,7 @@ public:
mNewURL.Assign(aNewURL);
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
NS_PRECONDITION(NS_IsMainThread(), "Should be called on the main thread.");
return mWindow->FireHashchange(mOldURL, mNewURL);
@ -10804,7 +10804,7 @@ public:
mCallOnidle(aCallOnidle)
{ }
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
if (mIdleWindow->ContainsIdleObserver(mIdleObserver, mTimeInS)) {
return mCallOnidle ? mIdleObserver->Onidle() : mIdleObserver->Onactive();

Просмотреть файл

@ -311,7 +311,7 @@ public:
bool aRunInGlobalScope)
: mTabChild(aTabChild), mURL(aURL), mRunInGlobalScope(aRunInGlobalScope) {}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
mTabChild->LoadFrameScript(mURL, mRunInGlobalScope);
return NS_OK;

Просмотреть файл

@ -430,7 +430,7 @@ public:
, mError(aRuntime, aError)
{}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsEventStatus status = nsEventStatus_eIgnore;
nsPIDOMWindowInner* win = mWindow;

Просмотреть файл

@ -66,6 +66,8 @@ bool nsNameSpaceManager::Init()
// Need to be ordered according to ID.
MOZ_ASSERT(mURIArray.IsEmpty());
REGISTER_NAMESPACE(nsGkAtoms::empty, kNameSpaceID_None);
REGISTER_NAMESPACE(nsGkAtoms::nsuri_xmlns, kNameSpaceID_XMLNS);
REGISTER_NAMESPACE(nsGkAtoms::nsuri_xml, kNameSpaceID_XML);
REGISTER_NAMESPACE(nsGkAtoms::nsuri_xhtml, kNameSpaceID_XHTML);
@ -97,7 +99,7 @@ nsNameSpaceManager::RegisterNameSpace(const nsAString& aURI,
nsCOMPtr<nsIAtom> atom = NS_Atomize(aURI);
nsresult rv = NS_OK;
if (!mURIToIDTable.Get(atom, &aNameSpaceID)) {
aNameSpaceID = mURIArray.Length() + 1; // id is index + 1
aNameSpaceID = mURIArray.Length();
rv = AddNameSpace(atom.forget(), aNameSpaceID);
if (NS_FAILED(rv)) {
@ -114,15 +116,16 @@ nsresult
nsNameSpaceManager::GetNameSpaceURI(int32_t aNameSpaceID, nsAString& aURI)
{
NS_PRECONDITION(aNameSpaceID >= 0, "Bogus namespace ID");
int32_t index = aNameSpaceID - 1; // id is index + 1
if (index < 0 || index >= int32_t(mURIArray.Length())) {
// We have historically treated GetNameSpaceURI calls for kNameSpaceID_None
// as erroneous.
if (aNameSpaceID <= 0 || aNameSpaceID >= int32_t(mURIArray.Length())) {
aURI.Truncate();
return NS_ERROR_ILLEGAL_VALUE;
}
mURIArray.ElementAt(index)->ToString(aURI);
mURIArray.ElementAt(aNameSpaceID)->ToString(aURI);
return NS_OK;
}
@ -224,10 +227,8 @@ nsresult nsNameSpaceManager::AddNameSpace(already_AddRefed<nsIAtom> aURI,
// We've wrapped... Can't do anything else here; just bail.
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ASSERTION(aNameSpaceID - 1 == (int32_t) mURIArray.Length(),
"BAD! AddNameSpace not called in right order!");
MOZ_ASSERT(aNameSpaceID == (int32_t) mURIArray.Length());
mURIArray.AppendElement(uri.forget());
mURIToIDTable.Put(mURIArray.LastElement(), aNameSpaceID);
@ -244,9 +245,7 @@ nsNameSpaceManager::AddDisabledNameSpace(already_AddRefed<nsIAtom> aURI,
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ASSERTION(aNameSpaceID - 1 == (int32_t) mURIArray.Length(),
"BAD! AddDisabledNameSpace not called in right order!");
MOZ_ASSERT(aNameSpaceID == (int32_t) mURIArray.Length());
mURIArray.AppendElement(uri.forget());
mDisabledURIToIDTable.Put(mURIArray.LastElement(), aNameSpaceID);

Просмотреть файл

@ -42,9 +42,19 @@ public:
virtual nsresult GetNameSpaceURI(int32_t aNameSpaceID, nsAString& aURI);
// Returns the atom for the namespace URI associated with the given ID. The
// ID must be within range and not be kNameSpaceID_None (i.e. zero);
nsIAtom* NameSpaceURIAtom(int32_t aNameSpaceID) {
MOZ_ASSERT(aNameSpaceID > 0 && (int64_t) aNameSpaceID <= (int64_t) mURIArray.Length());
return mURIArray.ElementAt(aNameSpaceID - 1); // id is index + 1
MOZ_ASSERT(aNameSpaceID > 0);
return NameSpaceURIAtomForServo(aNameSpaceID);
}
// NB: This function should only be called by Servo code (and the above
// accessor), which uses the empty atom to represent kNameSpaceID_None.
nsIAtom* NameSpaceURIAtomForServo(int32_t aNameSpaceID) {
MOZ_ASSERT(aNameSpaceID >= 0);
MOZ_ASSERT((int64_t) aNameSpaceID < (int64_t) mURIArray.Length());
return mURIArray.ElementAt(aNameSpaceID);
}
int32_t GetNameSpaceID(const nsAString& aURI,

Просмотреть файл

@ -1196,7 +1196,7 @@ public:
: mLoader(aLoader)
, mRequest(aRequest)
{}
NS_IMETHODIMP Run()
NS_IMETHOD Run() override
{
return mLoader->ProcessRequest(mRequest);
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше