Skip to content

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Nov 17, 2015
2 parents 6f7666a + 6edbd4d commit 1cf9b8b
Show file tree
Hide file tree
Showing 263 changed files with 4,485 additions and 1,486 deletions.
74 changes: 29 additions & 45 deletions accessible/xpcom/AccEventGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@
# 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/.

import sys, os, xpidl
import sys
import os

from mozbuild.makeutil import write_dep_makefile
from mozbuild.util import FileAvoidWrite
import buildconfig
import mozpack.path as mozpath

# The xpidl parser is not incorporated in the in-tree virtualenv.
xpidl_dir = mozpath.join(buildconfig.topsrcdir, 'xpcom', 'idl-parser',
'xpidl')
sys.path.append(xpidl_dir)
import xpidl

# Instantiate the parser.
p = xpidl.IDLParser()

def findIDL(includePath, interfaceFileName):
for d in includePath:
# Not os.path.join: we need a forward slash even on Windows because
# this filename ends up in makedepend output.
path = d + '/' + interfaceFileName
path = mozpath.join(d, interfaceFileName)
if os.path.exists(path):
return path
raise BaseException("No IDL file found for interface %s "
Expand All @@ -33,16 +41,13 @@ def __init__(self, filename):
execfile(filename, config)
self.simple_events = config.get('simple_events', [])

def readConfigFile(filename):
return Configuration(filename)

def firstCap(str):
return str[0].upper() + str[1:]

def writeAttributeParams(a):
return ("%s a%s" % (a.realtype.nativeType('in'), firstCap(a.name)))

def print_header_file(fd, conf):
def print_header_file(fd, conf, incdirs):
idl_paths = set()

fd.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n")
Expand All @@ -55,7 +60,7 @@ def print_header_file(fd, conf):
for e in conf.simple_events:
fd.write("#include \"nsIAccessible%s.h\"\n" % e)
for e in conf.simple_events:
idl, idl_path = loadEventIDL(p, options.incdirs, e)
idl, idl_path = loadEventIDL(p, incdirs, e)
idl_paths.add(idl_path)
for iface in filter(lambda p: p.kind == "interface", idl.productions):
classname = ("xpcAcc%s" % e)
Expand Down Expand Up @@ -103,7 +108,7 @@ def print_cpp(idl, fd, conf, eventname):
if p.kind == 'interface':
write_cpp(eventname, p, fd)

def print_cpp_file(fd, conf):
def print_cpp_file(fd, conf, incdirs):
idl_paths = set()
fd.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n")
fd.write('#include "xpcAccEvents.h"\n')
Expand All @@ -115,7 +120,7 @@ def print_cpp_file(fd, conf):

types = []
for e in conf.simple_events:
idl, idl_path = loadEventIDL(p, options.incdirs, e)
idl, idl_path = loadEventIDL(p, incdirs, e)
idl_paths.add(idl_path)
types.extend(interfaceAttributeTypes(idl))

Expand All @@ -124,7 +129,7 @@ def print_cpp_file(fd, conf):

fd.write("\n")
for e in conf.simple_events:
idl, idl_path = loadEventIDL(p, options.incdirs, e)
idl, idl_path = loadEventIDL(p, incdirs, e)
idl_paths.add(idl_path)
print_cpp(idl, fd, conf, e)

Expand Down Expand Up @@ -204,35 +209,14 @@ def write_cpp(eventname, iface, fd):
for a in attributes:
writeAttributeGetter(fd, classname, a)

def gen_header_file(fd, conf_file):
conf = Configuration(conf_file)
inc_dir = mozpath.join(buildconfig.topobjdir, 'dist', 'idl')

return print_header_file(fd, conf, [inc_dir])

def gen_cpp_file(fd, conf_file):
conf = Configuration(conf_file)
inc_dir = mozpath.join(buildconfig.topobjdir, 'dist', 'idl')

def main():
from argparse import ArgumentParser
o = ArgumentParser()
o.add_argument('-I', action='append', dest='incdirs', default=['.'],
help="Directory to search for imported files")
o.add_argument('config',
help='Config file to load')
o.add_argument('header_output', metavar='FILE',
help="Quick stub header output file")
o.add_argument('stub_output', metavar='FILE',
help="C++ source output file")
o.add_argument('makedepend_output', metavar='FILE',
help="gnumake dependencies output file")
global options
options = o.parse_args()

# Instantiate the parser.
global p
p = xpidl.IDLParser()

conf = readConfigFile(options.config)

with FileAvoidWrite(options.header_output) as fh:
idl_paths = print_header_file(fh, conf)
with FileAvoidWrite(options.stub_output) as fh:
idl_paths |= print_cpp_file(fh, conf)
with FileAvoidWrite(options.makedepend_output) as fh:
write_dep_makefile(fh, options.stub_output, idl_paths)

if __name__ == '__main__':
main()
return print_cpp_file(fd, conf, [inc_dir])
26 changes: 2 additions & 24 deletions accessible/xpcom/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,9 @@
# 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/.

EXTRA_MDDEPEND_FILES = xpcAccEvents.pp

# We'd like this to be defined in a future GENERATED_EXPORTS list.
# Bug 1160185 has a few proposals for this.
INSTALL_TARGETS += xpcaccevents
xpcaccevents_FILES := xpcAccEvents.h
xpcaccevents_DEST = $(DIST)/include
xpcaccevents_TARGET := export

include $(topsrcdir)/config/rules.mk

xpcAccEvents.cpp: $(srcdir)/AccEvents.conf \
$(srcdir)/AccEventGen.py \
$(LIBXUL_DIST)/sdk/bin/header.py \
$(LIBXUL_DIST)/sdk/bin/xpidl.py
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
-I$(LIBXUL_DIST)/sdk/bin \
$(srcdir)/AccEventGen.py \
-I $(DEPTH)/dist/idl \
$(srcdir)/AccEvents.conf \
xpcAccEvents.h \
xpcAccEvents.cpp \
$(MDDEPDIR)/xpcAccEvents.pp

xpcAccEvents.h: xpcAccEvents.cpp

GARBAGE += \
xpcAccEvents.cpp \
xpcAccEvents.h \
$(null)
13 changes: 13 additions & 0 deletions accessible/xpcom/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,17 @@ else:
'/accessible/other',
]

GENERATED_FILES += [
'xpcAccEvents.cpp',
'xpcAccEvents.h',
]

xpc_acc_events_h = GENERATED_FILES['xpcAccEvents.h']
xpc_acc_events_h.script = 'AccEventGen.py:gen_header_file'
xpc_acc_events_h.inputs += ['AccEvents.conf']

xpc_acc_events_cpp = GENERATED_FILES['xpcAccEvents.cpp']
xpc_acc_events_cpp.script = 'AccEventGen.py:gen_cpp_file'
xpc_acc_events_cpp.inputs += ['AccEvents.conf']

FINAL_LIBRARY = 'xul'
6 changes: 1 addition & 5 deletions b2g/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ include $(topsrcdir)/config/rules.mk

APP_ICON = app

ifeq ($(OS_ARCH),WINNT)
REDIT_PATH = $(LIBXUL_DIST)/bin
endif

APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX)

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
Expand Down Expand Up @@ -65,7 +61,7 @@ libs::
# Copy the app icon for b2g-desktop
ifeq ($(OS_ARCH),WINNT)
cp $(DIST)/branding/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/$(APP_ICON).ico
$(REDIT_PATH)/redit$(HOST_BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY) $(DIST)/branding/$(APP_ICON).ico
$(DIST)/bin/redit$(HOST_BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY) $(DIST)/branding/$(APP_ICON).ico
cp $(DIST)/branding/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/default.ico
else ifneq (gonk,$(MOZ_WIDGET_TOOLKIT))
cp $(DIST)/branding/default.png $(DIST)/bin/chrome/icons/default/default.png
Expand Down
17 changes: 7 additions & 10 deletions browser/base/content/nsContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1344,15 +1344,12 @@ nsContextMenu.prototype = {
// * this.principal - as the loadingPrincipal
// for now lets use systemPrincipal to bypass mixedContentBlocker
// checks after redirects, see bug: 1136055
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var principal = Services.scriptSecurityManager.getSystemPrincipal();
var channel = ioService.newChannelFromURI2(makeURI(linkURL),
null, // aLoadingNode
principal, // aLoadingPrincipal
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
var channel = NetUtil.newChannel({
uri: makeURI(linkURL),
loadUsingSystemPrincipal: true,
securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
});

if (linkDownload)
channel.contentDispositionFilename = linkDownload;
if (channel instanceof Ci.nsIPrivateBrowsingChannel) {
Expand Down Expand Up @@ -1385,7 +1382,7 @@ nsContextMenu.prototype = {
timer.TYPE_ONE_SHOT);

// kick off the channel with our proxy object as the listener
channel.asyncOpen(new saveAsListener(), null);
channel.asyncOpen2(new saveAsListener());
},

// Save URL of clicked-on link.
Expand Down
39 changes: 21 additions & 18 deletions browser/base/content/test/general/browser_parsable_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,32 @@
* failure. */
const kWhitelist = [
// CodeMirror is imported as-is, see bug 1004423.
{sourceName: /codemirror\.css/i},
{sourceName: /codemirror\.css$/i},
// PDFjs is futureproofing its pseudoselectors, and those rules are dropped.
{sourceName: /web\/viewer\.css/i,
{sourceName: /web\/viewer\.css$/i,
errorMessage: /Unknown pseudo-class.*(fullscreen|selection)/i},
// Tracked in bug 1004428.
{sourceName: /aboutaccounts\/(main|normalize)\.css/i},
{sourceName: /aboutaccounts\/(main|normalize)\.css$/i},
// TokBox SDK assets, see bug 1032469.
{sourceName: /loop\/.*sdk-content\/.*\.css$/i},
// Loop standalone client CSS uses placeholder cross browser pseudo-element
{sourceName: /loop\/.*\.css/i,
{sourceName: /loop\/.*\.css$/i,
errorMessage: /Unknown pseudo-class.*placeholder/i},
{sourceName: /loop\/.*shared\/css\/common.css/i,
{sourceName: /loop\/.*shared\/css\/common.css$/i,
errorMessage: /Unknown property 'user-select'/i},
// Highlighter CSS uses chrome-only pseudo-class, see bug 985597.
{sourceName: /highlighters\.css/i,
// Highlighter CSS uses a UA-only pseudo-class, see bug 985597.
{sourceName: /highlighters\.css$/i,
errorMessage: /Unknown pseudo-class.*moz-native-anonymous/i},
];

var moduleLocation = gTestPath.replace(/\/[^\/]*$/i, "/parsingTestHelpers.jsm");
var {generateURIsFromDirTree} = Cu.import(moduleLocation, {});

// Add suffix to stylesheets' URI so that we always load them here and
// have them parsed. Add a random number so that even if we run this
// test multiple times, it would be unlikely to affect each other.
const kPathSuffix = "?always-parse-css-" + Math.random();

/**
* Check if an error should be ignored due to matching one of the whitelist
* objects defined in kWhitelist
Expand Down Expand Up @@ -135,17 +140,19 @@ function convertToChromeUri(fileUri) {
}
}

function messageIsCSSError(msg, innerWindowID, outerWindowID) {
function messageIsCSSError(msg) {
// Only care about CSS errors generated by our iframe:
if ((msg instanceof Ci.nsIScriptError) &&
msg.category.includes("CSS") &&
msg.innerWindowID === innerWindowID && msg.outerWindowID === outerWindowID) {
msg.sourceName.endsWith(kPathSuffix)) {
let sourceName = msg.sourceName.slice(0, -kPathSuffix.length);
let msgInfo = { sourceName, errorMessage: msg.errorMessage };
// Check if this error is whitelisted in kWhitelist
if (!ignoredError(msg)) {
ok(false, "Got error message for " + msg.sourceName + ": " + msg.errorMessage);
if (!ignoredError(msgInfo)) {
ok(false, `Got error message for ${sourceName}: ${msg.errorMessage}`);
return true;
}
info("Ignored error for " + msg.sourceName + " because of filter.");
info(`Ignored error for ${sourceName} because of filter.`);
}
return false;
}
Expand All @@ -167,10 +174,6 @@ add_task(function checkAllTheCSS() {
iframe.contentWindow.location = testFile;
yield iframeLoaded;
let doc = iframe.contentWindow.document;
let windowUtils = iframe.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let innerWindowID = windowUtils.currentInnerWindowID;
let outerWindowID = windowUtils.outerWindowID;

// Parse and remove all manifests from the list.
// NOTE that this must be done before filtering out devtools paths
Expand Down Expand Up @@ -214,7 +217,7 @@ add_task(function checkAllTheCSS() {
linkEl.addEventListener("error", onError);
linkEl.setAttribute("type", "text/css");
let chromeUri = convertToChromeUri(uri);
linkEl.setAttribute("href", chromeUri.spec);
linkEl.setAttribute("href", chromeUri.spec + kPathSuffix);
allPromises.push(promiseForThisSpec.promise);
doc.head.appendChild(linkEl);
}
Expand All @@ -225,7 +228,7 @@ add_task(function checkAllTheCSS() {
let messages = Services.console.getMessageArray();
// Count errors (the test output will list actual issues for us, as well
// as the ok(false) in messageIsCSSError.
let errors = messages.filter(m => messageIsCSSError(m, innerWindowID, outerWindowID));
let errors = messages.filter(messageIsCSSError);
is(errors.length, 0, "All the styles (" + allPromises.length + ") loaded without errors.");

// Clean up to avoid leaks:
Expand Down
2 changes: 1 addition & 1 deletion browser/components/search/content/search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
// Don't open the suggestions if the mouse was used to focus the
// textbox, that will be taken care of in the click handler.
if (Services.focus.getLastFocusMethod(window) == Services.focus.FLAG_BYMOUSE)
if (Services.focus.getLastFocusMethod(window) & Services.focus.FLAG_BYMOUSE)
return;
this.openSuggestionsPanel();
Expand Down
6 changes: 3 additions & 3 deletions build/autoconf/nspr-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ if test -n "$MOZ_NATIVE_NSPR" -o -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
CFLAGS=$_SAVE_CFLAGS
elif test -z "$JS_POSIX_NSPR"; then
NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
NSPR_CFLAGS="-I${DIST}/include/nspr"
if test -n "$GNU_CC"; then
NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
NSPR_LIBS="-L${DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
else
NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
NSPR_LIBS="${DIST}/lib/nspr${NSPR_VERSION}.lib ${DIST}/lib/plc${NSPR_VERSION}.lib ${DIST}/lib/plds${NSPR_VERSION}.lib "
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion build/automation-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _CERTS_SRC_DIR = $(ABSOLUTE_TOPSRCDIR)/build/pgo/certs

AUTOMATION_PPARGS = \
-DBROWSER_PATH=$(browser_path) \
-DXPC_BIN_PATH='"$(LIBXUL_DIST)/bin"' \
-DXPC_BIN_PATH='"$(DIST)/bin"' \
-DBIN_SUFFIX='"$(BIN_SUFFIX)"' \
-DPROFILE_DIR='"$(_PROFILE_DIR)"' \
-DCERTS_SRC_DIR='"$(_CERTS_SRC_DIR)"' \
Expand Down
5 changes: 1 addition & 4 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ endif

RM = rm -f

# LIBXUL_DIST is not defined under js/src, thus we make it mean DIST there.
LIBXUL_DIST ?= $(DIST)

# FINAL_TARGET specifies the location into which we copy end-user-shipped
# build products (typelibs, components, chrome). It may already be specified by
# a moz.build file.
Expand Down Expand Up @@ -581,7 +578,7 @@ EN_US_OR_L10N_FILE = $(firstword \
EN_US_OR_L10N_FILES = $(foreach f,$(1),$(call EN_US_OR_L10N_FILE,$(f)))

ifneq (WINNT,$(OS_ARCH))
RUN_TEST_PROGRAM = $(LIBXUL_DIST)/bin/run-mozilla.sh
RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
endif # ! WINNT

#
Expand Down
Loading

0 comments on commit 1cf9b8b

Please sign in to comment.