diff --git a/CLOBBER b/CLOBBER
index 6d43e4829a44..fd7f031b532a 100644
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,7 +17,7 @@
#
# Modifying this file will now automatically clobber the buildbot machines \o/
#
-Landing bug 865806
+Refactored build system core dependencies in bug 874078.
Alternative to clobber is to run ./config.status from the objdir and to
touch the CLOBBER file in the objdir.
diff --git a/Makefile.in b/Makefile.in
index ed8a4a142bac..f00b97fded01 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -38,6 +38,8 @@ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
$(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
ifndef MOZ_PROFILE_USE
+# We need to explicitly put backend.RecursiveMakeBackend.built here
+# otherwise the rule in rules.mk doesn't run early enough.
default alldep all:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
$(RM) -r $(DIST)/sdk
$(RM) -r $(DIST)/include
@@ -73,14 +75,6 @@ export::
$(MAKE) -C config export
$(MAKE) tier_nspr
-backend.RecursiveMakeBackend.built:
- @echo "Updating build backend because of moz.build changes."
- @$(PYTHON) ./config.status
-
-include backend.RecursiveMakeBackend.built.pp
-
-export MOZBUILD_BACKEND_CHECKED=1
-
ifdef ENABLE_TESTS
# Additional makefile targets to call automated test suites
include $(topsrcdir)/testing/testsuite-targets.mk
diff --git a/accessible/tests/mochitest/text.js b/accessible/tests/mochitest/text.js
index 52fea86a484a..0681b31221ac 100644
--- a/accessible/tests/mochitest/text.js
+++ b/accessible/tests/mochitest/text.js
@@ -11,45 +11,51 @@ const BOUNDARY_ATTRIBUTE_RANGE = nsIAccessibleText.BOUNDARY_ATTRIBUTE_RANGE;
const kTextEndOffset = nsIAccessibleText.TEXT_OFFSET_END_OF_TEXT;
const kCaretOffset = nsIAccessibleText.TEXT_OFFSET_CARET;
-const kTodo = 1;
-const kOk = 2;
+const kTodo = 1; // a test is expected to fail
+const kOk = 2; // a test doesn't fail
/**
* Test characterCount for the given array of accessibles.
*
- * @param aCount [in] the expected character count
- * @param aIDs [in] array of accessible identifiers to test
+ * @param aCount [in] the expected character count
+ * @param aIDs [in] array of accessible identifiers to test
+ * @param aTodoFlag [in, optional] either kOk or kTodo
*/
-function testCharacterCount(aIDs, aCount)
+function testCharacterCount(aIDs, aCount, aTodoFlag)
{
- for (var i = 0; i < aIDs.length; i++) {
- var textacc = getAccessible(aIDs[i], [nsIAccessibleText]);
- is(textacc.characterCount, aCount,
- "Wrong character count for " + prettyName(aIDs[i]));
+ var ids = (aIDs instanceof Array) ? aIDs : [ aIDs ];
+ var isFunc = (aTodoFlag == kTodo) ? todo_is : is;
+ for (var i = 0; i < ids.length; i++) {
+ var textacc = getAccessible(ids[i], [nsIAccessibleText]);
+ isFunc(textacc.characterCount, aCount,
+ "Wrong character count for " + prettyName(ids[i]));
}
}
/**
- * Test text between two given offsets
+ * Test text between two given offsets.
*
* @param aIDs [in] an array of accessible IDs to test
* @param aStartOffset [in] the start offset within the text to test
* @param aEndOffset [in] the end offset up to which the text is tested
* @param aText [in] the expected result from the test
+ * @param aTodoFlag [in, optional] either kOk or kTodo
*/
-function testText(aIDs, aStartOffset, aEndOffset, aText)
+function testText(aIDs, aStartOffset, aEndOffset, aText, aTodoFlag)
{
- for (var i = 0; i < aIDs.length; i++)
- {
- var acc = getAccessible(aIDs[i], nsIAccessibleText);
+ var ids = (aIDs instanceof Array) ? aIDs : [ aIDs ];
+ var isFunc = (aTodoFlag == kTodo) ? todo_is : is;
+ for (var i = 0; i < ids.length; i++) {
+ var acc = getAccessible(ids[i], nsIAccessibleText);
try {
- is(acc.getText(aStartOffset, aEndOffset), aText,
- "getText: wrong text between start and end offsets '" + aStartOffset +
- "', '" + aEndOffset + " for '" + prettyName(aIDs[i]) + "'");
+ isFunc(acc.getText(aStartOffset, aEndOffset), aText,
+ "getText: wrong text between start and end offsets '" +
+ aStartOffset + "', '" + aEndOffset + " for '" +
+ prettyName(ids[i]) + "'");
} catch (e) {
ok(false,
- "getText fails between start and end offsets '" + aStartOffset +
- "', '" + aEndOffset + " for '" + prettyName(aIDs[i]) + "'");
+ "getText fails between start and end offsets '" + aStartOffset +
+ "', '" + aEndOffset + " for '" + prettyName(ids[i]) + "'");
}
}
}
diff --git a/accessible/tests/mochitest/text/Makefile.in b/accessible/tests/mochitest/text/Makefile.in
index 9f9a6c84a185..a86e2c00ec3a 100644
--- a/accessible/tests/mochitest/text/Makefile.in
+++ b/accessible/tests/mochitest/text/Makefile.in
@@ -14,7 +14,9 @@ include $(DEPTH)/config/autoconf.mk
MOCHITEST_A11Y_FILES = \
doc.html \
test_atcaretoffset.html \
+ test_charboundary.html \
test_doc.html \
+ test_gettext.html \
test_hypertext.html \
test_label.xul \
test_multiline.html \
diff --git a/accessible/tests/mochitest/text/test_charboundary.html b/accessible/tests/mochitest/text/test_charboundary.html
new file mode 100644
index 000000000000..6e4a6f909a39
--- /dev/null
+++ b/accessible/tests/mochitest/text/test_charboundary.html
@@ -0,0 +1,153 @@
+
+
+
+ Char boundary text tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hello my friend
+ hello my friend
+
+
+
+
+ Brave Sir Robin ran
+ Brave Sir Robin ran
+
+
+
+
+ oneword
+
+two words
+
+ oneword two words
+ oneword
+
+two words
+
+ oneword two words
+
+
+
+
+
diff --git a/accessible/tests/mochitest/text/test_gettext.html b/accessible/tests/mochitest/text/test_gettext.html
new file mode 100644
index 000000000000..fcd5ddd33711
--- /dev/null
+++ b/accessible/tests/mochitest/text/test_gettext.html
@@ -0,0 +1,115 @@
+
+
+
+ Get text between offsets tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hello my friend
+ hello my friend
+
+
+
+ Brave Sir Robin ran
+ Brave Sir Robin ran
+
+ Brave Sir Robin ran
+ Brave Sir Robin ran
+
+
+ oneword
+
+two words
+
+ oneword two words
+ oneword
+
+two words
+
+ oneword two words
+
+
+
+
+
diff --git a/accessible/tests/mochitest/text/test_multiline.html b/accessible/tests/mochitest/text/test_multiline.html
index 802315060c08..10e7831c4cbf 100644
--- a/accessible/tests/mochitest/text/test_multiline.html
+++ b/accessible/tests/mochitest/text/test_multiline.html
@@ -32,31 +32,10 @@
// getText
var IDs = ["div", "divbr", "editable", "editablebr", "textarea"];
- testText(IDs, 0, 19, "oneword\n\ntwo words\n");
////////////////////////////////////////////////////////////////////////
// getTextAfterOffset
- // BOUNDARY_CHAR
- testTextAfterOffset(6, BOUNDARY_CHAR, "\n", 7, 8,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAfterOffset(7, BOUNDARY_CHAR, "\n", 8, 9,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAfterOffset(8, BOUNDARY_CHAR, "t", 9, 10,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
-
// BOUNDARY_WORD_START
testTextAfterOffset(0, BOUNDARY_WORD_START, "two ", 9, 13, IDs);
testTextAfterOffset(8, BOUNDARY_WORD_START, "two ", 9, 13,
@@ -146,26 +125,6 @@
////////////////////////////////////////////////////////////////////////
// getTextBeforeOffset
- // BOUNDARY_CHAR
- testTextBeforeOffset(8, BOUNDARY_CHAR, "\n", 7, 8,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextBeforeOffset(9, BOUNDARY_CHAR, "\n", 8, 9,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextBeforeOffset(10, BOUNDARY_CHAR, "t", 9, 10,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
-
// BOUNDARY_WORD_START
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
testTextBeforeOffset(7, BOUNDARY_WORD_START, "", 0, 0, IDs);
@@ -273,26 +232,6 @@
////////////////////////////////////////////////////////////////////////
// getTextAtOffset
- // BOUNDARY_CHAR
- testTextAtOffset(7, BOUNDARY_CHAR, "\n", 7, 8,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAtOffset(8, BOUNDARY_CHAR, "\n", 8, 9,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAtOffset(9, BOUNDARY_CHAR, "t", 9, 10,
- "div", kOk, kOk, kOk,
- "divbr", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "editablebr", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
-
// BOUNDARY_WORD_START
testTextAtOffset(0, BOUNDARY_WORD_START, "oneword\n\n", 0, 9, IDs);
testTextAtOffset(8, BOUNDARY_WORD_START, "oneword\n\n", 0, 9,
diff --git a/accessible/tests/mochitest/text/test_singleline.html b/accessible/tests/mochitest/text/test_singleline.html
index 0145a11774dc..020cfb095e5c 100644
--- a/accessible/tests/mochitest/text/test_singleline.html
+++ b/accessible/tests/mochitest/text/test_singleline.html
@@ -22,42 +22,12 @@
// __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- ////////////////////////////////////////////////////////////////////////
- // characterCount
-
- testCharacterCount(["input", "div"], 15);
- testCharacterCount(["textarea"], 16);
-
- ////////////////////////////////////////////////////////////////////////
- // getText
-
- var IDs = ["input", "div", "textarea"];
- testText(IDs, 0, 1, "h");
- testText(IDs, 1, 3, "el");
- testText(IDs, 14, 15, "d");
- testText(IDs, 0, 15, "hello my friend");
-
////////////////////////////////////////////////////////////////////////
// getTextAfterOffset
var IDs = [ "input", "div", "editable", "textarea" ];
var regularIDs = [ "input", "div", "editable" ];
- // BOUNDARY_CHAR
-
- testCharAfterOffset(IDs, 0, "e", 1, 2);
- testCharAfterOffset(IDs, 1, "l", 2, 3);
- testCharAfterOffset(regularIDs, 14, "", 15, 15);
- testCharAfterOffset("textarea", 14, "\n", 15, 16);
-
- // XXX: why are 15/15 expected? there's no 16 offset we are trying to
- // get an offset for?
- testTextAfterOffset(15, BOUNDARY_CHAR, "", 15, 15,
- "input", kOk, kTodo, kTodo,
- "div", kOk, kTodo, kTodo,
- "editable", kOk, kTodo, kTodo);
- testCharAfterOffset("textarea", 15, "", 16, 16);
-
// BOUNDARY_WORD_START
testTextAfterOffset(0, BOUNDARY_WORD_START, "my ", 6, 9, IDs);
testTextAfterOffset(1, BOUNDARY_WORD_START, "my ", 6, 9, IDs);
@@ -131,12 +101,6 @@
var IDs = [ "input", "div", "editable", "textarea" ];
- // BOUNDARY_CHAR
- testCharBeforeOffset(IDs, 0, "", 0, 0);
- testCharBeforeOffset(IDs, 1, "h", 0, 1);
- testCharBeforeOffset(IDs, 14, "n", 13, 14);
- testCharBeforeOffset(IDs, 15, "d", 14, 15);
-
// BOUNDARY_WORD_START
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs);
@@ -215,15 +179,6 @@
IDs = [ "input", "div", "editable", "textarea" ];
regularIDs = [ "input", "div", "editable" ];
- // BOUNDARY_CHAR
-
- testCharAtOffset(IDs, 0, "h", 0, 1);
- testCharAtOffset(IDs, 1, "e", 1, 2);
- testCharAtOffset(IDs, 14, "d", 14, 15);
- testCharAtOffset(regularIDs, 15, "", 15, 15);
- testCharAtOffset("textarea", 15, "\n", 15, 16);
- testCharAtOffset("textarea", 16, "", 16, 16);
-
// BOUNDARY_WORD_START
testTextAtOffset(0, BOUNDARY_WORD_START, "hello ", 0, 6, IDs);
testTextAtOffset(1, BOUNDARY_WORD_START, "hello ", 0, 6, IDs);
diff --git a/accessible/tests/mochitest/text/test_whitespaces.html b/accessible/tests/mochitest/text/test_whitespaces.html
index c50dfd4c2131..f3e019fc644c 100644
--- a/accessible/tests/mochitest/text/test_whitespaces.html
+++ b/accessible/tests/mochitest/text/test_whitespaces.html
@@ -18,41 +18,11 @@
// __B__r__a__v__e__ __S__i__r__ __ __R__o__b__i__n__ __ __ __r__a__n
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
- ////////////////////////////////////////////////////////////////////////
- // characterCount
-
- testCharacterCount(["input", "div", "editable"], 22);
- testCharacterCount(["textarea"], 23);
-
- ////////////////////////////////////////////////////////////////////////
- // getText
-
- var IDs = ["input", "div", "editable", "textarea"];
-
- testText(IDs, 0, 1, "B");
- testText(IDs, 5, 6, " ");
- testText(IDs, 9, 11, " ");
- testText(IDs, 16, 19, " ");
- testText(IDs, 0, 22, "Brave Sir Robin ran");
-
////////////////////////////////////////////////////////////////////////
// getTextAfterOffset
var IDs = [ "input", "div", "editable", "textarea" ];
- // BOUNDARY_CHAR
- testCharAfterOffset(IDs, 0, "r", 1, 2);
- testCharAfterOffset(IDs, 1, "a", 2, 3);
- testCharAfterOffset(IDs, 4, " ", 5, 6);
- testCharAfterOffset(IDs, 5, "S", 6, 7);
- testCharAfterOffset(IDs, 8, " ", 9, 10);
- testCharAfterOffset(IDs, 9, " ", 10, 11);
- testCharAfterOffset(IDs, 10, "R", 11, 12);
- testCharAfterOffset(IDs, 15, " ", 16, 17);
- testCharAfterOffset(IDs, 16, " ", 17, 18);
- testCharAfterOffset(IDs, 17, " ", 18, 19);
- testCharAfterOffset(IDs, 18, "r", 19, 20);
-
// BOUNDARY_WORD_START
testTextAfterOffset(0, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
testTextAfterOffset(5, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
@@ -122,15 +92,6 @@
var IDs = [ "input", "div", "editable", "textarea" ];
- // BOUNDARY_CHAR
- testCharBeforeOffset(IDs, 0, "", 0, 0);
- testCharBeforeOffset(IDs, 1, "B", 0, 1);
- testCharBeforeOffset(IDs, 6, " ", 5, 6);
- testCharBeforeOffset(IDs, 10, " ", 9, 10);
- testCharBeforeOffset(IDs, 11, " ", 10, 11);
- testCharBeforeOffset(IDs, 17, " ", 16, 17);
- testCharBeforeOffset(IDs, 19, " ", 18, 19);
-
// BOUNDARY_WORD_START
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs);
@@ -169,38 +130,6 @@
////////////////////////////////////////////////////////////////////////
// getTextAtOffset
- // BOUNDARY_CHAR
- testTextAtOffset(0, BOUNDARY_CHAR, "B", 0, 1,
- "input", kOk, kOk, kOk,
- "div", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAtOffset(1, BOUNDARY_CHAR, "r", 1, 2,
- "input", kOk, kOk, kOk,
- "div", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAtOffset(5, BOUNDARY_CHAR, " ", 5, 6,
- "input", kOk, kOk, kOk,
- "div", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAtOffset(9, BOUNDARY_CHAR, " ", 9, 10,
- "input", kOk, kOk, kOk,
- "div", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAtOffset(10, BOUNDARY_CHAR, " ", 10, 11,
- "input", kOk, kOk, kOk,
- "div", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
- testTextAtOffset(17, BOUNDARY_CHAR, " ", 17, 18,
- "input", kOk, kOk, kOk,
- "div", kOk, kOk, kOk,
- "editable", kOk, kOk, kOk,
- "textarea", kOk, kOk, kOk);
-
// BOUNDARY_WORD_START
testTextAtOffset(0, BOUNDARY_WORD_START, "Brave ", 0, 6,
"input", kOk, kOk, kOk,
diff --git a/b2g/config/mozconfigs/linux32_gecko/nightly b/b2g/config/mozconfigs/linux32_gecko/nightly
index 6a89e52ee5db..ba7db9f6e7d4 100644
--- a/b2g/config/mozconfigs/linux32_gecko/nightly
+++ b/b2g/config/mozconfigs/linux32_gecko/nightly
@@ -16,9 +16,6 @@ ac_add_options --enable-stdcxx-compat
# by 2 MBs.
STRIP_FLAGS="--strip-debug"
-# PGO
-mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
-
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
diff --git a/b2g/config/mozconfigs/linux64_gecko/nightly b/b2g/config/mozconfigs/linux64_gecko/nightly
index 6a89e52ee5db..ba7db9f6e7d4 100644
--- a/b2g/config/mozconfigs/linux64_gecko/nightly
+++ b/b2g/config/mozconfigs/linux64_gecko/nightly
@@ -16,9 +16,6 @@ ac_add_options --enable-stdcxx-compat
# by 2 MBs.
STRIP_FLAGS="--strip-debug"
-# PGO
-mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
-
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
diff --git a/b2g/config/mozconfigs/win32_gecko/nightly b/b2g/config/mozconfigs/win32_gecko/nightly
index 221c4603aa8a..bb6510f3059e 100644
--- a/b2g/config/mozconfigs/win32_gecko/nightly
+++ b/b2g/config/mozconfigs/win32_gecko/nightly
@@ -1,8 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
-# for pgo
-mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
-
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-jemalloc
diff --git a/browser/build.mk b/browser/build.mk
index c72d6ac47399..fc692eda5f5e 100644
--- a/browser/build.mk
+++ b/browser/build.mk
@@ -2,22 +2,6 @@
# 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/.
-################################################
-# Parallel build on Windows with GNU make check
-
-default::
-ifeq (,$(findstring pymake,$(MAKE)))
-ifeq ($(HOST_OS_ARCH),WINNT)
-ifneq (1,$(NUMBER_OF_PROCESSORS))
- @echo $(if $(findstring -j,$(value MAKEFLAGS)), \
-$(error You are using GNU make to build Firefox with -jN on Windows. \
-This will randomly deadlock. To compile a parallel build on Windows \
-run "python -OO build/pymake/make.py -f client.mk build". \
-See https://developer.mozilla.org/en/pymake for more details.))
-endif
-endif
-endif
-
installer:
@$(MAKE) -C browser/installer installer
diff --git a/browser/components/preferences/in-content/privacy.xul b/browser/components/preferences/in-content/privacy.xul
index 9129c1e434a1..14bb769cf9e3 100644
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -77,11 +77,11 @@
preference="privacy.donottrackheader.value"
onsynctopreference="return gPrivacyPane.setTrackingPrefs()"
onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()">
-
-
-
-
-
-
",
},
- { // #13
+ { // #11
file: "test-bug-595934-empty-getelementbyid.html",
category: "DOM",
matchString: "getElementById",
},
- { // #14
+ { // #12
file: "test-bug-595934-canvas-css.html",
category: "CSS Parser",
matchString: "foobarCanvasCssParser",
},
- { // #15
+ { // #13
file: "test-bug-595934-image.html",
category: "Image",
matchString: "corrupt",
diff --git a/browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.html b/browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.html
deleted file mode 100644
index 76f3890d1b06..000000000000
--- a/browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- Web Console test for bug 595934 - category: DOM Events.
- (external script 2)
-
-
-
-
- Web Console test for bug 595934 - category "DOM Events" (external
- script 2).
-
-
diff --git a/browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.js b/browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.js
deleted file mode 100644
index 04894e5743b5..000000000000
--- a/browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-window.addEventListener("DOMContentLoaded", function(aEvent) {
- aEvent.preventBubble();
-}, false);
-
-
diff --git a/browser/devtools/webconsole/test/test-bug-595934-dom-events.html b/browser/devtools/webconsole/test/test-bug-595934-dom-events.html
deleted file mode 100644
index b3f5e9cc6a97..000000000000
--- a/browser/devtools/webconsole/test/test-bug-595934-dom-events.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- Web Console test for bug 595934 - category: DOM Events
-
-
-
-
- Web Console test for bug 595934 - category "DOM Events".
-
-
diff --git a/browser/locales/en-US/chrome/browser/devtools/appcacheutils.properties b/browser/locales/en-US/chrome/browser/devtools/appcacheutils.properties
index 00fd77efbd3f..dcedfa7728c2 100644
--- a/browser/locales/en-US/chrome/browser/devtools/appcacheutils.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/appcacheutils.properties
@@ -2,122 +2,122 @@
# 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/.
-# LOCALIZATION NOTE These strings are used inside the Inspector
-# which is available from the Web Developer sub-menu -> 'Inspect'.
-#
+# LOCALIZATION NOTE These strings are used inside the Web Console
+# command line which is available from the Web Developer sub-menu
+# -> 'Web Console'.
+# These messages are displayed when an attempt is made to validate a
+# page or a cache manifest using AppCacheUtils.jsm
+
# The correct localization of this file might be to keep it in
# English, or another language commonly spoken among web developers.
# You want to make that choice consistent across the developer tools.
# A good criteria is the language in which you'd find the best
# documentation on web development on the web.
-# LOCALIZATION NOTE (noManifest): Used when an attempt is made to validate a
-# page using AppCacheUtils.jsm that has no cache manifest.
+# LOCALIZATION NOTE (noManifest): the specified page has no cache manifest.
noManifest=The specified page has no manifest.
-# LOCALIZATION NOTE (notUTF8): Used when an attempt is made to validate a
-# cache manifest using AppCacheUtils.jsm having a character encoding that is not
-# UTF-8.
+# LOCALIZATION NOTE (notUTF8): the associated cache manifest has a character
+# encoding that is not UTF-8. Parameters: %S is the current encoding.
notUTF8=Manifest has a character encoding of %S. Manifests must have the utf-8 character encoding.
-# LOCALIZATION NOTE (badMimeType): Used when an attempt is made to validate a
-# cache manifest using AppCacheUtils.jsm having a mimetype that is not
-# text/cache-manifest.
+# LOCALIZATION NOTE (badMimeType): the associated cache manifest has a
+# mimetype that is not text/cache-manifest. Parameters: %S is the current
+# mimetype.
badMimeType=Manifest has a mimetype of %S. Manifests must have a mimetype of text/cache-manifest.
-# LOCALIZATION NOTE (duplicateURI): Used when an attempt is made to validate a
-# page using AppCacheUtils.jsm that has a cache manifest which references the
-# same URI from multiple locations.
-duplicateURI=URI %S is referenced in multiple locations. This is not allowed: %S.
+# LOCALIZATION NOTE (duplicateURI): the associated cache manifest references
+# the same URI from multiple locations. Parameters: %1$S is the URI, %2$S is a
+# list of references to this URI.
+duplicateURI=URI %1$S is referenced in multiple locations. This is not allowed: %2$S.
-# LOCALIZATION NOTE (networkBlocksURI): Used when an attempt is made to validate
-# a page using AppCacheUtils.jsm that has a cache manifest which references the
-# same URI in the NETWORK section as it does in other sections.
-networkBlocksURI=NETWORK section line %S (%S) prevents caching of line %S (%S) in the %S section.
+# LOCALIZATION NOTE (networkBlocksURI, fallbackBlocksURI): the associated
+# cache manifest references the same URI in the NETWORK (or FALLBACK) section
+# as it does in other sections. Parameters: %1$S is the line number, %2$S is
+# the resource name, %3$S is the line number, %4$S is the resource name, %5$S
+# is the section name.
+networkBlocksURI=NETWORK section line %1$S (%2$S) prevents caching of line %3$S (%4$S) in the %5$S section.
+fallbackBlocksURI=FALLBACK section line %1$S (%2$S) prevents caching of line %3$S (%4$S) in the %5$S section.
-# LOCALIZATION NOTE (fallbackBlocksURI): Used when an attempt is made to
-# validate a page using AppCacheUtils.jsm that has a cache manifest which
-# references the same URI in the FALLBACK section as it does in other sections.
-fallbackBlocksURI=FALLBACK section line %S (%S) prevents caching of line %S (%S) in the %S section.
-
-# LOCALIZATION NOTE (fileChangedButNotManifest): Used when an attempt is made to
-# validate a page using AppCacheUtils.jsm that has a cache manifest which
+# LOCALIZATION NOTE (fileChangedButNotManifest): the associated cache manifest
# references a URI that has a file modified after the cache manifest.
-fileChangedButNotManifest=The file %S was modified after %S. Unless the text in the manifest file is changed the cached version will be used instead at line %S.
+# Parameters: %1$S is the resource name, %2$S is the cache manifest, %3$S is
+# the line number.
+fileChangedButNotManifest=The file %1$S was modified after %2$S. Unless the text in the manifest file is changed the cached version will be used instead at line %3$S.
-# LOCALIZATION NOTE (cacheControlNoStore): Used when an attempt is made to
-# validate a page using AppCacheUtils.jsm that has a header preventing caching
-# or storing information.
-cacheControlNoStore=%S has cache-control set to no-store. This will prevent the application cache from storing the file at line %S.
+# LOCALIZATION NOTE (cacheControlNoStore): the specified page has a header
+# preventing caching or storing information. Parameters: %1$S is the resource
+# name, %2$S is the line number.
+cacheControlNoStore=%1$S has cache-control set to no-store. This will prevent the application cache from storing the file at line %2$S.
-# LOCALIZATION NOTE (notAvailable): Used when an attempt is made to validate a
-# page using AppCacheUtils.jsm that is not available.
-notAvailable=%S points to a resource that is not available at line %S.
+# LOCALIZATION NOTE (notAvailable): the specified resource is not available.
+# Parameters: %1$S is the resource name, %2$S is the line number.
+notAvailable=%1$S points to a resource that is not available at line %2$S.
-# LOCALIZATION NOTE (invalidURI): Used when an invalid URI is passed to the
-# appcache.
+# LOCALIZATION NOTE (invalidURI): it's used when an invalid URI is passed to
+# the appcache.
invalidURI=The URI passed to AppCacheUtils is invalid.
-# LOCALIZATION NOTE (noResults) Used when a search returns no results.
+# LOCALIZATION NOTE (noResults): it's used when a search returns no results.
noResults=Your search returned no results.
-# LOCALIZATION NOTE (cacheDisabled) Used when the cache is disabled and an
-# attempt is made to view offline data.
+# LOCALIZATION NOTE (cacheDisabled): it's used when the cache is disabled and
+# an attempt is made to view offline data.
cacheDisabled=Your disk cache is disabled. Please set browser.cache.disk.enable to true in about:config and try again.
-# LOCALIZATION NOTE (firstLineMustBeCacheManifest): Used when an attempt is made
-# to validate a cache manifest using AppCacheUtils.jsm having a first line that
-# is not "CACHE MANIFEST."
+# LOCALIZATION NOTE (firstLineMustBeCacheManifest): the associated cache
+# manifest has a first line that is not "CACHE MANIFEST". Parameters: %S is
+# the line number.
firstLineMustBeCacheManifest=The first line of the manifest must be "CACHE MANIFEST" at line %S.
-# LOCALIZATION NOTE (cacheManifestOnlyFirstLine): Used when an attempt is made
-# to validate a cache manifest using AppCacheUtils.jsm having "CACHE MANIFEST"
-# on a line other than the first line.
+# LOCALIZATION NOTE (cacheManifestOnlyFirstLine): the associated cache
+# manifest has "CACHE MANIFEST" on a line other than the first line.
+# Parameters: %S is the line number where "CACHE MANIFEST" appears.
cacheManifestOnlyFirstLine="CACHE MANIFEST" is only valid on the first line at line %S.
-# LOCALIZATION NOTE (asteriskInWrongSection): Used when an attempt is made
-# to validate a cache manifest using AppCacheUtils.jsm having an asterisk (*) in
-# a section other than the network section.
-asteriskInWrongSection=Asterisk used as a wildcard in the %S section at line %S. A single line containing an asterisk is called the online whitelist wildcard flag and is only valid in the NETWORK section. Other uses of the * character are prohibited. The presence of this flag indicates that any URI not listed as cached is to be implicitly treated as being in the online whitelist namespaces. If the flag is not present then the blocking state indicates that URIs not listed explicitly in the manifest are to be treated as unavailable.
+# LOCALIZATION NOTE (asteriskInWrongSection): the associated cache manifest
+# has an asterisk (*) in a section other than the NETWORK section. Parameters:
+# %1$S is the section name, %2$S is the line number.
+asteriskInWrongSection=Asterisk used as a wildcard in the %1$S section at line %2$S. A single line containing an asterisk is called the online whitelist wildcard flag and is only valid in the NETWORK section. Other uses of the * character are prohibited. The presence of this flag indicates that any URI not listed as cached is to be implicitly treated as being in the online whitelist namespaces. If the flag is not present then the blocking state indicates that URIs not listed explicitly in the manifest are to be treated as unavailable.
-# LOCALIZATION NOTE (escapeSpaces): Used when an attempt is made to validate a
-# cache manifest using AppCacheUtils.jsm having a space in a URI. Spaces are to
-# be replaced with %20.
+# LOCALIZATION NOTE (escapeSpaces): the associated cache manifest has a space
+# in a URI. Spaces must be replaced with %20. Parameters: %S is the line
+# number where this error occurs.
escapeSpaces=Spaces in URIs need to be replaced with %20 at line %S.
-# LOCALIZATION NOTE (slashDotDotSlashBad): Used when an attempt is made to
-# validate a cache manifest using AppCacheUtils.jsm having a URI containing
-# /../, which is invalid.
+# LOCALIZATION NOTE (slashDotDotSlashBad): the associated cache manifest has a
+# URI containing /../, which is invalid. Parameters: %S is the line number
+# where this error occurs.
slashDotDotSlashBad=/../ is not a valid URI prefix at line %S.
-# LOCALIZATION NOTE (tooManyDotDotSlashes): Used when an attempt is made to
-# validate a cache manifest using AppCacheUtils.jsm having a URI containing
-# too many ../ operators. Too many of these operaters mean that the file would
-# be below the root of the site, which is not possible.
+# LOCALIZATION NOTE (tooManyDotDotSlashes): the associated cache manifest has
+# a URI containing too many ../ operators. Too many of these operators mean
+# that the file would be below the root of the site, which is not possible.
+# Parameters: %S is the line number where this error occurs.
tooManyDotDotSlashes=Too many dot dot slash operators (../) at line %S.
-# LOCALIZATION NOTE (fallbackUseSpaces): Used when an attempt is made to
-# validate a cache manifest using AppCacheUtils.jsm having a FALLBACK section
-# containing more or less than the standard two URIs seperated by a single
-# space.
+# LOCALIZATION NOTE (fallbackUseSpaces): the associated cache manifest has a
+# FALLBACK section containing more or less than the standard two URIs
+# separated by a single space. Parameters: %S is the line number where this
+# error occurs.
fallbackUseSpaces=Only two URIs separated by spaces are allowed in the FALLBACK section at line %S.
-# LOCALIZATION NOTE (fallbackAsterisk): Used when an attempt is made to validate
-# a cache manifest using AppCacheUtils.jsm having a FALLBACK section that
-# attempts to use an asterisk (*) as a wildcard. In this section the URI is
-# simply a path prefix.
+# LOCALIZATION NOTE (fallbackAsterisk): the associated cache manifest has a
+# FALLBACK section that attempts to use an asterisk (*) as a wildcard. In this
+# section the URI is simply a path prefix. Parameters: %S is the line number
+# where this error occurs.
fallbackAsterisk=Asterisk (*) incorrectly used as a wildcard in a fallback namespace at line %S. Namespaces simply need to match a path prefix.
-# LOCALIZATION NOTE (settingsBadValue): Used when an attempt is made to validate
-# a cache manifest using AppCacheUtils.jsm having a SETTINGS section containing
-# something other than the valid "prefer-online" or "fast."
+# LOCALIZATION NOTE (settingsBadValue): the associated cache manifest has a
+# SETTINGS section containing something other than the valid "prefer-online"
+# or "fast". Parameters: %S is the line number where this error occurs.
settingsBadValue=The SETTINGS section may only contain a single value, "prefer-online" or "fast" at line %S.
-# LOCALIZATION NOTE (invalidSectionName): Used when an attempt is made to
-# validate a cache manifest using AppCacheUtils.jsm containing an invalid
-# section name.
-invalidSectionName=Invalid section name (%S) at line %S.
+# LOCALIZATION NOTE (invalidSectionName): the associated cache manifest
+# contains an invalid section name. Parameters: %1$S is the section name, %2$S
+# is the line number.
+invalidSectionName=Invalid section name (%1$S) at line %2$S.
-# LOCALIZATION NOTE (entryNotFound): Used when an attempt is made to view a
-# cache entry that does not exist.
+# LOCALIZATION NOTE (entryNotFound): the requested cache entry that does not
+# exist.
entryNotFound=Entry not found.
diff --git a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
index df894ba7352d..d8ce26a054cc 100644
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -4,11 +4,11 @@
-
+
-
+
-
+
diff --git a/browser/metro/components/Sidebar.js b/browser/metro/components/Sidebar.js
index ef3a7d683a94..93b36415c9fd 100644
--- a/browser/metro/components/Sidebar.js
+++ b/browser/metro/components/Sidebar.js
@@ -70,14 +70,6 @@ Sidebar.prototype = {
},
// =========================== nsISidebar ===========================
- addPanel: function addPanel(aTitle, aContentURL, aCustomizeURL) {
- // not supported
- },
-
- addPersistentPanel: function addPersistentPanel(aTitle, aContentURL, aCustomizeURL) {
- // not supported
- },
-
// The suggestedTitle and suggestedCategory parameters are ignored, but remain
// for backward compatibility.
addSearchEngine: function addSearchEngine(engineURL, iconURL, suggestedTitle,
diff --git a/build/ConfigStatus.py b/build/ConfigStatus.py
index 92cb9baee185..d424f31c1c9b 100644
--- a/build/ConfigStatus.py
+++ b/build/ConfigStatus.py
@@ -82,7 +82,7 @@ def config_status(topobjdir = '.', topsrcdir = '.',
# Without -n, the current directory is meant to be the top object directory
if not options.not_topobjdir:
- topobjdir = '.'
+ topobjdir = os.path.abspath('.')
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
non_global_defines=non_global_defines, substs=substs)
diff --git a/build/autoconf/config.status.m4 b/build/autoconf/config.status.m4
index 1a5700082fd5..ceba24b6722b 100644
--- a/build/autoconf/config.status.m4
+++ b/build/autoconf/config.status.m4
@@ -88,7 +88,7 @@ if not os.path.isabs(topsrcdir):
rel = os.path.join(os.path.dirname(<<<__file__>>>), topsrcdir)
topsrcdir = os.path.normpath(os.path.abspath(rel))
-topobjdir = os.path.dirname(<<<__file__>>>)
+topobjdir = os.path.abspath(os.path.dirname(<<<__file__>>>))
dnl All defines and substs are stored with an additional space at the beginning
dnl and at the end of the string, to avoid any problem with values starting or
diff --git a/build/mach_bootstrap.py b/build/mach_bootstrap.py
index f065ad6841a7..4671b18b0484 100644
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -7,6 +7,21 @@ from __future__ import print_function, unicode_literals
import os
import platform
import sys
+import time
+
+
+STATE_DIR_FIRST_RUN = '''
+mach and the build system store shared state in a common directory on the
+filesystem. The following directory will be created:
+
+ {userdir}
+
+If you would like to use a different directory, hit CTRL+c and set the
+MOZBUILD_STATE_PATH environment variable to the directory you would like to
+use and re-run mach. For this change to take effect forever, you'll likely
+want to export this environment variable from your shell's init scripts.
+'''.lstrip()
+
# TODO Bug 794506 Integrate with the in-tree virtualenv configuration.
SEARCH_PATHS = [
@@ -98,6 +113,39 @@ def bootstrap(topsrcdir, mozilla_dir=None):
print('You are running Python', platform.python_version())
sys.exit(1)
+ # Global build system and mach state is stored in a central directory. By
+ # default, this is ~/.mozbuild. However, it can be defined via an
+ # environment variable. We detect first run (by lack of this directory
+ # existing) and notify the user that it will be created. The logic for
+ # creation is much simpler for the "advanced" environment variable use
+ # case. For default behavior, we educate users and give them an opportunity
+ # to react. We always exit after creating the directory because users don't
+ # like surprises.
+ state_user_dir = os.path.expanduser('~/.mozbuild')
+ state_env_dir = os.environ.get('MOZBUILD_STATE_PATH', None)
+ if state_env_dir:
+ if not os.path.exists(state_env_dir):
+ print('Creating global state directory from environment variable: %s'
+ % state_env_dir)
+ os.makedirs(state_env_dir, mode=0777)
+ print('Please re-run mach.')
+ sys.exit(1)
+ else:
+ if not os.path.exists(state_user_dir):
+ print(STATE_DIR_FIRST_RUN.format(userdir=state_user_dir))
+ try:
+ for i in range(20, -1, -1):
+ time.sleep(1)
+ sys.stdout.write('%d ' % i)
+ sys.stdout.flush()
+ except KeyboardInterrupt:
+ sys.exit(1)
+
+ print('\nCreating default state directory: %s' % state_user_dir)
+ os.mkdir(state_user_dir)
+ print('Please re-run mach.')
+ sys.exit(1)
+
try:
import mach.main
except ImportError:
diff --git a/build/mobile/robocop/Makefile.in b/build/mobile/robocop/Makefile.in
index bc15f7def730..44ef161fa9bc 100644
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -64,7 +64,6 @@ robocop_DEST := $(CURDIR)
robocop_FILES := \
$(TESTPATH)/robocop.ini \
$(TESTPATH)/robocop_autophone.ini \
- $(srcdir)/parse_ids.py \
$(NULL)
robocop-deps := $(notdir $(robocop_FILES))
@@ -81,10 +80,9 @@ GARBAGE += \
$(java-tests-dep) \
$(_JAVA_HARNESS) \
classes.dex \
- robocop.apk \
robocop.ap_ \
- robocop-unsigned-unaligned.apk \
- robocop-unaligned.apk \
+ robocop-debug-signed.apk \
+ robocop-debug-signed-unaligned.apk \
$(robocop-deps) \
$(NULL)
@@ -101,7 +99,7 @@ include $(topsrcdir)/config/android-common.mk
GENERATED_DIRS_tools = classes $(dir-tests)
-tools:: $(robocop-deps) robocop.apk
+libs:: robocop-debug-signed.apk
classes.dex: robocop.ap_
classes.dex: $(robocop-deps)
@@ -110,10 +108,15 @@ classes.dex: $(java-tests-dep)
$(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(java-tests-dep)
$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB)
-robocop.apk: $(robocop-deps) robocop.ap_ classes.dex
robocop.ap_: AndroidManifest.xml $(TESTPATH)/assets/*
$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./
+robocop-debug-signed-unaligned.apk: robocop.ap_ classes.dex
+ $(APKBUILDER) $@ -v $(APKBUILDER_FLAGS) -z robocop.ap_ -f classes.dex
+
+robocop-debug-signed.apk: robocop-debug-signed-unaligned.apk
+ $(ZIPALIGN) -f -v 4 $^ $@
+
# PP_java-tests not fully usable here
# Intermediate step toward a library rule.
$(dir-tests)/%.java: $(TESTPATH)/%.java.in $(call mkdir_deps,$(dir-tests))
diff --git a/build/mobile/robocop/README b/build/mobile/robocop/README
index dec5bb265780..3de479685a10 100644
--- a/build/mobile/robocop/README
+++ b/build/mobile/robocop/README
@@ -7,3 +7,6 @@ http://code.google.com/p/robotium/
We are including robotium-solo-3.6.jar as a binary and are not modifying it in any way
from the original download found at:
http://code.google.com/p/robotium/
+
+Firefox for Android developers should read the documentation in
+mobile/android/base/tests/README.rst.
diff --git a/build/profile_pageloader.html b/build/profile_pageloader.html
deleted file mode 100644
index 47a985083ba0..000000000000
--- a/build/profile_pageloader.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
diff --git a/build/profile_pageloader.pl b/build/profile_pageloader.pl
deleted file mode 100755
index dd6be1c1b83c..000000000000
--- a/build/profile_pageloader.pl
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/usr/bin/perl
-# 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/.
-
-use Cwd;
-use File::Find ();
-
-use POSIX qw(sys_wait_h);
-
-sub kill_process {
- my ($target_pid) = @_;
- my $start_time = time;
-
- # Try to kill and wait 10 seconds, then try a kill -9
- my $sig;
- for $sig ('TERM', 'KILL') {
- print "kill $sig $target_pid\n";
- kill $sig => $target_pid;
- my $interval_start = time;
- while (time - $interval_start < 10) {
- # the following will work with 'cygwin' perl on win32, but not
- # with 'MSWin32' (ActiveState) perl
- my $pid = waitpid($target_pid, POSIX::WNOHANG());
- if (($pid == $target_pid and POSIX::WIFEXITED($?)) or $pid == -1) {
- my $secs = time - $start_time;
- $secs = $secs == 1 ? '1 second' : "$secs seconds";
- print "Process killed. Took $secs to die.\n";
- return;
- }
- sleep 1;
- }
- }
- die "Unable to kill process: $target_pid";
-}
-
-# Stripped down version of fork_and_log().
-sub system_fork_and_log {
- # Fork a sub process and log the output.
- my ($cmd) = @_;
-
- my $pid = fork; # Fork off a child process.
-
- unless ($pid) { # child
- exec { $cmd->[0] } @$cmd;
- die "Could not exec()";
- }
- return $pid;
-}
-
-
-sub wait_for_pid {
- # Wait for a process to exit or kill it if it takes too long.
- my ($pid, $timeout_secs) = @_;
- my ($exit_value, $signal_num, $dumped_core, $timed_out) = (0,0,0,0);
- my $sig_name;
- my $loop_count;
-
- die ("Invalid timeout value passed to wait_for_pid()\n")
- if ($timeout_secs <= 0);
-
- eval {
- $loop_count = 0;
- while (++$loop_count < $timeout_secs) {
- my $wait_pid = waitpid($pid, POSIX::WNOHANG());
- # the following will work with 'cygwin' perl on win32, but not
- # with 'MSWin32' (ActiveState) perl
- last if ($wait_pid == $pid and POSIX::WIFEXITED($?)) or $wait_pid == -1;
- sleep 1;
- }
-
- $exit_value = $? >> 8;
- $signal_num = $? >> 127;
- $dumped_core = $? & 128;
- if ($loop_count >= $timeout_secs) {
- die "timeout";
- }
- return "done";
- };
-
- if ($@) {
- if ($@ =~ /timeout/) {
- kill_process($pid);
- $timed_out = 1;
- } else { # Died for some other reason.
- die; # Propagate the error up.
- }
- }
-# $sig_name = $signal_num ? signal_name($signal_num) : '';
-#
-# return { timed_out=>$timed_out,
-# exit_value=>$exit_value,
-# sig_name=>$sig_name,
-# dumped_core=>$dumped_core };
-}
-
-# System version of run_cmd().
-sub run_system_cmd {
- my ($cmd, $timeout_secs) = @_;
-
-# print_log "cmd = $cmd\n";
- my $pid = system_fork_and_log($cmd);
- my $result = wait_for_pid($pid, $timeout_secs);
-
- return $result;
-}
-
-#
-# Given profile directory, find pref file hidden in salt directory.
-# profile $Settings::MozProfileName must exist before calling this sub.
-#
-sub find_pref_file {
- my $profile_dir = shift;
-
- # default to *nix
- my $pref_file = "prefs.js";
-
- unless (-e $profile_dir) {
- return; # empty list
- }
-
- my $found = undef;
- my $sub = sub {$pref_file = $File::Find::name, $found++ if $pref_file eq $_};
- File::Find::find($sub, $profile_dir);
- unless ($found) {
- return; # empty list
- }
-
- return $pref_file;
-}
-
-my $topdir = cwd();
-
-chdir $ENV{OBJDIR};
-my $app_name = `grep "MOZ_APP_NAME " config/autoconf.mk | sed "s/.*= //"`;
-chomp($app_name);
-
-# On mac, the app directory is the product name with the first
-# letter capitalized
-
-my $toolkit = `grep "MOZ_WIDGET_TOOLKIT " config/autoconf.mk |sed "s/.*= //"`;
-chomp($toolkit);
-
-if ($toolkit =~ /(mac|cocoa)/) {
- my $app_dir = uc(substr($app_name, 0, 1)).substr($app_name, 1);
- chdir "dist/$app_dir.app/Contents/MacOS";
-} else {
- chdir "dist/bin";
-}
-
-my $bin_suffix = "";
-if ($toolkit =~ /(windows|os2)/) {
- $bin_suffix = ".exe";
-}
-
-my $old_home = $ENV{HOME};
-$ENV{HOME} = cwd();
-
-# Create a profile to test with.
-run_system_cmd(["./".$app_name.$bin_suffix, "-createProfile", "testprofile"], 45);
-
-my $pref_file = find_pref_file(".mozilla/".$app_name);
-open PREFS, ">>$pref_file";
-# Add allow_scripts_to_close_windows; this lets us cleanly exit.
-print PREFS "user_pref(\"dom.allow_scripts_to_close_windows\", true);\n";
-# Suppress the default browser dialog since it keeps the test from starting.
-print PREFS "user_pref(\"browser.shell.checkDefaultBrowser\", false);\n";
-close PREFS;
-
-# Run the pageload test.
-run_system_cmd(["./".$app_name.$bin_suffix, $ENV{PAGELOAD_URL}."/loader.pl?maxcyc=2&delay=500&nocache=0&timeout=30000&auto=1"], 240);
-
-# Start up again; this will gather data for reading global history and
-# reading the fastload file.
-run_system_cmd(["./".$app_name.$bin_suffix, "file://$topdir/build/profile_pageloader.html"], 45);
-
-chdir $topdir;
diff --git a/build/pymake/make.py b/build/pymake/make.py
index 8379b71f01a4..3ce623d4e73f 100755
--- a/build/pymake/make.py
+++ b/build/pymake/make.py
@@ -17,6 +17,13 @@ if __name__ == '__main__':
gc.disable()
+ # This is meant as a temporary workaround until issues with many targets
+ # and prerequisites is addressed. Bug 874210 tracks.
+ try:
+ sys.setrecursionlimit(2 * sys.getrecursionlimit())
+ except Exception:
+ print >>sys.stderr, 'Unable to increase Python recursion limit.'
+
pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
pymake.process.ParallelContext.spin()
assert False, "Not reached"
diff --git a/client.mk b/client.mk
index a9d24e3be61f..95a0e2513782 100644
--- a/client.mk
+++ b/client.mk
@@ -82,7 +82,16 @@ endif
####################################
# Sanity checks
+# Windows checks.
ifneq (,$(findstring mingw,$(CONFIG_GUESS)))
+
+# Require pymake (as opposed to GNU make).
+ifndef .PYMAKE
+$(error Pymake is required to build on Windows. Run |./mach build| to \
+automatically use pymake. Or, invoke pymake directly via \
+|python build/pymake/make.py|.)
+endif
+
# check for CRLF line endings
ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while () { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
$(error This source tree appears to have Windows-style line endings. To \
@@ -188,12 +197,6 @@ everything: clean build
####################################
# Profile-Guided Optimization
-# To use this, you should set the following variables in your mozconfig
-# mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
-#
-# The profile script should exercise the functionality to be included
-# in the profile feedback.
-#
# This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this
# is usable in multi-pass builds, where you might not have a runnable
# application until all the build passes and postflight scripts have run.
@@ -207,7 +210,7 @@ profiledbuild::
$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_GENERATE=1 MOZ_PGO_INSTRUMENTED=1
$(MAKE) -C $(PGO_OBJDIR) package MOZ_PGO_INSTRUMENTED=1 MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT=
rm -f ${PGO_OBJDIR}/jarlog/en-US.log
- MOZ_PGO_INSTRUMENTED=1 OBJDIR=${PGO_OBJDIR} JARLOG_FILE=${PGO_OBJDIR}/jarlog/en-US.log $(PROFILE_GEN_SCRIPT)
+ MOZ_PGO_INSTRUMENTED=1 JARLOG_FILE=jarlog/en-US.log EXTRA_TEST_ARGS=10 $(MAKE) -C $(PGO_OBJDIR) pgo-profile-run
$(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_USE=1
diff --git a/config/rules.mk b/config/rules.mk
index 9d1acf183dac..86f7e80fd6d7 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -66,6 +66,17 @@ endif
USE_AUTOTARGETS_MK = 1
include $(topsrcdir)/config/makefiles/makeutils.mk
+# Only build with Pymake (not GNU make) on Windows.
+ifeq ($(HOST_OS_ARCH),WINNT)
+ifndef L10NBASEDIR
+ifndef .PYMAKE
+$(error Pymake is required to build on Windows. Run |./mach build| to \
+automatically use pymake or invoke pymake directly via \
+|python build/pymake/make.py|.)
+endif
+endif
+endif
+
ifdef SDK_HEADERS
_EXTRA_EXPORTS := $(filter-out $(EXPORTS),$(SDK_HEADERS))
EXPORTS += $(_EXTRA_EXPORTS)
@@ -615,8 +626,14 @@ endif
# per traversal, hence the ifdef and the export. This rule needs to come before
# other rules for the default target or else it may not run in time.
ifndef MOZBUILD_BACKEND_CHECKED
-default::
- $(MAKE) -C $(DEPTH) backend.RecursiveMakeBackend.built
+
+$(DEPTH)/backend.RecursiveMakeBackend.built:
+ @echo "Build configuration changed. Regenerating backend."
+ @cd $(DEPTH) && $(PYTHON) ./config.status
+
+include $(DEPTH)/backend.RecursiveMakeBackend.built.pp
+
+default:: $(DEPTH)/backend.RecursiveMakeBackend.built
export MOZBUILD_BACKEND_CHECKED=1
endif
@@ -1610,6 +1627,21 @@ endif
endif
endif
+
+
+ifneq (,$(filter export,$(MAKECMDGOALS)))
+MDDEPEND_FILES := $(strip $(wildcard $(addprefix $(MDDEPDIR)/,$(EXTRA_EXPORT_MDDEPEND_FILES))))
+
+ifneq (,$(MDDEPEND_FILES))
+ifdef .PYMAKE
+includedeps $(MDDEPEND_FILES)
+else
+include $(MDDEPEND_FILES)
+endif
+endif
+
+endif
+
#############################################################################
-include $(topsrcdir)/$(MOZ_BUILD_APP)/app-rules.mk
diff --git a/content/base/src/EventSource.cpp b/content/base/src/EventSource.cpp
index ffa39ec50e80..303c52d17646 100644
--- a/content/base/src/EventSource.cpp
+++ b/content/base/src/EventSource.cpp
@@ -61,6 +61,7 @@ EventSource::EventSource() :
mGoingToDispatchAllMessages(false),
mWithCredentials(false),
mWaitingForOnStopRequest(false),
+ mInterrupted(false),
mLastConvertionResult(NS_OK),
mReadyState(CONNECTING),
mScriptLine(0),
@@ -341,6 +342,16 @@ EventSource::OnStartRequest(nsIRequest *aRequest,
rv = httpChannel->GetRequestSucceeded(&requestSucceeded);
NS_ENSURE_SUCCESS(rv, rv);
+ uint32_t status;
+ rv = httpChannel->GetResponseStatus(&status);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ if (status == 204) {
+ mInterrupted = true;
+ DispatchFailConnection();
+ return NS_ERROR_ABORT;
+ }
+
nsAutoCString contentType;
rv = httpChannel->GetContentType(contentType);
NS_ENSURE_SUCCESS(rv, rv);
@@ -970,7 +981,7 @@ EventSource::ConsoleError()
NS_ConvertUTF8toUTF16 specUTF16(targetSpec);
const PRUnichar *formatStrings[] = { specUTF16.get() };
- if (mReadyState == CONNECTING) {
+ if (mReadyState == CONNECTING && !mInterrupted) {
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("connectionFailure").get(),
formatStrings, ArrayLength(formatStrings));
diff --git a/content/base/src/EventSource.h b/content/base/src/EventSource.h
index 57bfcc5bc8ad..c9231f41a75f 100644
--- a/content/base/src/EventSource.h
+++ b/content/base/src/EventSource.h
@@ -227,6 +227,7 @@ protected:
bool mGoingToDispatchAllMessages;
bool mWithCredentials;
bool mWaitingForOnStopRequest;
+ bool mInterrupted;
// used while reading the input streams
nsCOMPtr mUnicodeDecoder;
diff --git a/content/base/src/nsCCUncollectableMarker.h b/content/base/src/nsCCUncollectableMarker.h
index fcc13a8807f3..e5d868224202 100644
--- a/content/base/src/nsCCUncollectableMarker.h
+++ b/content/base/src/nsCCUncollectableMarker.h
@@ -7,7 +7,6 @@
#define nsCCUncollectableMarker_h_
#include "nsIObserver.h"
-#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
struct JSTracer;
@@ -30,8 +29,8 @@ class nsCCUncollectableMarker MOZ_FINAL : public nsIObserver
return aGeneration && aGeneration == sGeneration;
}
- static bool InGeneration(nsCycleCollectionTraversalCallback& aCb,
- uint32_t aGeneration)
+ template
+ static bool InGeneration(CCCallback& aCb, uint32_t aGeneration)
{
return InGeneration(aGeneration) && !aCb.WantAllTraces();
}
diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp
index dc5cf4bb1f2a..ae932a9d73ea 100644
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -1725,20 +1725,20 @@ nsContentUtils::IsCallerChrome()
bool
nsContentUtils::IsCallerXBL()
{
- JSScript *script;
JSContext *cx = GetCurrentJSContext();
if (!cx)
return false;
- // New Hotness.
JSCompartment *c = js::GetContextCompartment(cx);
- if (xpc::AllowXBLScope(c))
- return xpc::IsXBLScope(c);
- // XBL scopes are behind a pref, so check the XBL bit as well.
- if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script)
- return false;
- return JS_GetScriptUserBit(script);
+ // For remote XUL, we run XBL in the XUL scope. Given that we care about
+ // compat and not security for remote XUL, just always claim to be XBL.
+ if (!xpc::AllowXBLScope(c)) {
+ MOZ_ASSERT(nsContentUtils::AllowXULXBLForPrincipal(xpc::GetCompartmentPrincipal(c)));
+ return true;
+ }
+
+ return xpc::IsXBLScope(c);
}
@@ -6027,17 +6027,6 @@ public:
{
}
- NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root)
- {
- }
- NS_IMETHOD_(void) NoteJSRoot(void* root)
- {
- }
- NS_IMETHOD_(void) NoteNativeRoot(void* root,
- nsCycleCollectionParticipant* helper)
- {
- }
-
NS_IMETHOD_(void) NoteJSChild(void* child)
{
if (child == mWrapper) {
@@ -6056,10 +6045,6 @@ public:
{
}
- NS_IMETHOD_(void) NoteWeakMapping(void* map, void* key, void* kdelegate, void* val)
- {
- }
-
bool mFound;
private:
diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in
index db4fd3a2c1e7..46ddc4dfed67 100644
--- a/content/base/test/Makefile.in
+++ b/content/base/test/Makefile.in
@@ -493,6 +493,8 @@ MOCHITEST_FILES_B = \
accesscontrol.resource^headers^ \
invalid_accesscontrol.resource \
invalid_accesscontrol.resource^headers^ \
+ file_bug869432.eventsource \
+ file_bug869432.eventsource^headers^ \
$(NULL)
MOCHITEST_FILES_C= \
diff --git a/content/base/test/file_bug869432.eventsource b/content/base/test/file_bug869432.eventsource
new file mode 100644
index 000000000000..de92d4dd8628
--- /dev/null
+++ b/content/base/test/file_bug869432.eventsource
@@ -0,0 +1,4 @@
+retry:500
+data: data
+
+
diff --git a/content/base/test/file_bug869432.eventsource^headers^ b/content/base/test/file_bug869432.eventsource^headers^
new file mode 100644
index 000000000000..b8db77c582bc
--- /dev/null
+++ b/content/base/test/file_bug869432.eventsource^headers^
@@ -0,0 +1,3 @@
+HTTP 304 NO CONTENT (CLOSE)
+Content-Type: text/event-stream
+Cache-Control: no-cache, must-revalidate
\ No newline at end of file
diff --git a/content/base/test/test_bug338583.html b/content/base/test/test_bug338583.html
index d90c29e9691b..6a69ace086b2 100644
--- a/content/base/test/test_bug338583.html
+++ b/content/base/test/test_bug338583.html
@@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
function runAllTests() {
// these tests run asynchronously, and they will take 8000 ms
var all_tests = [
- doTest1, doTest1_e, doTest2, doTest3, doTest3_b, doTest3_c, doTest3_d,
+ doTest1, doTest1_e, doTest1_f, doTest2, doTest3, doTest3_b, doTest3_c, doTest3_d,
doTest3_e, doTest3_f, doTest3_g, doTest3_h, doTest4, doTest4_b,
doTest5, doTest5_b, doTest5_c, doTest5_e, doTest6, doTest7
];
@@ -92,7 +92,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
var domBranch;
var oldPrefVal;
- var gEventSourceObj1 = null, gEventSourceObj1_e;
+ var gEventSourceObj1 = null, gEventSourceObj1_e, gEventSourceObj1_f;
var gEventSourceObj2 = null;
var gEventSourceObj3_a = null, gEventSourceObj3_b = null,
gEventSourceObj3_c = null, gEventSourceObj3_d = null,
@@ -121,6 +121,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
// c) the close method (we expect readyState == CLOSED)
// d) the close method (we expect no message events anymore)
// e) use the default for withCredentials when passing dictionary arguments that don't explicitly set it
+// f) if a 204 HTTP response closes (interrupts) connections. See bug 869432.
function doTest1(test_id) {
gEventSourceObj1 = new EventSource("eventsource.resource");
@@ -181,6 +182,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
setTestHasFinished(test_id);
}
+ function doTest1_f(test_id) {
+ var called_on_error = false;
+
+ gEventSourceObj1_f = new EventSource("file_bug869432.eventsource");
+ gEventSourceObj1_f.onopen = function(e) {
+ ok(false, "Test 1.f failed: onopen was called");
+ };
+ gEventSourceObj1_f.onmessage = function(e) {
+ ok(false, "Test 1.f failed: onmessage was called");
+ };
+ gEventSourceObj1_f.onerror = function(e) {
+ if (called_on_error) {
+ ok(false, "Test 1.f failed: onerror was called twice");
+ }
+ called_on_error = true;
+ ok(gEventSourceObj1_f.readyState == 2, "Test 1.f failed: onerror was called with readyState = " + gEventSourceObj1_f.readyState);
+ };
+
+ setTimeout(function() { // just to clean...
+ ok(called_on_error, "Test 1.f failed: onerror was not called");
+ setTestHasFinished(test_id);
+ }, parseInt(5000*stress_factor));
+ }
+
// in order to test (2)
// a) set a eventsource that give the dom events messages
// b) expect trusted events
diff --git a/content/events/src/DOMWheelEvent.cpp b/content/events/src/DOMWheelEvent.cpp
index 96002a4c3696..a1a79295dc45 100644
--- a/content/events/src/DOMWheelEvent.cpp
+++ b/content/events/src/DOMWheelEvent.cpp
@@ -8,10 +8,6 @@
#include "nsGUIEvent.h"
#include "nsIContent.h"
#include "nsContentUtils.h"
-#include "DictionaryHelpers.h"
-#include "nsDOMClassInfoID.h"
-
-DOMCI_DATA(WheelEvent, mozilla::dom::DOMWheelEvent)
namespace mozilla {
namespace dom {
@@ -50,7 +46,6 @@ NS_IMPL_RELEASE_INHERITED(DOMWheelEvent, nsDOMMouseEvent)
NS_INTERFACE_MAP_BEGIN(DOMWheelEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMWheelEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WheelEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP
@@ -150,28 +145,6 @@ GetModifierList(bool aCtrl, bool aShift, bool aAlt, bool aMeta,
}
}
-nsresult
-DOMWheelEvent::InitFromCtor(const nsAString& aType,
- JSContext* aCx, JS::Value* aVal)
-{
- mozilla::idl::WheelEventInit d;
- nsresult rv = d.Init(aCx, aVal);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsAutoString modifierList;
- GetModifierList(d.ctrlKey, d.shiftKey, d.altKey, d.metaKey, modifierList);
-
- rv = InitWheelEvent(aType, d.bubbles, d.cancelable,
- d.view, d.detail, d.screenX, d.screenY,
- d.clientX, d.clientY, d.button, d.relatedTarget,
- modifierList, d.deltaX, d.deltaY, d.deltaZ, d.deltaMode);
- NS_ENSURE_SUCCESS(rv, rv);
-
- static_cast(mEvent)->buttons = d.buttons;
-
- return NS_OK;
-}
-
already_AddRefed
DOMWheelEvent::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
diff --git a/content/events/src/DOMWheelEvent.h b/content/events/src/DOMWheelEvent.h
index e793117182a7..931cdfebeb3c 100644
--- a/content/events/src/DOMWheelEvent.h
+++ b/content/events/src/DOMWheelEvent.h
@@ -31,9 +31,6 @@ public:
// Forward to base class
NS_FORWARD_TO_NSDOMMOUSEEVENT
- virtual nsresult InitFromCtor(const nsAString& aType,
- JSContext* aCx, JS::Value* aVal);
-
static
already_AddRefed Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
diff --git a/content/events/src/nsDOMAnimationEvent.cpp b/content/events/src/nsDOMAnimationEvent.cpp
index aef20ef864c1..749b2e7f829b 100644
--- a/content/events/src/nsDOMAnimationEvent.cpp
+++ b/content/events/src/nsDOMAnimationEvent.cpp
@@ -5,9 +5,6 @@
#include "nsDOMAnimationEvent.h"
#include "nsGUIEvent.h"
-#include "nsDOMClassInfoID.h"
-#include "nsIClassInfo.h"
-#include "nsIXPCScriptable.h"
nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
@@ -36,11 +33,8 @@ nsDOMAnimationEvent::~nsDOMAnimationEvent()
}
}
-DOMCI_DATA(AnimationEvent, nsDOMAnimationEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMAnimationEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMAnimationEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(AnimationEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMAnimationEvent, nsDOMEvent)
diff --git a/content/events/src/nsDOMBeforeUnloadEvent.cpp b/content/events/src/nsDOMBeforeUnloadEvent.cpp
index 3311ff521c78..b0387d421a35 100644
--- a/content/events/src/nsDOMBeforeUnloadEvent.cpp
+++ b/content/events/src/nsDOMBeforeUnloadEvent.cpp
@@ -3,17 +3,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/. */
-#include "nsDOMClassInfoID.h"
#include "nsDOMBeforeUnloadEvent.h"
NS_IMPL_ADDREF_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
-DOMCI_DATA(BeforeUnloadEvent, nsDOMBeforeUnloadEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMBeforeUnloadEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMBeforeUnloadEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BeforeUnloadEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
diff --git a/content/events/src/nsDOMClipboardEvent.cpp b/content/events/src/nsDOMClipboardEvent.cpp
index 49a20be09f07..e9e4ee6e5d46 100644
--- a/content/events/src/nsDOMClipboardEvent.cpp
+++ b/content/events/src/nsDOMClipboardEvent.cpp
@@ -7,8 +7,6 @@
#include "nsContentUtils.h"
#include "nsClientRect.h"
#include "nsDOMDataTransfer.h"
-#include "DictionaryHelpers.h"
-#include "nsDOMClassInfoID.h"
nsDOMClipboardEvent::nsDOMClipboardEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
@@ -33,11 +31,8 @@ nsDOMClipboardEvent::~nsDOMClipboardEvent()
}
}
-DOMCI_DATA(ClipboardEvent, nsDOMClipboardEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMClipboardEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMClipboardEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ClipboardEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMClipboardEvent, nsDOMEvent)
@@ -56,33 +51,6 @@ nsDOMClipboardEvent::InitClipboardEvent(const nsAString & aType, bool aCanBubble
return NS_OK;
}
-nsresult
-nsDOMClipboardEvent::InitFromCtor(const nsAString& aType,
- JSContext* aCx, jsval* aVal)
-{
- mozilla::idl::ClipboardEventInit d;
- nsresult rv = d.Init(aCx, aVal);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsRefPtr clipboardData;
- if (mEventIsInternal) {
- nsClipboardEvent* event = static_cast(mEvent);
- if (event) {
- // Always create a clipboardData for the copy event. If this is changed to
- // support other types of events, make sure that read/write privileges are
- // checked properly within nsDOMDataTransfer.
- // If you change this, change then also Constructor!
- clipboardData = new nsDOMDataTransfer(NS_COPY, false);
- clipboardData->SetData(d.dataType, d.data);
- }
- }
-
- rv = InitClipboardEvent(aType, d.bubbles, d.cancelable, clipboardData);
- NS_ENSURE_SUCCESS(rv, rv);
-
- return NS_OK;
-}
-
already_AddRefed
nsDOMClipboardEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType,
@@ -101,7 +69,6 @@ nsDOMClipboardEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
// Always create a clipboardData for the copy event. If this is changed to
// support other types of events, make sure that read/write privileges are
// checked properly within nsDOMDataTransfer.
- // If you change this, change then also InitFromCtor!
clipboardData = new nsDOMDataTransfer(NS_COPY, false);
clipboardData->SetData(aParam.mDataType, aParam.mData);
}
diff --git a/content/events/src/nsDOMClipboardEvent.h b/content/events/src/nsDOMClipboardEvent.h
index a351a22fde09..d2a249d1b624 100644
--- a/content/events/src/nsDOMClipboardEvent.h
+++ b/content/events/src/nsDOMClipboardEvent.h
@@ -26,9 +26,6 @@ public:
// Forward to base class
NS_FORWARD_TO_NSDOMEVENT
- nsresult InitFromCtor(const nsAString& aType,
- JSContext* aCx, jsval* aVal);
-
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle aScope) MOZ_OVERRIDE
{
diff --git a/content/events/src/nsDOMCommandEvent.cpp b/content/events/src/nsDOMCommandEvent.cpp
index 1a44c3436045..e4530566b5c6 100644
--- a/content/events/src/nsDOMCommandEvent.cpp
+++ b/content/events/src/nsDOMCommandEvent.cpp
@@ -3,7 +3,6 @@
* 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/. */
-#include "nsDOMClassInfoID.h"
#include "nsDOMCommandEvent.h"
nsDOMCommandEvent::nsDOMCommandEvent(mozilla::dom::EventTarget* aOwner,
@@ -29,11 +28,8 @@ nsDOMCommandEvent::~nsDOMCommandEvent()
}
}
-DOMCI_DATA(CommandEvent, nsDOMCommandEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMCommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMCommandEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CommandEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMCommandEvent, nsDOMEvent)
diff --git a/content/events/src/nsDOMCompositionEvent.cpp b/content/events/src/nsDOMCompositionEvent.cpp
index c7a457ca2a4b..7fae9c0ec753 100644
--- a/content/events/src/nsDOMCompositionEvent.cpp
+++ b/content/events/src/nsDOMCompositionEvent.cpp
@@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMCompositionEvent.h"
-#include "nsDOMClassInfoID.h"
nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
@@ -45,11 +44,8 @@ nsDOMCompositionEvent::~nsDOMCompositionEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMCompositionEvent, nsDOMUIEvent)
-DOMCI_DATA(CompositionEvent, nsDOMCompositionEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMCompositionEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMCompositionEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CompositionEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMETHODIMP
diff --git a/content/events/src/nsDOMDataContainerEvent.cpp b/content/events/src/nsDOMDataContainerEvent.cpp
index 2201436c8cbb..5d1fea04e4ff 100644
--- a/content/events/src/nsDOMDataContainerEvent.cpp
+++ b/content/events/src/nsDOMDataContainerEvent.cpp
@@ -4,8 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMDataContainerEvent.h"
-#include "nsDOMClassInfoID.h"
#include "nsContentUtils.h"
+#include "nsIXPConnect.h"
nsDOMDataContainerEvent::nsDOMDataContainerEvent(
mozilla::dom::EventTarget* aOwner,
@@ -31,11 +31,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsDOMDataContainerEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMDataContainerEvent, nsDOMEvent)
-DOMCI_DATA(DataContainerEvent, nsDOMDataContainerEvent)
-
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDataContainerEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDataContainerEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DataContainerEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
diff --git a/content/events/src/nsDOMDeviceMotionEvent.cpp b/content/events/src/nsDOMDeviceMotionEvent.cpp
index 4ab8645cd503..80fe7b6ec039 100644
--- a/content/events/src/nsDOMDeviceMotionEvent.cpp
+++ b/content/events/src/nsDOMDeviceMotionEvent.cpp
@@ -2,8 +2,8 @@
* 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/. */
-#include "nsDOMClassInfoID.h"
#include "nsDOMDeviceMotionEvent.h"
+#include "nsDOMClassInfoID.h"
using namespace mozilla;
using namespace mozilla::dom;
@@ -23,11 +23,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent)
-DOMCI_DATA(DeviceMotionEvent, nsDOMDeviceMotionEvent)
-
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDeviceMotionEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDeviceMotionEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DeviceMotionEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
diff --git a/content/events/src/nsDOMDragEvent.cpp b/content/events/src/nsDOMDragEvent.cpp
index 68bfac9e0623..277b7aace776 100644
--- a/content/events/src/nsDOMDragEvent.cpp
+++ b/content/events/src/nsDOMDragEvent.cpp
@@ -9,7 +9,6 @@
#include "nsContentUtils.h"
#include "nsDOMDataTransfer.h"
#include "nsIDragService.h"
-#include "nsDOMClassInfoID.h"
nsDOMDragEvent::nsDOMDragEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
@@ -41,11 +40,8 @@ nsDOMDragEvent::~nsDOMDragEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMDragEvent, nsDOMMouseEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMDragEvent, nsDOMMouseEvent)
-DOMCI_DATA(DragEvent, nsDOMDragEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMDragEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDragEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DragEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP
diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp
index 719f8e0610c0..3d3660b43c49 100644
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -128,7 +128,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEvent)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
- NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
+ NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIJSNativeInitializer, !IsDOMBinding())
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Event)
NS_INTERFACE_MAP_END
@@ -329,6 +329,7 @@ NS_IMETHODIMP
nsDOMEvent::Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
const JS::CallArgs& aArgs)
{
+ MOZ_ASSERT(!IsDOMBinding());
NS_ENSURE_TRUE(aArgs.length() >= 1, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
bool trusted = false;
@@ -471,50 +472,6 @@ nsDOMEvent::StopImmediatePropagation()
return NS_OK;
}
-static nsIDocument* GetDocumentForReport(nsEvent* aEvent)
-{
- EventTarget* target = aEvent->currentTarget;
- if (nsCOMPtr node = do_QueryInterface(target)) {
- return node->OwnerDoc();
- }
-
- if (nsCOMPtr window = do_QueryInterface(target)) {
- return window->GetExtantDoc();
- }
-
- return nullptr;
-}
-
-static void
-ReportUseOfDeprecatedMethod(nsEvent* aEvent, nsIDOMEvent* aDOMEvent,
- const char* aWarning)
-{
- nsCOMPtr doc(GetDocumentForReport(aEvent));
-
- nsAutoString type;
- aDOMEvent->GetType(type);
- const PRUnichar *strings[] = { type.get() };
- nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
- "DOM Events", doc,
- nsContentUtils::eDOM_PROPERTIES,
- aWarning,
- strings, ArrayLength(strings));
-}
-
-NS_IMETHODIMP
-nsDOMEvent::PreventBubble()
-{
- ReportUseOfDeprecatedMethod(mEvent, this, "UseOfPreventBubbleWarning");
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDOMEvent::PreventCapture()
-{
- ReportUseOfDeprecatedMethod(mEvent, this, "UseOfPreventCaptureWarning");
- return NS_OK;
-}
-
NS_IMETHODIMP
nsDOMEvent::GetIsTrusted(bool *aIsTrusted)
{
diff --git a/content/events/src/nsDOMEvent.h b/content/events/src/nsDOMEvent.h
index d9bd3a048a32..26b51b268019 100644
--- a/content/events/src/nsDOMEvent.h
+++ b/content/events/src/nsDOMEvent.h
@@ -227,8 +227,6 @@ protected:
NS_IMETHOD StopImmediatePropagation(void) { return _to StopImmediatePropagation(); } \
NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) { return _to GetOriginalTarget(aOriginalTarget); } \
NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
- NS_IMETHOD PreventBubble() { return _to PreventBubble(); } \
- NS_IMETHOD PreventCapture() { return _to PreventCapture(); } \
NS_IMETHOD GetPreventDefault(bool* aRetval) { return _to GetPreventDefault(aRetval); } \
NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \
NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \
diff --git a/content/events/src/nsDOMMessageEvent.cpp b/content/events/src/nsDOMMessageEvent.cpp
index 71ce702a8dac..a7fba4f159df 100644
--- a/content/events/src/nsDOMMessageEvent.cpp
+++ b/content/events/src/nsDOMMessageEvent.cpp
@@ -6,7 +6,6 @@
#include "nsDOMMessageEvent.h"
#include "nsContentUtils.h"
#include "jsapi.h"
-#include "nsDOMClassInfoID.h"
using namespace mozilla;
using namespace mozilla::dom;
@@ -24,11 +23,8 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
-DOMCI_DATA(MessageEvent, nsDOMMessageEvent)
-
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMMessageEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMessageEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MessageEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMMessageEvent, nsDOMEvent)
diff --git a/content/events/src/nsDOMMouseEvent.cpp b/content/events/src/nsDOMMouseEvent.cpp
index 3cadc8d46d1a..90f02d95c52f 100644
--- a/content/events/src/nsDOMMouseEvent.cpp
+++ b/content/events/src/nsDOMMouseEvent.cpp
@@ -7,8 +7,6 @@
#include "nsGUIEvent.h"
#include "nsIContent.h"
#include "nsContentUtils.h"
-#include "DictionaryHelpers.h"
-#include "nsDOMClassInfoID.h"
using namespace mozilla;
@@ -65,11 +63,8 @@ nsDOMMouseEvent::~nsDOMMouseEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMMouseEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMMouseEvent, nsDOMUIEvent)
-DOMCI_DATA(MouseEvent, nsDOMMouseEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMMouseEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MouseEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMETHODIMP
@@ -151,35 +146,6 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString& aType,
}
}
-nsresult
-nsDOMMouseEvent::InitFromCtor(const nsAString& aType,
- JSContext* aCx, JS::Value* aVal)
-{
- mozilla::idl::MouseEventInit d;
- nsresult rv = d.Init(aCx, aVal);
- NS_ENSURE_SUCCESS(rv, rv);
- rv = InitMouseEvent(aType, d.bubbles, d.cancelable,
- d.view, d.detail, d.screenX, d.screenY,
- d.clientX, d.clientY,
- d.ctrlKey, d.altKey, d.shiftKey, d.metaKey,
- d.button, d.relatedTarget);
- NS_ENSURE_SUCCESS(rv, rv);
-
- switch(mEvent->eventStructType) {
- case NS_MOUSE_EVENT:
- case NS_MOUSE_SCROLL_EVENT:
- case NS_WHEEL_EVENT:
- case NS_DRAG_EVENT:
- case NS_SIMPLE_GESTURE_EVENT:
- static_cast(mEvent)->buttons = d.buttons;
- break;
- default:
- break;
- }
-
- return NS_OK;
-}
-
already_AddRefed
nsDOMMouseEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType,
diff --git a/content/events/src/nsDOMMouseEvent.h b/content/events/src/nsDOMMouseEvent.h
index 02596957aa74..2e7e736fb105 100644
--- a/content/events/src/nsDOMMouseEvent.h
+++ b/content/events/src/nsDOMMouseEvent.h
@@ -34,9 +34,6 @@ public:
return mozilla::dom::MouseEventBinding::Wrap(aCx, aScope, this);
}
- virtual nsresult InitFromCtor(const nsAString& aType,
- JSContext* aCx, JS::Value* aVal);
-
// Web IDL binding methods
virtual uint32_t Which() MOZ_OVERRIDE
{
diff --git a/content/events/src/nsDOMMouseScrollEvent.cpp b/content/events/src/nsDOMMouseScrollEvent.cpp
index 33f46c1e28ec..f7564c2a20ec 100644
--- a/content/events/src/nsDOMMouseScrollEvent.cpp
+++ b/content/events/src/nsDOMMouseScrollEvent.cpp
@@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMMouseScrollEvent.h"
-#include "nsDOMClassInfoID.h"
nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
@@ -46,11 +45,8 @@ nsDOMMouseScrollEvent::~nsDOMMouseScrollEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent)
-DOMCI_DATA(MouseScrollEvent, nsDOMMouseScrollEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMMouseScrollEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseScrollEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MouseScrollEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP
diff --git a/content/events/src/nsDOMMutationEvent.cpp b/content/events/src/nsDOMMutationEvent.cpp
index 129a66da2718..7be385b1f236 100644
--- a/content/events/src/nsDOMMutationEvent.cpp
+++ b/content/events/src/nsDOMMutationEvent.cpp
@@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsCOMPtr.h"
-#include "nsDOMClassInfoID.h"
#include "nsDOMMutationEvent.h"
class nsPresContext;
@@ -28,11 +27,8 @@ nsDOMMutationEvent::~nsDOMMutationEvent()
}
}
-DOMCI_DATA(MutationEvent, nsDOMMutationEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMMutationEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMutationEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MutationEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMMutationEvent, nsDOMEvent)
diff --git a/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp b/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp
index c7ecbc169208..0c2d87654eb6 100644
--- a/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp
+++ b/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp
@@ -6,7 +6,6 @@
#include "nsError.h"
#include "nsDOMNotifyAudioAvailableEvent.h"
-#include "nsDOMClassInfoID.h" // DOMCI_DATA, NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO
#include "nsContentUtils.h" // NS_DROP_JS_OBJECTS
#include "jsfriendapi.h"
@@ -34,8 +33,6 @@ nsDOMNotifyAudioAvailableEvent::nsDOMNotifyAudioAvailableEvent(EventTarget* aOwn
SetIsDOMBinding();
}
-DOMCI_DATA(NotifyAudioAvailableEvent, nsDOMNotifyAudioAvailableEvent)
-
NS_IMPL_ADDREF_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)
@@ -55,7 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMNotifyAudioAvailableEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyAudioAvailableEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(NotifyAudioAvailableEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
nsDOMNotifyAudioAvailableEvent::~nsDOMNotifyAudioAvailableEvent()
diff --git a/content/events/src/nsDOMNotifyPaintEvent.cpp b/content/events/src/nsDOMNotifyPaintEvent.cpp
index 2ae6cdcdca8b..6a7e88a4e985 100644
--- a/content/events/src/nsDOMNotifyPaintEvent.cpp
+++ b/content/events/src/nsDOMNotifyPaintEvent.cpp
@@ -10,7 +10,6 @@
#include "nsClientRect.h"
#include "nsPaintRequest.h"
#include "nsIFrame.h"
-#include "nsDOMClassInfoID.h"
nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
@@ -28,11 +27,8 @@ nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
SetIsDOMBinding();
}
-DOMCI_DATA(NotifyPaintEvent, nsDOMNotifyPaintEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMNotifyPaintEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyPaintEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(NotifyPaintEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMNotifyPaintEvent, nsDOMEvent)
diff --git a/content/events/src/nsDOMScrollAreaEvent.cpp b/content/events/src/nsDOMScrollAreaEvent.cpp
index 1c50358af0eb..c08cd5324dc9 100644
--- a/content/events/src/nsDOMScrollAreaEvent.cpp
+++ b/content/events/src/nsDOMScrollAreaEvent.cpp
@@ -9,9 +9,6 @@
#include "nsDOMScrollAreaEvent.h"
#include "nsGUIEvent.h"
#include "nsClientRect.h"
-#include "nsDOMClassInfoID.h"
-#include "nsIClassInfo.h"
-#include "nsIXPCScriptable.h"
nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
@@ -36,11 +33,8 @@ nsDOMScrollAreaEvent::~nsDOMScrollAreaEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
-DOMCI_DATA(ScrollAreaEvent, nsDOMScrollAreaEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMScrollAreaEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMScrollAreaEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ScrollAreaEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
diff --git a/content/events/src/nsDOMSimpleGestureEvent.cpp b/content/events/src/nsDOMSimpleGestureEvent.cpp
index 9bcc15b38ca9..eff8c72eeebe 100644
--- a/content/events/src/nsDOMSimpleGestureEvent.cpp
+++ b/content/events/src/nsDOMSimpleGestureEvent.cpp
@@ -3,7 +3,6 @@
* 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/. */
-#include "nsDOMClassInfoID.h"
#include "nsDOMSimpleGestureEvent.h"
nsDOMSimpleGestureEvent::nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner,
@@ -36,11 +35,8 @@ nsDOMSimpleGestureEvent::~nsDOMSimpleGestureEvent()
NS_IMPL_ADDREF_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
-DOMCI_DATA(SimpleGestureEvent, nsDOMSimpleGestureEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMSimpleGestureEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMSimpleGestureEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SimpleGestureEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
/* attribute unsigned long allowedDirections; */
diff --git a/content/events/src/nsDOMTouchEvent.cpp b/content/events/src/nsDOMTouchEvent.cpp
index de1a4ecb00d7..6eb8f4d32f9f 100644
--- a/content/events/src/nsDOMTouchEvent.cpp
+++ b/content/events/src/nsDOMTouchEvent.cpp
@@ -5,9 +5,6 @@
#include "nsDOMTouchEvent.h"
#include "nsGUIEvent.h"
-#include "nsDOMClassInfoID.h"
-#include "nsIClassInfo.h"
-#include "nsIXPCScriptable.h"
#include "nsContentUtils.h"
#include "mozilla/Preferences.h"
#include "nsPresContext.h"
@@ -109,11 +106,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChangedTouches)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-DOMCI_DATA(TouchEvent, nsDOMTouchEvent)
-
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTouchEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMTouchEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TouchEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
diff --git a/content/events/src/nsDOMTransitionEvent.cpp b/content/events/src/nsDOMTransitionEvent.cpp
index cddad383017c..b44ef85c0128 100644
--- a/content/events/src/nsDOMTransitionEvent.cpp
+++ b/content/events/src/nsDOMTransitionEvent.cpp
@@ -5,9 +5,6 @@
#include "nsDOMTransitionEvent.h"
#include "nsGUIEvent.h"
-#include "nsDOMClassInfoID.h"
-#include "nsIClassInfo.h"
-#include "nsIXPCScriptable.h"
nsDOMTransitionEvent::nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
@@ -36,11 +33,8 @@ nsDOMTransitionEvent::~nsDOMTransitionEvent()
}
}
-DOMCI_DATA(TransitionEvent, nsDOMTransitionEvent)
-
NS_INTERFACE_MAP_BEGIN(nsDOMTransitionEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMTransitionEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TransitionEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMTransitionEvent, nsDOMEvent)
diff --git a/content/events/src/nsDOMUIEvent.cpp b/content/events/src/nsDOMUIEvent.cpp
index aa89bc35445f..f5d640f44fa5 100644
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -16,10 +16,8 @@
#include "nsEventStateManager.h"
#include "nsIFrame.h"
#include "nsIScrollableFrame.h"
-#include "DictionaryHelpers.h"
#include "mozilla/Util.h"
#include "mozilla/Assertions.h"
-#include "nsDOMClassInfoID.h"
using namespace mozilla;
@@ -104,11 +102,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsDOMUIEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMUIEvent, nsDOMEvent)
-DOMCI_DATA(UIEvent, nsDOMUIEvent)
-
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMUIEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMUIEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(UIEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
static nsIntPoint
@@ -186,16 +181,6 @@ nsDOMUIEvent::InitUIEvent(const nsAString& typeArg,
return NS_OK;
}
-nsresult
-nsDOMUIEvent::InitFromCtor(const nsAString& aType,
- JSContext* aCx, JS::Value* aVal)
-{
- mozilla::idl::UIEventInit d;
- nsresult rv = d.Init(aCx, aVal);
- NS_ENSURE_SUCCESS(rv, rv);
- return InitUIEvent(aType, d.bubbles, d.cancelable, d.view, d.detail);
-}
-
// ---- nsDOMNSUIEvent implementation -------------------
nsIntPoint
nsDOMUIEvent::GetPagePoint()
diff --git a/content/events/src/nsDOMUIEvent.h b/content/events/src/nsDOMUIEvent.h
index 3ae716ebe716..87f6a86f53af 100644
--- a/content/events/src/nsDOMUIEvent.h
+++ b/content/events/src/nsDOMUIEvent.h
@@ -31,9 +31,6 @@ public:
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter);
- virtual nsresult InitFromCtor(const nsAString& aType,
- JSContext* aCx, JS::Value* aVal);
-
static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
nsEvent* aEvent)
{
diff --git a/content/events/src/nsDOMXULCommandEvent.cpp b/content/events/src/nsDOMXULCommandEvent.cpp
index 9ca10f80ee15..89c99dd001da 100644
--- a/content/events/src/nsDOMXULCommandEvent.cpp
+++ b/content/events/src/nsDOMXULCommandEvent.cpp
@@ -4,7 +4,6 @@
* 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/. */
-#include "nsDOMClassInfoID.h"
#include "nsDOMXULCommandEvent.h"
nsDOMXULCommandEvent::nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
@@ -36,11 +35,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMXULCommandEvent,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-DOMCI_DATA(XULCommandEvent, nsDOMXULCommandEvent)
-
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMXULCommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMXULCommandEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XULCommandEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMETHODIMP
diff --git a/content/html/content/src/HTMLAudioElement.cpp b/content/html/content/src/HTMLAudioElement.cpp
index 9e38baa29585..f571b0464826 100644
--- a/content/html/content/src/HTMLAudioElement.cpp
+++ b/content/html/content/src/HTMLAudioElement.cpp
@@ -18,7 +18,6 @@
#include "AudioChannelCommon.h"
#include
#include "mozilla/Preferences.h"
-#include "mozilla/dom/EnableWebAudioCheck.h"
static bool
IsAudioAPIEnabled()
@@ -95,9 +94,7 @@ HTMLAudioElement::MozSetup(uint32_t aChannels, uint32_t aRate, ErrorResult& aRv)
return;
}
- if (dom::EnableWebAudioCheck::PrefEnabled()) {
- OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
- }
+ OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
// If there is already a src provided, don't setup another stream
if (mDecoder) {
diff --git a/content/html/content/src/HTMLMediaElement.cpp b/content/html/content/src/HTMLMediaElement.cpp
index acaf892cd529..dacca396de74 100644
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -66,7 +66,6 @@
#include "nsIScriptError.h"
#include "nsHostObjectProtocolHandler.h"
#include "MediaMetadataManager.h"
-#include "mozilla/dom/EnableWebAudioCheck.h"
#include "AudioChannelService.h"
@@ -3597,9 +3596,7 @@ NS_IMETHODIMP HTMLMediaElement::GetMozFragmentEnd(double* aTime)
void HTMLMediaElement::NotifyAudioAvailableListener()
{
- if (dom::EnableWebAudioCheck::PrefEnabled()) {
- OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
- }
+ OwnerDoc()->WarnOnceAbout(nsIDocument::eMozAudioData);
if (mDecoder) {
mDecoder->NotifyAudioAvailableListener();
}
diff --git a/content/svg/content/src/SVGZoomEvent.cpp b/content/svg/content/src/SVGZoomEvent.cpp
index fa2a5b5a9850..127cc403d667 100644
--- a/content/svg/content/src/SVGZoomEvent.cpp
+++ b/content/svg/content/src/SVGZoomEvent.cpp
@@ -10,8 +10,6 @@
#include "nsIDocument.h"
#include "mozilla/dom/Element.h"
-DOMCI_DATA(SVGZoomEvent, mozilla::dom::SVGZoomEvent)
-
namespace mozilla {
namespace dom {
diff --git a/content/xbl/src/nsXBLProtoImplField.cpp b/content/xbl/src/nsXBLProtoImplField.cpp
index 9808606f81e7..afa6b5e4da98 100644
--- a/content/xbl/src/nsXBLProtoImplField.cpp
+++ b/content/xbl/src/nsXBLProtoImplField.cpp
@@ -425,8 +425,7 @@ nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
JS::Rooted result(cx);
JS::CompileOptions options(cx);
options.setFileAndLine(uriSpec.get(), mLineNumber)
- .setVersion(JSVERSION_LATEST)
- .setUserBit(true); // Flag us as XBL
+ .setVersion(JSVERSION_LATEST);
rv = context->EvaluateString(nsDependentString(mFieldText,
mFieldTextLength),
wrappedNode, options,
diff --git a/content/xbl/src/nsXBLProtoImplMethod.cpp b/content/xbl/src/nsXBLProtoImplMethod.cpp
index f3d701de086a..67871f42f517 100644
--- a/content/xbl/src/nsXBLProtoImplMethod.cpp
+++ b/content/xbl/src/nsXBLProtoImplMethod.cpp
@@ -203,8 +203,7 @@ nsXBLProtoImplMethod::CompileMember(nsIScriptContext* aContext, const nsCString&
JS::CompileOptions options(cx);
options.setFileAndLine(functionUri.get(),
uncompiledMethod->mBodyText.GetLineNumber())
- .setVersion(JSVERSION_LATEST)
- .setUserBit(true); // Flag us as XBL
+ .setVersion(JSVERSION_LATEST);
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JS::RootedObject methodObject(cx);
nsresult rv = nsJSUtils::CompileFunction(cx, rootedNull, options, cname,
diff --git a/content/xbl/src/nsXBLProtoImplProperty.cpp b/content/xbl/src/nsXBLProtoImplProperty.cpp
index af29e0adfa14..4bf2fec835f5 100644
--- a/content/xbl/src/nsXBLProtoImplProperty.cpp
+++ b/content/xbl/src/nsXBLProtoImplProperty.cpp
@@ -216,8 +216,7 @@ nsXBLProtoImplProperty::CompileMember(nsIScriptContext* aContext, const nsCStrin
JSAutoCompartment ac(cx, aClassObject);
JS::CompileOptions options(cx);
options.setFileAndLine(functionUri.get(), mGetterText->GetLineNumber())
- .setVersion(JSVERSION_LATEST)
- .setUserBit(true); // Flag us as XBL
+ .setVersion(JSVERSION_LATEST);
nsCString name = NS_LITERAL_CSTRING("get_") + NS_ConvertUTF16toUTF8(mName);
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JS::RootedObject getterObject(cx);
@@ -265,8 +264,7 @@ nsXBLProtoImplProperty::CompileMember(nsIScriptContext* aContext, const nsCStrin
JSAutoCompartment ac(cx, aClassObject);
JS::CompileOptions options(cx);
options.setFileAndLine(functionUri.get(), mSetterText->GetLineNumber())
- .setVersion(JSVERSION_LATEST)
- .setUserBit(true); // Flag us as XBL
+ .setVersion(JSVERSION_LATEST);
nsCString name = NS_LITERAL_CSTRING("set_") + NS_ConvertUTF16toUTF8(mName);
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JS::RootedObject setterObject(cx);
diff --git a/content/xbl/src/nsXBLPrototypeHandler.cpp b/content/xbl/src/nsXBLPrototypeHandler.cpp
index e0ec60da9ac1..a87778bdcc8a 100644
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -384,8 +384,7 @@ nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal,
JSAutoCompartment ac(cx, scopeObject);
JS::CompileOptions options(cx);
options.setFileAndLine(bindingURI.get(), mLineNumber)
- .setVersion(JSVERSION_LATEST)
- .setUserBit(true); // Flag us as XBL
+ .setVersion(JSVERSION_LATEST);
JS::Rooted rootedNull(cx); // See bug 781070.
JS::Rooted handlerFun(cx);
diff --git a/content/xbl/src/nsXBLSerialize.cpp b/content/xbl/src/nsXBLSerialize.cpp
index efef3a423316..f48102bb37f4 100644
--- a/content/xbl/src/nsXBLSerialize.cpp
+++ b/content/xbl/src/nsXBLSerialize.cpp
@@ -25,18 +25,6 @@ XBL_DeserializeFunction(nsIScriptContext* aContext,
JS::MutableHandle aFunctionObjectp)
{
AutoPushJSContext cx(aContext->GetNativeContext());
- nsresult rv = nsContentUtils::XPConnect()->ReadFunction(aStream, cx,
- aFunctionObjectp.address());
- NS_ENSURE_SUCCESS(rv, rv);
-
- // Mark the script as XBL.
- //
- // This might be more elegantly handled as a flag via the XPConnect serialization
- // code, but that would involve profile compat issues between different builds.
- // Given that we know this code is XBL, just flag it as such.
- JSAutoRequest ar(cx);
- JSFunction* fun = JS_ValueToFunction(cx, JS::ObjectValue(*aFunctionObjectp));
- NS_ENSURE_TRUE(fun, NS_ERROR_UNEXPECTED);
- JS_SetScriptUserBit(JS_GetFunctionScript(cx, fun), true);
- return NS_OK;
+ return nsContentUtils::XPConnect()->ReadFunction(aStream, cx,
+ aFunctionObjectp.address());
}
diff --git a/dom/apps/src/PermissionsTable.jsm b/dom/apps/src/PermissionsTable.jsm
index 2f46c748af21..280bc20983a8 100644
--- a/dom/apps/src/PermissionsTable.jsm
+++ b/dom/apps/src/PermissionsTable.jsm
@@ -27,7 +27,6 @@ const DENY_ACTION = Ci.nsIPermissionManager.DENY_ACTION;
const PROMPT_ACTION = Ci.nsIPermissionManager.PROMPT_ACTION;
// Permissions Matrix: https://docs.google.com/spreadsheet/ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
-// Also, keep in sync with https://mxr.mozilla.org/mozilla-central/source/extensions/cookie/Permission.txt
// Permissions that are implicit:
// battery-status, network-information, vibration,
diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp
index 0d5c695434b0..1b109ef46f69 100644
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -60,7 +60,6 @@
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMEvent.h"
-#include "nsIDOMKeyEvent.h"
#include "nsIDOMEventListener.h"
#include "nsContentUtils.h"
#include "nsDOMWindowUtils.h"
@@ -144,31 +143,9 @@
#include "nsIDOMPermissionSettings.h"
#include "nsIDOMApplicationRegistry.h"
-#ifdef MOZ_B2G_RIL
-#include "nsIWifi.h"
-#endif
-
// includes needed for the prototype chain interfaces
#include "nsIDOMNavigator.h"
#include "nsIDOMBarProp.h"
-#include "nsIDOMDataContainerEvent.h"
-#include "nsIDOMKeyEvent.h"
-#include "nsIDOMCompositionEvent.h"
-#include "nsIDOMMouseEvent.h"
-#include "nsIDOMMouseScrollEvent.h"
-#include "nsIDOMWheelEvent.h"
-#include "nsIDOMDragEvent.h"
-#include "nsIDOMClipboardEvent.h"
-#include "nsIDOMCommandEvent.h"
-#include "nsIDOMBeforeUnloadEvent.h"
-#include "nsIDOMMutationEvent.h"
-#include "nsIDOMXULCommandEvent.h"
-#include "nsIDOMMessageEvent.h"
-#include "nsIDOMNotifyPaintEvent.h"
-#include "nsIDOMNotifyAudioAvailableEvent.h"
-#include "nsIDOMScrollAreaEvent.h"
-#include "nsIDOMTransitionEvent.h"
-#include "nsIDOMAnimationEvent.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIDOMElementCSSInlineStyle.h"
#include "nsIDOMLinkStyle.h"
@@ -187,7 +164,7 @@
#define MOZ_GENERATED_EVENTS_INCLUDES
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENTS_INCLUDES
-#include "nsIDOMDeviceMotionEvent.h"
+#include "nsIDOMDeviceMotionEvent.h" //nsIDOMDeviceAcceleration
#include "nsIDOMXULCommandDispatcher.h"
#ifndef MOZ_DISABLE_CRYPTOLEGACY
#include "nsIDOMCRMFObject.h"
@@ -249,9 +226,6 @@
#include "nsPluginArray.h"
#include "nsMimeTypeArray.h"
-// Simple gestures include
-#include "nsIDOMSimpleGestureEvent.h"
-
#include "nsIEventListenerService.h"
#include "nsIMessageManager.h"
#include "mozilla/dom/Element.h"
@@ -298,7 +272,6 @@ using mozilla::dom::workers::ResolveWorkerClasses;
#include "TelephonyCall.h"
#include "nsIDOMMozVoicemail.h"
#include "nsIDOMIccManager.h"
-#include "StkCommandEvent.h"
#include "nsIDOMMozCellBroadcast.h"
#include "nsIDOMMozCellBroadcastEvent.h"
#include "nsIDOMMobileConnection.h"
@@ -547,22 +520,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
// Event
NS_DEFINE_CLASSINFO_DATA(Event, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(MutationEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(UIEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(MouseEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(MouseScrollEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(WheelEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(DragEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(ClipboardEvent, nsDOMGenericSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(CompositionEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \
@@ -571,8 +528,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
- NS_DEFINE_CLASSINFO_DATA(DeviceMotionEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DeviceAcceleration, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DeviceRotationRate, nsDOMGenericSH,
@@ -663,9 +618,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(BeforeUnloadEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
NS_DEFINE_CLASSINFO_DATA(TimeEvent, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -714,11 +666,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
nsIXPCScriptable::DONT_ENUM_STATIC_PROPS |
nsIXPCScriptable::WANT_NEWENUMERATE)
- NS_DEFINE_CLASSINFO_DATA(XULCommandEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
- NS_DEFINE_CLASSINFO_DATA(CommandEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(OfflineResourceList, nsOfflineResourceListSH,
ARRAY_SCRIPTABLE_FLAGS)
@@ -731,12 +678,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DEFAULT_SCRIPTABLE_FLAGS |
WINDOW_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(DataContainerEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
- NS_DEFINE_CLASSINFO_DATA(MessageEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
NS_DEFINE_CLASSINFO_DATA(DeviceStorage, nsEventTargetSH,
EVENTTARGET_SCRIPTABLE_FLAGS)
@@ -788,23 +729,8 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(DataTransfer, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(NotifyPaintEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
- NS_DEFINE_CLASSINFO_DATA(NotifyAudioAvailableEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
- NS_DEFINE_CLASSINFO_DATA(SimpleGestureEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
- NS_DEFINE_CLASSINFO_DATA(ScrollAreaEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(EventListenerInfo, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(TransitionEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(AnimationEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager, nsEventTargetSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
nsIXPCScriptable::IS_GLOBAL_OBJECT)
@@ -831,15 +757,11 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBIndex, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(IDBVersionChangeEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(IDBOpenDBRequest, IDBEventTargetSH,
IDBEVENTTARGET_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TouchList, nsDOMTouchListSH,
ARRAY_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(TouchEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozCSSKeyframeRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -861,8 +783,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
EVENTTARGET_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozIccManager, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
- NS_DEFINE_CLASSINFO_DATA(MozStkCommandEvent, nsEventSH,
- DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif
#ifdef MOZ_B2G_FM
@@ -927,11 +847,6 @@ NS_DEFINE_CONTRACT_CTOR(XSLTProcessor,
return rv; \
}
-NS_DEFINE_EVENT_CTOR(UIEvent)
-NS_DEFINE_EVENT_CTOR(MouseEvent)
-NS_DEFINE_EVENT_CTOR(WheelEvent)
-NS_DEFINE_EVENT_CTOR(ClipboardEvent)
-
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \
NS_DEFINE_EVENT_CTOR(_event_interface)
@@ -954,14 +869,6 @@ static const nsConstructorFuncMapData kConstructorFuncMap[] =
{
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Blob, nsDOMMultipartFile::NewBlob)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(File, nsDOMMultipartFile::NewFile)
- NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(UIEvent)
- NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MouseEvent)
- NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(WheelEvent)
- NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(ClipboardEvent)
-#ifdef MOZ_B2G_RIL
- NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozWifiStatusChangeEvent)
- NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozWifiConnectionInfoEvent)
-#endif
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(_event_interface)
@@ -1506,10 +1413,6 @@ nsDOMClassInfo::RegisterExternalClasses()
#define DOM_CLASSINFO_EVENT_MAP_ENTRIES \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) \
-#define DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES \
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMUIEvent) \
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
-
#ifdef MOZ_B2G
#define DOM_CLASSINFO_WINDOW_MAP_ENTRIES(_support_indexed_db) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) \
@@ -1679,11 +1582,6 @@ nsDOMClassInfo::Init()
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
- DOM_CLASSINFO_MAP_BEGIN(DeviceMotionEvent, nsIDOMDeviceMotionEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceMotionEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(DeviceAcceleration, nsIDOMDeviceAcceleration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceAcceleration)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
@@ -1694,48 +1592,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(MutationEvent, nsIDOMMutationEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMutationEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(UIEvent, nsIDOMUIEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(CompositionEvent, nsIDOMCompositionEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMCompositionEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(MouseEvent, nsIDOMMouseEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(MouseScrollEvent, nsIDOMMouseScrollEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseScrollEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(WheelEvent, nsIDOMWheelEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMWheelEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(DragEvent, nsIDOMDragEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMDragEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(ClipboardEvent, nsIDOMClipboardEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMClipboardEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(HTMLFormElement, nsIDOMHTMLFormElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFormElement)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
@@ -1862,11 +1718,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(BeforeUnloadEvent, nsIDOMBeforeUnloadEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMBeforeUnloadEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
// The SVG document
DOM_CLASSINFO_MAP_BEGIN(TimeEvent, nsIDOMTimeEvent)
@@ -1925,16 +1776,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorage)
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(XULCommandEvent, nsIDOMXULCommandEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(CommandEvent, nsIDOMCommandEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMCommandEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(OfflineResourceList, nsIDOMOfflineResourceList)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMOfflineResourceList)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
@@ -1957,16 +1798,6 @@ nsDOMClassInfo::Init()
#endif
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(DataContainerEvent, nsIDOMDataContainerEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataContainerEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(MessageEvent, nsIDOMMessageEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMessageEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(DeviceStorage, nsIDOMDeviceStorage)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceStorage)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
@@ -2042,41 +1873,10 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataTransfer)
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(NotifyPaintEvent, nsIDOMNotifyPaintEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMNotifyPaintEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(NotifyAudioAvailableEvent, nsIDOMNotifyAudioAvailableEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMNotifyAudioAvailableEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(SimpleGestureEvent, nsIDOMSimpleGestureEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMSimpleGestureEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(ScrollAreaEvent, nsIDOMScrollAreaEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMScrollAreaEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(EventListenerInfo, nsIEventListenerInfo)
DOM_CLASSINFO_MAP_ENTRY(nsIEventListenerInfo)
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(TransitionEvent, nsIDOMTransitionEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMTransitionEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(AnimationEvent, nsIDOMAnimationEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMAnimationEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)
@@ -2139,11 +1939,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIIDBIndex)
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(IDBVersionChangeEvent, nsIIDBVersionChangeEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIIDBVersionChangeEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(IDBOpenDBRequest, nsIIDBOpenDBRequest)
DOM_CLASSINFO_MAP_ENTRY(nsIIDBOpenDBRequest)
DOM_CLASSINFO_MAP_ENTRY(nsIIDBRequest)
@@ -2155,12 +1950,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTouchList)
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN_MAYBE_DISABLE(TouchEvent, nsIDOMTouchEvent,
- !nsDOMTouchEvent::PrefEnabled())
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMTouchEvent)
- DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(MozCSSKeyframeRule, nsIDOMMozCSSKeyframeRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozCSSKeyframeRule)
DOM_CLASSINFO_MAP_END
@@ -2178,16 +1967,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_END
#ifdef MOZ_B2G_RIL
- DOM_CLASSINFO_MAP_BEGIN(MozWifiStatusChangeEvent, nsIDOMMozWifiStatusChangeEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozWifiStatusChangeEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
- DOM_CLASSINFO_MAP_BEGIN(MozWifiConnectionInfoEvent, nsIDOMMozWifiConnectionInfoEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozWifiConnectionInfoEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
DOM_CLASSINFO_MAP_BEGIN(Telephony, nsIDOMTelephony)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTelephony)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
@@ -2208,11 +1987,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_END
- DOM_CLASSINFO_MAP_BEGIN(MozStkCommandEvent, nsIDOMMozStkCommandEvent)
- DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozStkCommandEvent)
- DOM_CLASSINFO_EVENT_MAP_ENTRIES
- DOM_CLASSINFO_MAP_END
-
#endif
#ifdef MOZ_B2G_FM
diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h
index 75d6cd5850cd..0869bff9bc4a 100644
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -21,19 +21,10 @@ DOMCI_CLASS(Element)
// Event classes
DOMCI_CLASS(Event)
-DOMCI_CLASS(MutationEvent)
-DOMCI_CLASS(UIEvent)
-DOMCI_CLASS(MouseEvent)
-DOMCI_CLASS(MouseScrollEvent)
-DOMCI_CLASS(WheelEvent)
-DOMCI_CLASS(DragEvent)
-DOMCI_CLASS(ClipboardEvent)
-DOMCI_CLASS(CompositionEvent)
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) DOMCI_CLASS(_event_interface)
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
-DOMCI_CLASS(DeviceMotionEvent)
DOMCI_CLASS(DeviceAcceleration)
DOMCI_CLASS(DeviceRotationRate)
@@ -93,8 +84,6 @@ DOMCI_CLASS(TreeColumn)
DOMCI_CLASS(CSSMozDocumentRule)
DOMCI_CLASS(CSSSupportsRule)
-DOMCI_CLASS(BeforeUnloadEvent)
-
DOMCI_CLASS(TimeEvent)
// other SVG classes
@@ -122,8 +111,6 @@ DOMCI_CLASS(XPathResult)
// WhatWG WebApps Objects
DOMCI_CLASS(Storage)
-DOMCI_CLASS(XULCommandEvent)
-DOMCI_CLASS(CommandEvent)
DOMCI_CLASS(OfflineResourceList)
DOMCI_CLASS(Blob)
@@ -132,13 +119,6 @@ DOMCI_CLASS(File)
// DOM modal content window class, almost identical to Window
DOMCI_CLASS(ModalContentWindow)
-// Data Events
-DOMCI_CLASS(DataContainerEvent)
-
-// event used for cross-domain message-passing and for server-sent events in
-// HTML5
-DOMCI_CLASS(MessageEvent)
-
DOMCI_CLASS(DeviceStorage)
// Geolocation
@@ -166,19 +146,8 @@ DOMCI_CLASS(CSSFontFaceRule)
DOMCI_CLASS(DataTransfer)
-DOMCI_CLASS(NotifyPaintEvent)
-
-DOMCI_CLASS(NotifyAudioAvailableEvent)
-
-DOMCI_CLASS(SimpleGestureEvent)
-
-DOMCI_CLASS(ScrollAreaEvent)
-
DOMCI_CLASS(EventListenerInfo)
-DOMCI_CLASS(TransitionEvent)
-DOMCI_CLASS(AnimationEvent)
-
DOMCI_CLASS(ContentFrameMessageManager)
DOMCI_CLASS(ChromeMessageBroadcaster)
DOMCI_CLASS(ChromeMessageSender)
@@ -192,11 +161,9 @@ DOMCI_CLASS(IDBCursor)
DOMCI_CLASS(IDBCursorWithValue)
DOMCI_CLASS(IDBKeyRange)
DOMCI_CLASS(IDBIndex)
-DOMCI_CLASS(IDBVersionChangeEvent)
DOMCI_CLASS(IDBOpenDBRequest)
DOMCI_CLASS(TouchList)
-DOMCI_CLASS(TouchEvent)
DOMCI_CLASS(MozCSSKeyframeRule)
DOMCI_CLASS(MozCSSKeyframesRule)
@@ -210,7 +177,6 @@ DOMCI_CLASS(Telephony)
DOMCI_CLASS(TelephonyCall)
DOMCI_CLASS(MozVoicemail)
DOMCI_CLASS(MozIccManager)
-DOMCI_CLASS(MozStkCommandEvent)
#endif
#ifdef MOZ_B2G_FM
diff --git a/dom/bindings/BindingGen.py b/dom/bindings/BindingGen.py
index 80a8a8ed473f..312b8a171ec1 100644
--- a/dom/bindings/BindingGen.py
+++ b/dom/bindings/BindingGen.py
@@ -5,41 +5,25 @@
import os
import cPickle
from Configuration import Configuration
-from Codegen import CGBindingRoot
+from Codegen import CGBindingRoot, replaceFileIfChanged
-def generate_binding_header(config, outputprefix, srcprefix, webidlfile):
+def generate_binding_files(config, outputprefix, srcprefix, webidlfile):
"""
|config| Is the configuration object.
|outputprefix| is a prefix to use for the header guards and filename.
"""
- filename = outputprefix + ".h"
- depsname = ".deps/" + filename + ".pp"
+ depsname = ".deps/" + outputprefix + ".pp"
root = CGBindingRoot(config, outputprefix, webidlfile)
- with open(filename, 'wb') as f:
- f.write(root.declare())
+ replaceFileIfChanged(outputprefix + ".h", root.declare())
+ replaceFileIfChanged(outputprefix + ".cpp", root.define())
+
with open(depsname, 'wb') as f:
# Sort so that our output is stable
- f.write("\n".join(filename + ": " + os.path.join(srcprefix, x) for
- x in sorted(root.deps())))
-
-def generate_binding_cpp(config, outputprefix, srcprefix, webidlfile):
- """
- |config| Is the configuration object.
- |outputprefix| is a prefix to use for the header guards and filename.
- """
-
- filename = outputprefix + ".cpp"
- depsname = ".deps/" + filename + ".pp"
- root = CGBindingRoot(config, outputprefix, webidlfile)
- with open(filename, 'wb') as f:
- f.write(root.define())
- with open(depsname, 'wb') as f:
- f.write("\n".join(filename + ": " + os.path.join(srcprefix, x) for
+ f.write("\n".join(outputprefix + ": " + os.path.join(srcprefix, x) for
x in sorted(root.deps())))
def main():
-
# Parse arguments.
from optparse import OptionParser
usagestring = "usage: %prog [header|cpp] configFile outputPrefix srcPrefix webIDLFile"
@@ -48,29 +32,34 @@ def main():
help="When an error happens, display the Python traceback.")
(options, args) = o.parse_args()
- if len(args) != 5 or (args[0] != "header" and args[0] != "cpp"):
- o.error(usagestring)
- buildTarget = args[0]
- configFile = os.path.normpath(args[1])
- outputPrefix = args[2]
- srcPrefix = os.path.normpath(args[3])
- webIDLFile = os.path.normpath(args[4])
+ configFile = os.path.normpath(args[0])
+ srcPrefix = os.path.normpath(args[1])
- # Load the parsing results
+ # Load the configuration
f = open('ParserResults.pkl', 'rb')
- parserData = cPickle.load(f)
+ config = cPickle.load(f)
f.close()
- # Create the configuration data.
- config = Configuration(configFile, parserData)
+ def readFile(f):
+ file = open(f, 'rb')
+ try:
+ contents = file.read()
+ finally:
+ file.close()
+ return contents
+ allWebIDLFiles = readFile(args[2]).split()
+ changedDeps = readFile(args[3]).split()
- # Generate the prototype classes.
- if buildTarget == "header":
- generate_binding_header(config, outputPrefix, srcPrefix, webIDLFile);
- elif buildTarget == "cpp":
- generate_binding_cpp(config, outputPrefix, srcPrefix, webIDLFile);
+ if all(f.endswith("Binding") or f == "ParserResults.pkl" for f in changedDeps):
+ toRegenerate = filter(lambda f: f.endswith("Binding"), changedDeps)
+ toRegenerate = map(lambda f: f[:-len("Binding")] + ".webidl", toRegenerate)
else:
- assert False # not reached
+ toRegenerate = allWebIDLFiles
+
+ for webIDLFile in toRegenerate:
+ assert webIDLFile.endswith(".webidl")
+ outputPrefix = webIDLFile[:-len(".webidl")] + "Binding"
+ generate_binding_files(config, outputPrefix, srcPrefix, webIDLFile);
if __name__ == '__main__':
main()
diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp
index 2c04599a461c..a0dc4b68c53f 100644
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -1770,5 +1770,40 @@ Date::ToDateObject(JSContext* cx, JS::Value* vp) const
return true;
}
+bool
+GetWindowForJSImplementedObject(JSContext* cx, JS::Handle obj,
+ nsPIDOMWindow** window)
+{
+ // Be very careful to not get tricked here.
+ MOZ_ASSERT(NS_IsMainThread());
+ if (!xpc::AccessCheck::isChrome(js::GetObjectCompartment(obj))) {
+ NS_RUNTIMEABORT("Should have a chrome object here");
+ }
+
+ // Look up the content-side object.
+ JS::Rooted domImplVal(cx);
+ if (!JS_GetProperty(cx, obj, "__DOM_IMPL__", domImplVal.address())) {
+ return false;
+ }
+
+ if (!domImplVal.isObject()) {
+ ThrowErrorMessage(cx, MSG_NOT_OBJECT);
+ return false;
+ }
+
+ // Go ahead and get the global from it. GlobalObject will handle
+ // doing unwrapping as needed.
+ GlobalObject global(cx, &domImplVal.toObject());
+ if (global.Failed()) {
+ return false;
+ }
+
+ // It's OK if we have null here: that just means the content-side
+ // object really wasn't associated with any window.
+ nsCOMPtr win(do_QueryInterface(global.Get()));
+ win.forget(window);
+ return true;
+}
+
} // namespace dom
} // namespace mozilla
diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h
index 57ee39643859..98fa1309a524 100644
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -25,6 +25,8 @@
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackObject.h"
+class nsPIDOMWindow;
+
namespace mozilla {
namespace dom {
@@ -1991,6 +1993,13 @@ GetUnforgeableHolder(JSObject* aGlobal, prototypes::ID aId)
DOM_INTERFACE_PROTO_SLOTS_BASE).toObject();
}
+// Given a JSObject* that represents the chrome side of a JS-implemented WebIDL
+// interface, get the nsPIDOMWindow corresponding to the content side, if any.
+// A false return means an exception was thrown.
+bool
+GetWindowForJSImplementedObject(JSContext* cx, JS::Handle obj,
+ nsPIDOMWindow** window);
+
} // namespace dom
} // namespace mozilla
diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf
index a8c1dc5b0dbd..d6d7d594768c 100644
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -613,7 +613,6 @@ DOMInterfaces = {
'MouseEvent': {
'nativeType': 'nsDOMMouseEvent',
- 'hasXPConnectImpls': True,
},
'MouseScrollEvent': {
@@ -1071,7 +1070,6 @@ DOMInterfaces = {
'UIEvent': {
'nativeType': 'nsDOMUIEvent',
- 'hasXPConnectImpls': True
},
'UndoManager': {
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py
index 47defb16b432..21f538be1fe0 100644
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -357,7 +357,10 @@ class CGList(CGThing):
"""
def __init__(self, children, joiner=""):
CGThing.__init__(self)
- self.children = children
+ # Make a copy of the kids into a list, because if someone passes in a
+ # generator we won't be able to both declare and define ourselves, or
+ # define ourselves more than once!
+ self.children = list(children)
self.joiner = joiner
def append(self, child):
self.children.append(child)
@@ -2287,13 +2290,21 @@ class CastableObjectUnwrapper():
called by the name in the "target" argument.
codeOnFailure is the code to run if unwrapping fails.
+
+ If isCallbackReturnValue is "JSImpl" and our descriptor is also
+ JS-implemented, fall back to just creating the right object if what we
+ have isn't one already.
"""
- def __init__(self, descriptor, source, target, codeOnFailure):
+ def __init__(self, descriptor, source, target, codeOnFailure,
+ exceptionCode=None, isCallbackReturnValue=False):
+ if not exceptionCode:
+ exceptionCode = codeOnFailure
self.substitution = { "type" : descriptor.nativeType,
"protoID" : "prototypes::id::" + descriptor.name,
"source" : source,
"target" : target,
- "codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure), 4).define() }
+ "codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure)).define(),
+ "exceptionCode" : CGIndenter(CGGeneric(exceptionCode), 4).define() }
if descriptor.hasXPConnectImpls:
# We don't use xpc_qsUnwrapThis because it will always throw on
# unwrap failure, whereas we want to control whether we throw or
@@ -2311,6 +2322,26 @@ class CastableObjectUnwrapper():
"// We should have an object, too!\n"
"MOZ_ASSERT(objPtr);\n"
"${target} = objPtr;").substitute(self.substitution)), 4).define()
+ elif (isCallbackReturnValue == "JSImpl" and
+ descriptor.interface.isJSImplemented()):
+ self.substitution["codeOnFailure"] = CGIndenter(CGGeneric(string.Template(
+ "// Be careful to not wrap random DOM objects here, even if\n"
+ "// they're wrapped in opaque security wrappers for some reason.\n"
+ "// XXXbz Wish we could check for a JS-implemented object\n"
+ "// that already has a content reflection...\n"
+ "if (!IsDOMObject(js::UncheckedUnwrap(${source}))) {\n"
+ " nsCOMPtr ourWindow;\n"
+ " if (!GetWindowForJSImplementedObject(cx, Callback(), getter_AddRefs(ourWindow))) {\n"
+ "${exceptionCode}\n"
+ " }\n"
+ " JS::Rooted jsImplSourceObj(cx, ${source});\n"
+ " ${target} = new ${type}(jsImplSourceObj, ourWindow);\n"
+ "} else {\n"
+ "${codeOnFailure}\n"
+ "}").substitute(self.substitution)), 4).define()
+ else:
+ self.substitution["codeOnFailure"] = CGIndenter(
+ CGGeneric(self.substitution["codeOnFailure"])).define()
def __str__(self):
return string.Template(
@@ -2325,11 +2356,14 @@ class FailureFatalCastableObjectUnwrapper(CastableObjectUnwrapper):
"""
As CastableObjectUnwrapper, but defaulting to throwing if unwrapping fails
"""
- def __init__(self, descriptor, source, target, exceptionCode):
+ def __init__(self, descriptor, source, target, exceptionCode,
+ isCallbackReturnValue):
CastableObjectUnwrapper.__init__(
self, descriptor, source, target,
'ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "%s");\n'
- '%s' % (descriptor.name, exceptionCode))
+ '%s' % (descriptor.name, exceptionCode),
+ exceptionCode,
+ isCallbackReturnValue)
class CallbackObjectUnwrapper:
"""
@@ -2519,9 +2553,13 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
If allowTreatNonCallableAsNull is true, then [TreatNonCallableAsNull]
extended attributes on nullable callback functions will be honored.
- If isCallbackReturnValue is true, then the declType may be adjusted to make
- it easier to return from a callback. Since that type is never directly
- observable by any consumers of the callback code, this is OK.
+ If isCallbackReturnValue is "JSImpl" or "Callback", then the declType may be
+ adjusted to make it easier to return from a callback. Since that type is
+ never directly observable by any consumers of the callback code, this is OK.
+ Furthermore, if isCallbackReturnValue is "JSImpl", that affects the behavior
+ of the FailureFatalCastableObjectUnwrapper conversion; this is used for
+ implementing auto-wrapping of JS-implemented return values from a
+ JS-implemented interface.
The return value from this function is a JSToNativeConversionInfo.
"""
@@ -2998,9 +3036,14 @@ for (uint32_t i = 0; i < length; ++i) {
isCallbackReturnValue)
# Sequences and non-worker callbacks have to hold a strong ref to the
- # thing being passed down.
- forceOwningType = (descriptor.interface.isCallback() and
- not descriptor.workers) or isMember
+ # thing being passed down. Also, callback return values always end up
+ # addrefing anyway, so there is no point trying to avoid it here and it
+ # makes other things simpler since we can assume the return value is a
+ # strong ref.
+ forceOwningType = ((descriptor.interface.isCallback() and
+ not descriptor.workers) or
+ isMember or
+ isCallbackReturnValue)
typeName = descriptor.nativeType
typePtr = typeName + "*"
@@ -3050,7 +3093,8 @@ for (uint32_t i = 0; i < length; ++i) {
descriptor,
"&${val}.toObject()",
"${declName}",
- exceptionCode))
+ exceptionCode,
+ isCallbackReturnValue))
elif descriptor.workers:
return handleJSObjectType(type, isMember, failureCode)
else:
@@ -8275,7 +8319,7 @@ class CGBindingRoot(CGThing):
return self.root.deps()
class CGNativeMember(ClassMethod):
- def __init__(self, descriptor, member, name, signature, extendedAttrs,
+ def __init__(self, descriptorProvider, member, name, signature, extendedAttrs,
breakAfter=True, passCxAsNeeded=True, visibility="public",
jsObjectsArePtr=False, variadicIsSequence=False):
"""
@@ -8286,10 +8330,10 @@ class CGNativeMember(ClassMethod):
JSContext* based on the return and argument types. We can
still pass it based on 'implicitJSContext' annotations.
"""
- self.descriptor = descriptor
+ self.descriptorProvider = descriptorProvider
self.member = member
self.extendedAttrs = extendedAttrs
- self.resultAlreadyAddRefed = isResultAlreadyAddRefed(self.descriptor,
+ self.resultAlreadyAddRefed = isResultAlreadyAddRefed(self.descriptorProvider,
self.extendedAttrs)
self.passCxAsNeeded = passCxAsNeeded
self.jsObjectsArePtr = jsObjectsArePtr
@@ -8354,7 +8398,7 @@ class CGNativeMember(ClassMethod):
return enumName, defaultValue, "return ${declName};"
if type.isGeckoInterface():
iface = type.unroll().inner;
- nativeType = self.descriptor.getDescriptor(
+ nativeType = self.descriptorProvider.getDescriptor(
iface.identifier.name).nativeType
# Now trim off unnecessary namespaces
nativeType = nativeType.split("::")
@@ -8377,25 +8421,10 @@ class CGNativeMember(ClassMethod):
post=">")
else:
result = CGWrapper(result, post="*")
- if iface.isExternal():
- # The holder is an nsRefPtr. If we're nullable and end up null,
- # the holder will be null anyway, so it's safe to just always
- # return it here.
- returnCode = ("(void)${declName}; // avoid warning. May end up not being read\n"
- "return ${holderName}.forget();")
- elif iface.isCallback():
- # The decl is an OwningNonNull or nsRefPtr, depending
- # on whether we're nullable.
- returnCode = "return ${declName}.forget();"
- elif type.nullable():
- # Decl is a raw pointer
- returnCode = ("NS_IF_ADDREF(${declName});\n"
- "return dont_AddRef(${declName});")
- else:
- # Decl is a non-null raw pointer.
- returnCode = ("NS_ADDREF(${declName});\n"
- "return dont_AddRef(${declName});")
- return result.define(), "nullptr", returnCode
+ # Since we always force an owning type for callback return values,
+ # our ${declName} is an OwningNonNull or nsRefPtr. So we can just
+ # .forget() to get our already_AddRefed.
+ return result.define(), "nullptr", "return ${declName}.forget();"
if type.isCallback():
return ("already_AddRefed<%s>" % type.unroll().identifier.name,
"nullptr", "return ${declName}.forget();")
@@ -8459,12 +8488,12 @@ class CGNativeMember(ClassMethod):
args.insert(0, Argument("JS::Value", "aThisVal"))
# And jscontext bits.
if needCx(returnType, argList, self.extendedAttrs,
- self.descriptor, self.passCxAsNeeded):
+ self.descriptorProvider, self.passCxAsNeeded):
args.insert(0, Argument("JSContext*", "cx"))
# And if we're static, a global
if self.member.isStatic():
globalObjectType = "GlobalObject"
- if self.descriptor.workers:
+ if self.descriptorProvider.workers:
globalObjectType = "Worker" + globalObjectType
args.insert(0, Argument("const %s&" % globalObjectType, "global"))
return args
@@ -8514,7 +8543,7 @@ class CGNativeMember(ClassMethod):
else:
typeDecl = "%s&"
return ((typeDecl %
- self.descriptor.getDescriptor(iface.identifier.name).nativeType),
+ self.descriptorProvider.getDescriptor(iface.identifier.name).nativeType),
False, False)
if type.isSpiderMonkeyInterface():
@@ -8575,8 +8604,8 @@ class CGNativeMember(ClassMethod):
return declType, False, False
if type.isDictionary():
- typeName = CGDictionary.makeDictionaryName(type.inner,
- self.descriptor.workers)
+ typeName = CGDictionary.makeDictionaryName(
+ type.inner, self.descriptorProvider.workers)
return typeName, True, True
if type.isDate():
@@ -8914,6 +8943,7 @@ class CGJSImplMethod(CGNativeMember):
variadicIsSequence=True,
passCxAsNeeded=False)
self.signature = signature
+ self.descriptor = descriptor
if isConstructor:
self.body = self.getConstructorImpl()
else:
@@ -9159,6 +9189,10 @@ class CGJSImplClass(CGBindingImplClass):
def getGetParentObjectBody(self):
return "return mParent;"
+def isJSImplementedDescriptor(descriptorProvider):
+ return (isinstance(descriptorProvider, Descriptor) and
+ descriptorProvider.interface.isJSImplemented())
+
class CGCallback(CGClass):
def __init__(self, idlObject, descriptorProvider, baseName, methods,
getters=[], setters=[]):
@@ -9167,7 +9201,7 @@ class CGCallback(CGClass):
name = idlObject.identifier.name
if descriptorProvider.workers:
name += "Workers"
- if isinstance(descriptorProvider, Descriptor) and descriptorProvider.interface.isJSImplemented():
+ if isJSImplementedDescriptor(descriptorProvider):
name = jsImplName(name)
# For our public methods that needThisHandling we want most of the
# same args and the same return type as what CallbackMember
@@ -9391,11 +9425,15 @@ class CallbackMember(CGNativeMember):
"obj": "nullptr"
}
+ if isJSImplementedDescriptor(self.descriptorProvider):
+ isCallbackReturnValue = "JSImpl"
+ else:
+ isCallbackReturnValue = "Callback"
convertType = instantiateJSToNativeConversion(
getJSToNativeConversionInfo(self.retvalType,
- self.descriptor,
+ self.descriptorProvider,
exceptionCode=self.exceptionCode,
- isCallbackReturnValue=True),
+ isCallbackReturnValue=isCallbackReturnValue),
replacements)
assignRetval = string.Template(
self.getRetvalInfo(self.retvalType,
@@ -9443,7 +9481,7 @@ class CallbackMember(CGNativeMember):
prepend = ""
conversion = prepend + wrapForType(
- arg.type, self.descriptor,
+ arg.type, self.descriptorProvider,
{
'result' : result,
'successCode' : "continue;" if arg.variadic else "break;",
diff --git a/dom/bindings/Configuration.py b/dom/bindings/Configuration.py
index cbf51e2bfc47..f32cc5e6cf07 100644
--- a/dom/bindings/Configuration.py
+++ b/dom/bindings/Configuration.py
@@ -60,6 +60,19 @@ class Configuration:
d.nativeType != descriptor.nativeType or d == descriptor
for d in self.descriptors)
+ # Keep the descriptor list sorted for determinism.
+ self.descriptors.sort(lambda x,y: cmp(x.name, y.name))
+
+ self.descriptorsByName = {}
+ for d in self.descriptors:
+ self.descriptorsByName.setdefault(d.interface.identifier.name,
+ []).append(d)
+
+ self.descriptorsByFile = {}
+ for d in self.descriptors:
+ self.descriptorsByFile.setdefault(d.interface.filename(),
+ []).append(d)
+
self.enums = [e for e in parseData if e.isEnum()]
# Figure out what our main-thread and worker dictionaries and callbacks
@@ -90,17 +103,22 @@ class Configuration:
workerDictionaries);
flagWorkerOrMainThread(self.callbacks, mainCallbacks, workerCallbacks)
- # Keep the descriptor list sorted for determinism.
- self.descriptors.sort(lambda x,y: cmp(x.name, y.name))
-
def getInterface(self, ifname):
return self.interfaces[ifname]
def getDescriptors(self, **filters):
"""Gets the descriptors that match the given filters."""
curr = self.descriptors
+ # Collect up our filters, because we may have a webIDLFile filter that
+ # we always want to apply first.
+ tofilter = []
for key, val in filters.iteritems():
if key == 'webIDLFile':
- getter = lambda x: x.interface.filename()
+ # Special-case this part to make it fast, since most of our
+ # getDescriptors calls are conditioned on a webIDLFile. We may
+ # not have this key, in which case we have no descriptors
+ # either.
+ curr = self.descriptorsByFile.get(val, [])
+ continue
elif key == 'hasInterfaceObject':
getter = lambda x: (not x.interface.isExternal() and
x.interface.hasInterfaceObject())
@@ -118,8 +136,12 @@ class Configuration:
elif key == 'isNavigatorProperty':
getter = lambda x: x.interface.getNavigatorProperty() != None
else:
- getter = lambda x: getattr(x, key)
- curr = filter(lambda x: getter(x) == val, curr)
+ # Have to watch out: just closing over "key" is not enough,
+ # since we're about to mutate its value
+ getter = (lambda attrName: lambda x: getattr(x, attrName))(key)
+ tofilter.append((getter, val))
+ for f in tofilter:
+ curr = filter(lambda x: f[0](x) == f[1], curr)
return curr
def getEnums(self, webIDLFile):
return filter(lambda e: e.filename() == webIDLFile, self.enums)
@@ -148,17 +170,11 @@ class Configuration:
Gets the appropriate descriptor for the given interface name
and the given workers boolean.
"""
- iface = self.getInterface(interfaceName)
- descriptors = self.getDescriptors(interface=iface)
+ for d in self.descriptorsByName[interfaceName]:
+ if d.workers == workers:
+ return d
- # The only filter we currently have is workers vs non-workers.
- matches = filter(lambda x: x.workers is workers, descriptors)
-
- # After filtering, we should have exactly one result.
- if len(matches) is not 1:
- raise NoSuchDescriptorError("For " + interfaceName + " found " +
- str(len(matches)) + " matches");
- return matches[0]
+ raise NoSuchDescriptorError("For " + interfaceName + " found no matches");
def getDescriptorProvider(self, workers):
"""
Gets a descriptor provider that can provide descriptors as needed,
diff --git a/dom/bindings/ExampleGen.py b/dom/bindings/ExampleGen.py
index 3969b43c23b3..60eebe221a38 100644
--- a/dom/bindings/ExampleGen.py
+++ b/dom/bindings/ExampleGen.py
@@ -34,14 +34,11 @@ def main():
configFile = os.path.normpath(args[0])
interfaceName = args[1]
- # Load the parsing results
+ # Load the configuration
f = open('ParserResults.pkl', 'rb')
- parserData = cPickle.load(f)
+ config = cPickle.load(f)
f.close()
- # Create the configuration data.
- config = Configuration(configFile, parserData)
-
# Generate the example class.
generate_interface_example(config, interfaceName)
diff --git a/dom/bindings/GlobalGen.py b/dom/bindings/GlobalGen.py
index f8c18891fed6..f13d4250dccb 100644
--- a/dom/bindings/GlobalGen.py
+++ b/dom/bindings/GlobalGen.py
@@ -55,14 +55,14 @@ def main():
parser.parse(''.join(lines), fullPath)
parserResults = parser.finish()
- # Write the parser results out to a pickle.
- resultsFile = open('ParserResults.pkl', 'wb')
- cPickle.dump(parserResults, resultsFile, -1)
- resultsFile.close()
-
# Load the configuration.
config = Configuration(configFile, parserResults)
+ # Write the configuration out to a pickle.
+ resultsFile = open('ParserResults.pkl', 'wb')
+ cPickle.dump(config, resultsFile, -1)
+ resultsFile.close()
+
# Generate the prototype list.
generate_file(config, 'PrototypeList', 'declare')
diff --git a/dom/bindings/Makefile.in b/dom/bindings/Makefile.in
index 3e540d8dfb27..a50484321bde 100644
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -34,6 +34,15 @@ all_webidl_files += $(test_webidl_files)
binding_header_files := $(subst .webidl,Binding.h,$(all_webidl_files))
binding_cpp_files := $(subst .webidl,Binding.cpp,$(all_webidl_files))
+# We want to be able to only regenerate the .cpp and .h files that really need
+# to change when a .webidl file changes. We do this by making the
+# binding_dependency_trackers targets have dependencies on the right .webidl
+# files via generated .pp files, having a .BindingGen target that depends on the
+# binding_dependency_trackers and which has all the generated binding .h/.cpp
+# depending on it, and then in the make commands for that target being able to
+# check which exact binding_dependency_trackers changed.
+binding_dependency_trackers := $(subst .webidl,Binding,$(all_webidl_files))
+
globalgen_targets := \
PrototypeList.h \
RegisterBindings.h \
@@ -43,6 +52,18 @@ globalgen_targets := \
UnionConversions.h \
$(NULL)
+# Nasty hack: when the test/Makefile.in invokes us to do codegen, it
+# uses a target of
+# "export TestExampleInterface-example TestExampleProxyInterface-example".
+# We don't actually need to load our .o.pp files in that case, so just
+# pretend like we have no CPPSRCS if that's the target. It makes the
+# test cycle much faster, which is why we're doing it.
+#
+# XXXbz We could try to cheat even more and only include our CPPSRCS
+# when $(MAKECMDGOALS) contains libs, so that we can skip loading all
+# those .o.pp when trying to make a single .cpp file too, but that
+# would break |make FooBinding.o(bj)|. Ah, well.
+ifneq (export TestExampleInterface-example TestExampleProxyInterface-example,$(MAKECMDGOALS))
CPPSRCS = \
$(linked_binding_cpp_files) \
$(filter %.cpp, $(globalgen_targets)) \
@@ -51,6 +72,7 @@ CPPSRCS = \
CallbackObject.cpp \
DOMJSProxyHandler.cpp \
$(NULL)
+endif
LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \
-I$(topsrcdir)/js/xpconnect/wrappers \
@@ -80,11 +102,11 @@ LOCAL_INCLUDES += \
$(NULL)
endif
-EXTRA_MDDEPEND_FILES := $(addsuffix .pp,$(binding_cpp_files) $(binding_header_files))
+EXTRA_EXPORT_MDDEPEND_FILES := $(addsuffix .pp,$(binding_dependency_trackers))
EXPORTS_GENERATED_FILES := $(exported_binding_headers)
EXPORTS_GENERATED_DEST := $(DIST)/include/$(binding_include_path)
-EXPORTS_GENERATED_TARGET := webidl-export
+EXPORTS_GENERATED_TARGET := export
INSTALL_TARGETS += EXPORTS_GENERATED
ifdef GNU_CC
@@ -93,14 +115,6 @@ endif
include $(topsrcdir)/config/rules.mk
-# edmorley is sick of clobbering everytime someone adds an interface
-$(CPPOBJS): PrototypeList.h
-
-# We need to create a separate target so we can ensure that the pickle is
-# done before generating headers.
-export:: ParserResults.pkl
- $(MAKE) webidl-export
-
# If you change bindinggen_dependencies here, change it in
# dom/bindings/test/Makefile.in too.
bindinggen_dependencies := \
@@ -108,6 +122,7 @@ bindinggen_dependencies := \
Bindings.conf \
Configuration.py \
Codegen.py \
+ ParserResults.pkl \
parser/WebIDL.py \
$(GLOBAL_DEPS) \
$(NULL)
@@ -128,35 +143,20 @@ $(webidl_files): %: $(webidl_base)/%
$(test_webidl_files): %: $(srcdir)/test/%
$(INSTALL) $(IFLAGS1) $(srcdir)/test/$* .
-$(binding_header_files): %Binding.h: $(bindinggen_dependencies) \
- %.webidl \
- $(call mkdir_deps,$(MDDEPDIR)) \
- $(NULL)
- PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
- $(PLY_INCLUDE) -I$(srcdir)/parser \
- $(srcdir)/BindingGen.py header \
- $(srcdir)/Bindings.conf \
- $*Binding \
- $(CURDIR)/ \
- $*.webidl
+$(binding_header_files): .BindingGen
-$(binding_cpp_files): %Binding.cpp: $(bindinggen_dependencies) \
- $(CURDIR)/%.webidl \
- $(call mkdir_deps,$(MDDEPDIR)) \
- $(NULL)
- PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
- $(PLY_INCLUDE) -I$(srcdir)/parser \
- $(srcdir)/BindingGen.py cpp \
- $(srcdir)/Bindings.conf \
- $*Binding \
- $(CURDIR) \
- $*.webidl
+$(binding_cpp_files): .BindingGen
+
+# $(binding_dependency_trackers) pick up additional dependencies via .pp files
+$(binding_dependency_trackers):
+ # Just bring it up to date, if it's out of date, so that we'll know that
+ # we have to redo binding generation and flag this prerequisite there as
+ # being newer than the bindinggen target.
+ @$(TOUCH) $@
$(globalgen_targets): ParserResults.pkl
-%-example: $(bindinggen_dependencies) \
- ParserResults.pkl \
- $(NULL)
+%-example: .BindingGen
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/ExampleGen.py \
@@ -181,24 +181,52 @@ $(CACHE_DIR)/.done:
@$(TOUCH) $@
ParserResults.pkl: $(globalgen_dependencies)
+ # Running GlobalGen.py updates ParserResults.pkl as a side-effect
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) -I$(srcdir)/parser \
$(srcdir)/GlobalGen.py $(srcdir)/Bindings.conf . \
--cachedir=$(CACHE_DIR) \
$(all_webidl_files)
+.BindingGen: $(bindinggen_dependencies) $(binding_dependency_trackers)
+ # Make sure .deps actually exists, since we'll try to write to it from
+ # BindingGen.py but we're typically running in the export phase, which
+ # is before anyone has bothered creating .deps.
+ $(MKDIR) -p .deps
+ # Pass our long lists through files to try to avoid blowing
+ # out the command line
+ echo $(all_webidl_files) > .all-webidl-file-list
+ echo $? > .changed-dependency-list
+ # BindingGen.py will examine the changed dependency list to figure out
+ # what it really needs to regenerate.
+ $PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
+ $(PLY_INCLUDE) -I$(srcdir)/parser \
+ $(srcdir)/BindingGen.py \
+ $(srcdir)/Bindings.conf \
+ $(CURDIR) \
+ .all-webidl-file-list \
+ .changed-dependency-list
+ # Now touch the .BindingGen file so that we don't have to keep redoing
+ # all that until something else actually changes.
+ @$(TOUCH) $@
+
GARBAGE += \
webidlyacc.py \
parser.out \
$(wildcard *-example.h) \
$(wildcard *-example.cpp) \
+ .BindingGen \
+ .all-webidl-file-list \
+ .changed-dependency-list \
+ $(binding_dependency_trackers) \
$(NULL)
# Make sure all binding header files are created during the export stage, so we
# don't have issues with .cpp files being compiled before we've generated the
# headers they depend on. This is really only needed for the test files, since
-# the non-test headers are all exported above anyway.
-webidl-export:: $(binding_header_files)
+# the non-test headers are all exported above anyway. Note that this means that
+# we do all of our codegen during export.
+export:: $(binding_header_files)
distclean::
-$(RM) \
@@ -206,6 +234,5 @@ distclean::
$(binding_cpp_files) \
$(all_webidl_files) \
$(globalgen_targets) \
- ParserResults.pkl
-
-.PHONY: webidl-export
+ ParserResults.pkl \
+ $(NULL)
diff --git a/dom/bindings/test/Makefile.in b/dom/bindings/test/Makefile.in
index 3e609b524f17..64117d37fbc0 100644
--- a/dom/bindings/test/Makefile.in
+++ b/dom/bindings/test/Makefile.in
@@ -47,6 +47,7 @@ bindinggen_dependencies := \
../Bindings.conf \
../Configuration.py \
../Codegen.py \
+ ../ParserResults.pkl \
../parser/WebIDL.py \
../Makefile \
$(GLOBAL_DEPS) \
@@ -89,19 +90,18 @@ endif
# rules.mk and running make with no target in this dir does the right thing.
include $(topsrcdir)/config/rules.mk
-$(CPPSRCS): ../%Binding.cpp: $(bindinggen_dependencies) \
- ../%.webidl \
- TestExampleInterface-example \
- TestExampleProxyInterface-example \
- $(NULL)
- $(MAKE) -C .. $*Binding.h
- $(MAKE) -C .. $*Binding.cpp
+$(CPPSRCS): .BindingGen
-TestExampleInterface-example:
- $(MAKE) -C .. TestExampleInterface-example
-
-TestExampleProxyInterface-example:
- $(MAKE) -C .. TestExampleProxyInterface-example
+.BindingGen: $(bindinggen_dependencies) \
+ $(test_webidl_files) \
+ $(NULL)
+ # The export phase in dom/bindings is what actually looks at
+ # dependencies and regenerates things as needed, so just go ahead and
+ # make that phase here. Also make our example interface files. If the
+ # target used here ever changes, change the conditional around
+ # $(CPPSRCS) in dom/bindings/Makefile.in.
+ $(MAKE) -C .. export TestExampleInterface-example TestExampleProxyInterface-example
+ @$(TOUCH) $@
check::
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
@@ -110,3 +110,27 @@ check::
check-interactive:
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
$(PLY_INCLUDE) $(srcdir)/../parser/runtests.py -q
+
+# Since we define MOCHITEST_FILES, config/makefiles/mochitest.mk goes ahead and
+# sets up a rule with libs:: in itm which makes our .DEFAULT_TARGET be "libs".
+# Then ruls.mk does |.DEFAULT_TARGET ?= default| which leaves it as "libs". So
+# if we make without an explicit target in this directory, we try to make
+# "libs", but with a $(MAKECMDGOALS) of empty string. And then rules.mk
+# helpfully does not include our *.o.pp files, since it includes them only if
+# filtering some stuff out from $(MAKECMDGOALS) leaves it nonempty. The upshot
+# is that if some headers change and we run make in this dir without an explicit
+# target things don't get rebuilt.
+#
+# On the other hand, if we set .DEFAULT_TARGET to "default" explicitly here,
+# then rules.mk will reinvoke make with "export" and "libs" but this time hey
+# will be passed as explicit targets, show up in $(MAKECMDGOALS), and things
+# will work. Do this at the end of our Makefile so the rest of the build system
+# does not get a chance to muck with it after we set it.
+.DEFAULT_GOAL := default
+
+# Make sure to add .BindingGen to GARBAGE so we'll rebuild our example
+# files if someone goes through and deletes GARBAGE all over, which
+# will delete example files from our parent dir.
+GARBAGE += \
+ .BindingGen \
+ $(NULL)
diff --git a/dom/icc/src/StkCommandEvent.cpp b/dom/icc/src/StkCommandEvent.cpp
index bfe719dcaf26..d4a0ea7655f6 100644
--- a/dom/icc/src/StkCommandEvent.cpp
+++ b/dom/icc/src/StkCommandEvent.cpp
@@ -2,8 +2,6 @@
* 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/. */
-#include "nsIDOMClassInfo.h"
-#include "nsDOMClassInfoID.h"
#include "nsContentUtils.h"
#include "SimToolKit.h"
#include "StkCommandEvent.h"
@@ -12,8 +10,6 @@
#include "jsapi.h"
#include "jsfriendapi.h"
-DOMCI_DATA(MozStkCommandEvent, mozilla::dom::icc::StkCommandEvent)
-
namespace mozilla {
namespace dom {
namespace icc {
@@ -32,7 +28,6 @@ NS_IMPL_RELEASE_INHERITED(StkCommandEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN(StkCommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMozStkCommandEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozStkCommandEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
diff --git a/dom/indexedDB/IDBEvents.cpp b/dom/indexedDB/IDBEvents.cpp
index 0813823a953a..4cd19aebc725 100644
--- a/dom/indexedDB/IDBEvents.cpp
+++ b/dom/indexedDB/IDBEvents.cpp
@@ -6,7 +6,6 @@
#include "IDBEvents.h"
-#include "nsDOMClassInfoID.h"
#include "nsDOMException.h"
#include "nsJSON.h"
#include "nsThreadUtils.h"
@@ -97,11 +96,8 @@ NS_IMPL_RELEASE_INHERITED(IDBVersionChangeEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN(IDBVersionChangeEvent)
NS_INTERFACE_MAP_ENTRY(nsIIDBVersionChangeEvent)
- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(IDBVersionChangeEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
-DOMCI_DATA(IDBVersionChangeEvent, IDBVersionChangeEvent)
-
NS_IMETHODIMP
IDBVersionChangeEvent::GetOldVersion(uint64_t* aOldVersion)
{
diff --git a/dom/interfaces/events/nsIDOMClipboardEvent.idl b/dom/interfaces/events/nsIDOMClipboardEvent.idl
index 1e38befc35c0..17f09a2e7a54 100644
--- a/dom/interfaces/events/nsIDOMClipboardEvent.idl
+++ b/dom/interfaces/events/nsIDOMClipboardEvent.idl
@@ -20,9 +20,3 @@ interface nsIDOMClipboardEvent : nsIDOMEvent
in boolean cancelableArg,
in nsIDOMDataTransfer clipboardData);
};
-
-dictionary ClipboardEventInit : EventInit
-{
- DOMString data;
- DOMString dataType;
-};
diff --git a/dom/interfaces/events/nsIDOMEvent.idl b/dom/interfaces/events/nsIDOMEvent.idl
index b938b43f18ab..7035c067e15f 100644
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -44,7 +44,7 @@ class EventTarget;
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
-[scriptable, builtinclass, uuid(547ec16c-e41d-4df7-9fb6-ad6041f0687a)]
+[scriptable, builtinclass, uuid(02d54f52-a1f5-4ad2-b560-36f14012935e)]
interface nsIDOMEvent : nsISupports
{
// PhaseType
@@ -231,16 +231,6 @@ interface nsIDOMEvent : nsISupports
*/
readonly attribute nsIDOMEventTarget explicitOriginalTarget;
- /**
- * @deprecated Use nsIDOMEvent::stopPropagation.
- */
- void preventBubble();
-
- /**
- * @deprecated Use nsIDOMEvent::stopPropagation.
- */
- void preventCapture();
-
/**
* @deprecated Use nsIDOMEvent::defaultPrevented.
* To be removed in bug 691151.
diff --git a/dom/interfaces/events/nsIDOMMouseEvent.idl b/dom/interfaces/events/nsIDOMMouseEvent.idl
index e0be5994c9a2..9be6ebb34ee5 100644
--- a/dom/interfaces/events/nsIDOMMouseEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseEvent.idl
@@ -84,18 +84,3 @@ interface nsIDOMMouseEvent : nsIDOMUIEvent
bool getModifierState(in DOMString keyArg);
};
-
-dictionary MouseEventInit : UIEventInit
-{
- long screenX;
- long screenY;
- long clientX;
- long clientY;
- boolean ctrlKey;
- boolean shiftKey;
- boolean altKey;
- boolean metaKey;
- unsigned short button;
- unsigned short buttons;
- nsIDOMEventTarget relatedTarget;
-};
diff --git a/dom/interfaces/events/nsIDOMUIEvent.idl b/dom/interfaces/events/nsIDOMUIEvent.idl
index 23e4e389befa..da510b5b757b 100644
--- a/dom/interfaces/events/nsIDOMUIEvent.idl
+++ b/dom/interfaces/events/nsIDOMUIEvent.idl
@@ -39,9 +39,3 @@ interface nsIDOMUIEvent : nsIDOMEvent
readonly attribute boolean isChar;
};
-
-dictionary UIEventInit : EventInit
-{
- nsIDOMWindow view;
- long detail;
-};
diff --git a/dom/interfaces/events/nsIDOMWheelEvent.idl b/dom/interfaces/events/nsIDOMWheelEvent.idl
index b6420fcc47f1..21ffe089015a 100644
--- a/dom/interfaces/events/nsIDOMWheelEvent.idl
+++ b/dom/interfaces/events/nsIDOMWheelEvent.idl
@@ -46,11 +46,3 @@ interface nsIDOMWheelEvent : nsIDOMMouseEvent
in double deltaZArg,
in unsigned long deltaMode);
};
-
-dictionary WheelEventInit : MouseEventInit
-{
- double deltaX;
- double deltaY;
- double deltaZ;
- unsigned long deltaMode;
-};
diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties
index 0e72a1060991..0329f36f51ed 100644
--- a/dom/locales/en-US/chrome/dom/dom.properties
+++ b/dom/locales/en-US/chrome/dom/dom.properties
@@ -17,8 +17,6 @@ OnBeforeUnloadMessage=This page is asking you to confirm that you want to leave
OnBeforeUnloadStayButton=Stay on Page
OnBeforeUnloadLeaveButton=Leave Page
DocumentAllUsed=Non-standard document.all property was used. Use W3C standard document.getElementById() instead.
-UseOfPreventBubbleWarning=Event=%S, use of preventBubble() is deprecated. Use W3C standard stopPropagation() instead.
-UseOfPreventCaptureWarning=Event=%S, use of preventCapture() is deprecated. Use W3C standard stopPropagation() instead.
UseOfDOM3LoadMethodWarning=Use of Document.load() is deprecated. To upgrade your code, use the DOM XMLHttpRequest object. For more help https://developer.mozilla.org/en/XMLHttpRequest
UnexpectedCanvasVariantStyle=canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored.
EmptyGetElementByIdParam=Empty string passed to getElementById().
diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html
index dbe3f6a203e0..ceca9d0826df 100644
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -121,8 +121,6 @@ var interfaceNamesInGlobalScope =
"EventListenerInfo",
"EventSource",
"EventTarget",
- "EventTarget",
- "File",
"File",
"FileHandle",
"FileList",
@@ -254,7 +252,6 @@ var interfaceNamesInGlobalScope =
"MozApplicationEvent",
"MozBlobBuilder",
"MozBrowserFrame",
- "MozBrowserFrame",
"MozCanvasPrintState",
"MozConnection",
"MozContactChangeEvent",
@@ -335,7 +332,6 @@ var interfaceNamesInGlobalScope =
"RTCPeerConnection",
"RTCSessionDescription",
"Screen",
- "Screen",
"ScrollAreaEvent",
"Selection",
"Serializer",
@@ -505,7 +501,6 @@ var interfaceNamesInGlobalScope =
"UIEvent",
"UndoManager",
"URL",
- "URL",
"UserDataHandler",
"UserProximityEvent",
"USSDReceivedEvent",
diff --git a/dom/webidl/Event.webidl b/dom/webidl/Event.webidl
index 928bf19fb140..b96bc3fa61b5 100644
--- a/dom/webidl/Event.webidl
+++ b/dom/webidl/Event.webidl
@@ -80,8 +80,6 @@ partial interface Event {
readonly attribute EventTarget? explicitOriginalTarget;
[ChromeOnly] readonly attribute boolean multipleActionsPrevented;
- void preventBubble();
- void preventCapture();
boolean getPreventDefault();
};
diff --git a/extensions/cookie/Permission.txt b/extensions/cookie/Permission.txt
deleted file mode 100644
index ebd309d026fc..000000000000
--- a/extensions/cookie/Permission.txt
+++ /dev/null
@@ -1,136 +0,0 @@
-Permission Name
-{access types}
-API name, Bugzilla #
-Short description
-
-
-alarm
-{}
-Alarm API, 749551
-Schedule a notification, or for an application to be started, at a specific time.
-
-attentionscreen
-{}
-
-backgroundservice
-{}
-Background Services
-Enable a web application to run in the background and perform tasks like syncing or respond to incoming messages.
-
-bluetooth
-{}
-WebBluetooth, 674737
-Low level access to Bluetooth hardware.
-
-browser
-{}
-Browser API, 693515
-Enables implementing a browser completely in web technologies.
-
-camera
-{}
-Camera API
-Take photos, shoot video, control camera
-
-contacts
-{read, write, create}
-Contacts API, 674720
-Add/Read/Modify the device contacts address book and read contacts from SIM card.
-
-desktop-notification
-{}
-Desktop Notifications, 573588
-Notificatations APIs are responsible for managing notifications from web applications, and showing them on the users desktop.
-
-device-storage
-{read, write, create}
-Device Storage API
-Add/Read/Modify files stored on a central location on the device. For example the "pictures" folder on modern desktop platforms or the photo storage in mobile devices.
-
-fmradio
-{}
-FM Radio, 749053
-
-geolocation
-{}
-Geolocation API
-Obtain current location of user
-
-mobileconnection
-{}
-MobileConnection API
-This exposes information about the current mobile voice and data connection to (certain) HTML content.
-
-power
-{}
-PowerManagement API
-Turn on/off screen, cpu, device power, etc. Listen and inspect resource lock events.
-
-push
-{}
-Push Notifications, 822712
-Notify application about updates to things it registers interest in.
-
-settings
-{read, write}
-Settings API, 678695
-API to configure device settings
-
-sms
-{}
-WebSMS, 674725
-Send, Receive SMS
-
-storage
-{}
-has an additional size property that has to be "unlimited" for now.
-It will set indexedDB-unlimited, offline-app, pin-app.
-If the size property is missing or incorrect, we don't set indexedDB-unlimited, offline-app, pin-app.
-
-systemclock
-{}
-Time/Clock API, 714358
-Set current time. Timezone will go in the Settings API.
-
-network-events
-{}
-Network Events, 795136
-Receive events when a packet is downloaded or uploaded from the device.
-
-systemXHR
-{}
-Allow XMLHtppRequest from any source
-
-network-tcp
-{}
-old name: tcp-socket
-
-permissions
-{}
-
-telephony
-{}
-WebTelephony
-All Web Telephony APIs
-
-voicemail
-{}
-
-wake-lock-screen
-{}
-
-webapps-manage
-{}
-Open Webapps, 697006
-Manage all installed webapps. Allows reading resources from other packaged applications.
-
-wifi
-{}
-WiFi Information API
-Enumerate available WiFi networks, get signal strength and name of currently connected network, etc.
-
-
-In permission DB but not in manifest:
-indexedDB-unlimited
-offline-app
-pin-app
diff --git a/gfx/harfbuzz/src/hb-ot-shape-complex-arabic.cc b/gfx/harfbuzz/src/hb-ot-shape-complex-arabic.cc
index 2f069d05f618..7f8778a8e726 100644
--- a/gfx/harfbuzz/src/hb-ot-shape-complex-arabic.cc
+++ b/gfx/harfbuzz/src/hb-ot-shape-complex-arabic.cc
@@ -352,6 +352,6 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic =
NULL, /* decompose */
NULL, /* compose */
setup_masks_arabic,
- HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */
};
diff --git a/gfx/harfbuzz/src/hb-ot-shape-complex-default.cc b/gfx/harfbuzz/src/hb-ot-shape-complex-default.cc
index ca092b5e9bcc..d6afa0e1c114 100644
--- a/gfx/harfbuzz/src/hb-ot-shape-complex-default.cc
+++ b/gfx/harfbuzz/src/hb-ot-shape-complex-default.cc
@@ -215,6 +215,6 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default =
NULL, /* decompose */
compose_default,
NULL, /* setup_masks */
- HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE,
true, /* fallback_position */
};
diff --git a/gfx/harfbuzz/src/hb-ot-shape-complex-myanmar.cc b/gfx/harfbuzz/src/hb-ot-shape-complex-myanmar.cc
index ff13bdd1ebe2..e5af8930d870 100644
--- a/gfx/harfbuzz/src/hb-ot-shape-complex-myanmar.cc
+++ b/gfx/harfbuzz/src/hb-ot-shape-complex-myanmar.cc
@@ -540,6 +540,6 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar =
NULL, /* decompose */
NULL, /* compose */
setup_masks_myanmar,
- HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
false, /* fallback_position */
};
diff --git a/gfx/harfbuzz/src/hb-ot-shape-complex-private.hh b/gfx/harfbuzz/src/hb-ot-shape-complex-private.hh
index 1474a3df0701..62151baa512a 100644
--- a/gfx/harfbuzz/src/hb-ot-shape-complex-private.hh
+++ b/gfx/harfbuzz/src/hb-ot-shape-complex-private.hh
@@ -41,8 +41,10 @@
enum hb_ot_shape_zero_width_marks_type_t {
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
- HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE,
- HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF
+// HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_EARLY,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE
};
diff --git a/gfx/harfbuzz/src/hb-ot-shape-complex-thai.cc b/gfx/harfbuzz/src/hb-ot-shape-complex-thai.cc
index 5cbb6e391c27..45945339d6b7 100644
--- a/gfx/harfbuzz/src/hb-ot-shape-complex-thai.cc
+++ b/gfx/harfbuzz/src/hb-ot-shape-complex-thai.cc
@@ -373,6 +373,6 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai =
NULL, /* decompose */
NULL, /* compose */
NULL, /* setup_masks */
- HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE,
false,/* fallback_position */
};
diff --git a/gfx/harfbuzz/src/hb-ot-shape.cc b/gfx/harfbuzz/src/hb-ot-shape.cc
index f65861f959f4..6a0c7866b3f8 100644
--- a/gfx/harfbuzz/src/hb-ot-shape.cc
+++ b/gfx/harfbuzz/src/hb-ot-shape.cc
@@ -400,6 +400,30 @@ hb_ot_substitute (hb_ot_shape_context_t *c)
/* Position */
+static inline void
+zero_mark_widths_by_unicode (hb_buffer_t *buffer)
+{
+ unsigned int count = buffer->len;
+ for (unsigned int i = 0; i < count; i++)
+ if (_hb_glyph_info_get_general_category (&buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
+ {
+ buffer->pos[i].x_advance = 0;
+ buffer->pos[i].y_advance = 0;
+ }
+}
+
+static inline void
+zero_mark_widths_by_gdef (hb_buffer_t *buffer)
+{
+ unsigned int count = buffer->len;
+ for (unsigned int i = 0; i < count; i++)
+ if ((buffer->info[i].glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK))
+ {
+ buffer->pos[i].x_advance = 0;
+ buffer->pos[i].y_advance = 0;
+ }
+}
+
static inline void
hb_ot_position_default (hb_ot_shape_context_t *c)
{
@@ -419,22 +443,22 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
}
- /* Zero'ing mark widths by GDEF (as used in Myanmar spec) happens
- * *before* GPOS. */
switch (c->plan->shaper->zero_width_marks)
{
- case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF:
- for (unsigned int i = 0; i < count; i++)
- if ((c->buffer->info[i].glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK))
- {
- c->buffer->pos[i].x_advance = 0;
- c->buffer->pos[i].y_advance = 0;
- }
+ case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
+ zero_mark_widths_by_gdef (c->buffer);
break;
+ /* Not currently used for any shaper:
+ case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_EARLY:
+ zero_mark_widths_by_unicode (c->buffer);
+ break;
+ */
+
default:
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE:
- case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE:
+ case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE:
+ case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
break;
}
}
@@ -468,22 +492,20 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
ret = true;
}
- /* Zero'ing mark widths by Unicode happens
- * *after* GPOS. */
switch (c->plan->shaper->zero_width_marks)
{
- case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE:
- for (unsigned int i = 0; i < count; i++)
- if (_hb_glyph_info_get_general_category (&c->buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
- {
- c->buffer->pos[i].x_advance = 0;
- c->buffer->pos[i].y_advance = 0;
- }
+ case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE:
+ zero_mark_widths_by_unicode (c->buffer);
+ break;
+
+ case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
+ zero_mark_widths_by_gdef (c->buffer);
break;
default:
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE:
- case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF:
+ //case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_EARLY:
+ case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
break;
}
diff --git a/gfx/layers/ipc/LayerTransaction.ipdlh b/gfx/layers/ipc/LayerTransaction.ipdlh
index 9d70c0179320..6912675644a8 100644
--- a/gfx/layers/ipc/LayerTransaction.ipdlh
+++ b/gfx/layers/ipc/LayerTransaction.ipdlh
@@ -165,7 +165,7 @@ struct Animation {
// startTime, the direction, the duration, and the current time.
// The segments must uniquely cover the portion from 0.0 to 1.0
AnimationSegment[] segments;
- // How many times to repeat the animation. < 0 means "forever".
+ // How many times to repeat the animation. -1 means "forever".
float numIterations;
// This uses the NS_STYLE_ANIMATION_DIRECTION_* constants.
int32_t direction;
diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp
index 26e6c4fa6ba1..1839ff0985fc 100644
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -865,7 +865,7 @@ GrallocTextureHostOGL::GetFormat() const
}
void
-GrallocTextureHostOGL::SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator) MOZ_OVERRIDE
+GrallocTextureHostOGL::SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator)
{
MOZ_ASSERT(!mBuffer, "Will leak the old mBuffer");
mBuffer = aBuffer;
diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp
index 9805f529882f..bef515fe5b19 100644
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -410,6 +410,8 @@ gfxDWriteFontEntry::ReadCMAP()
rv = gfxFontUtils::ReadCMAP(cmapData, cmapLen,
*charmap, mUVSOffset,
unicodeFont, symbolFont);
+ } else {
+ rv = NS_ERROR_NOT_AVAILABLE;
}
mHasCmapTable = NS_SUCCEEDED(rv);
diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h
index 584e6c740d45..aa456777ada9 100644
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -310,6 +310,13 @@ public:
virtual bool TestCharacterMap(uint32_t aCh);
nsresult InitializeUVSMap();
uint16_t GetUVSGlyph(uint32_t aCh, uint32_t aVS);
+
+ // All concrete gfxFontEntry subclasses (except gfxProxyFontEntry) need
+ // to override this, otherwise the font will never be used as it will
+ // be considered to support no characters.
+ // ReadCMAP() must *always* set the mCharacterMap pointer to a valid
+ // gfxCharacterMap, even if empty, as other code assumes this pointer
+ // can be safely dereferenced.
virtual nsresult ReadCMAP();
bool TryGetSVGData();
diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm
index 48ef10e77261..edd2b92a77eb 100644
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -232,18 +232,20 @@ MacOSFontEntry::ReadCMAP()
uint32_t kCMAP = TRUETYPE_TAG('c','m','a','p');
AutoTable cmapTable(this, kCMAP);
- if (!cmapTable) {
- return NS_OK; // leave it empty
+ nsresult rv;
+
+ if (cmapTable) {
+ bool unicodeFont = false, symbolFont = false; // currently ignored
+
+ uint32_t cmapLen;
+ const char* cmapData = hb_blob_get_data(cmapTable, &cmapLen);
+ rv = gfxFontUtils::ReadCMAP((const uint8_t*)cmapData, cmapLen,
+ *charmap, mUVSOffset,
+ unicodeFont, symbolFont);
+ } else {
+ rv = NS_ERROR_NOT_AVAILABLE;
}
- bool unicodeFont = false, symbolFont = false; // currently ignored
-
- uint32_t cmapLen;
- const char* cmapData = hb_blob_get_data(cmapTable, &cmapLen);
- nsresult rv = gfxFontUtils::ReadCMAP((const uint8_t*)cmapData, cmapLen,
- *charmap, mUVSOffset,
- unicodeFont, symbolFont);
-
if (NS_SUCCEEDED(rv) && !HasGraphiteTables()) {
// We assume a Graphite font knows what it's doing,
// and provides whatever shaping is needed for the
diff --git a/gfx/thebes/gfxPangoFonts.cpp b/gfx/thebes/gfxPangoFonts.cpp
index f5a830313184..4f216dcf562b 100644
--- a/gfx/thebes/gfxPangoFonts.cpp
+++ b/gfx/thebes/gfxPangoFonts.cpp
@@ -410,14 +410,14 @@ void
gfxSystemFcFontEntry::ForgetHBFace()
{
gfxFontEntry::ForgetHBFace();
- MaybeReleaseFTFace();
+ MaybeReleaseFTFace();
}
void
gfxSystemFcFontEntry::ReleaseGrFace(gr_face* aFace)
{
gfxFontEntry::ReleaseGrFace(aFace);
- MaybeReleaseFTFace();
+ MaybeReleaseFTFace();
}
// A namespace for @font-face family names in FcPatterns so that fontconfig
diff --git a/js/public/Utility.h b/js/public/Utility.h
index c4ebf7ced6ab..ab482854da80 100644
--- a/js/public/Utility.h
+++ b/js/public/Utility.h
@@ -84,10 +84,11 @@ extern JS_PUBLIC_API(void) JS_Abort(void);
#else
# ifdef DEBUG
/*
- * In order to test OOM conditions, when the shell command-line option
- * |-A NUM| is passed, we fail continuously after the NUM'th allocation.
+ * In order to test OOM conditions, when the testing function
+ * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th
+ * allocation from now.
*/
-extern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set from shell/js.cpp */
+extern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtins/TestingFunctions.cpp */
extern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */
#ifdef JS_OOM_DO_BACKTRACES
diff --git a/js/src/Makefile.in b/js/src/Makefile.in
index 0239b66e36a3..b4b8aeb1eecc 100644
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -776,7 +776,6 @@ JS_CONFIG_SUBSTITUTIONS=\
-Dexec_prefix="$(exec_prefix)" \
-Dincludedir="$(includedir)" \
-Dlibdir="$(libdir)" \
- -DMODULE="$(MODULE)" \
-DMOZILLA_VERSION="$(MOZILLA_VERSION)" \
-DLIBRARY_NAME="$(LIBRARY_NAME)" \
-DJS_CONFIG_LIBS="$(JS_CONFIG_LIBS)" \
@@ -814,7 +813,7 @@ install:: $(LIBRARY_NAME).pc
# The overall directory structure of the installed headers looks like so:
#
# $(includedir)/
-# $(MODULE)/
+# $(LIBRARY_NAME)/
# jsapi.h, jspubtd.h, etc. (all of EXPORTS)
# js/
# js/public/* headers (all are public)
@@ -827,13 +826,13 @@ install:: $(LIBRARY_NAME).pc
#
install:: $(EXPORTS)
- $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)
+ $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(LIBRARY_NAME)
install:: $(EXPORTS_js)
- $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)/js
+ $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(LIBRARY_NAME)/js
install:: $(EXPORTS_mozilla)
- $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)/mozilla
+ $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(LIBRARY_NAME)/mozilla
#
# END SpiderMonkey header installation
diff --git a/js/src/assembler/assembler/X86Assembler.h b/js/src/assembler/assembler/X86Assembler.h
index 2c06667786ed..2671df64aeb7 100644
--- a/js/src/assembler/assembler/X86Assembler.h
+++ b/js/src/assembler/assembler/X86Assembler.h
@@ -1191,7 +1191,8 @@ public:
void cmpq_im(int imm, int offset, RegisterID base)
{
- FIXME_INSN_PRINTING;
+ spew("cmpq $%d, %s0x%x(%s)",
+ imm, PRETTY_PRINT_OFFSET(offset), nameIReg(base));
if (CAN_SIGN_EXTEND_8_32(imm)) {
m_formatter.oneByteOp64(OP_GROUP1_EvIb, GROUP1_OP_CMP, base, offset);
m_formatter.immediate8(imm);
@@ -1832,7 +1833,7 @@ public:
// is in the range ESP-EDI, and the src would not have required a REX). Unneeded
// REX prefixes are defined to be silently ignored by the processor.
spew("movzbl %s, %s",
- nameIReg(4,src), nameIReg(4,dst));
+ nameIReg(1,src), nameIReg(4,dst));
m_formatter.twoByteOp8(OP2_MOVZX_GvEb, dst, src);
}
@@ -2093,7 +2094,7 @@ public:
void cvtss2sd_rr(XMMRegisterID src, XMMRegisterID dst)
{
- spew("cvtps2pd %s, %s",
+ spew("cvtss2sd %s, %s",
nameFPReg(src), nameFPReg(dst));
m_formatter.prefix(PRE_SSE_F3);
m_formatter.twoByteOp(OP2_CVTSS2SD_VsdEd, (RegisterID)dst, (RegisterID)src);
@@ -2101,7 +2102,7 @@ public:
void cvtsd2ss_rr(XMMRegisterID src, XMMRegisterID dst)
{
- spew("cvtps2pd %s, %s",
+ spew("cvtss2sd %s, %s",
nameFPReg(src), nameFPReg(dst));
m_formatter.prefix(PRE_SSE_F2);
m_formatter.twoByteOp(OP2_CVTSD2SS_VsdEd, (RegisterID)dst, (RegisterID)src);
diff --git a/js/src/build/ConfigStatus.py b/js/src/build/ConfigStatus.py
index 92cb9baee185..d424f31c1c9b 100644
--- a/js/src/build/ConfigStatus.py
+++ b/js/src/build/ConfigStatus.py
@@ -82,7 +82,7 @@ def config_status(topobjdir = '.', topsrcdir = '.',
# Without -n, the current directory is meant to be the top object directory
if not options.not_topobjdir:
- topobjdir = '.'
+ topobjdir = os.path.abspath('.')
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
non_global_defines=non_global_defines, substs=substs)
diff --git a/js/src/build/autoconf/config.status.m4 b/js/src/build/autoconf/config.status.m4
index 1a5700082fd5..ceba24b6722b 100644
--- a/js/src/build/autoconf/config.status.m4
+++ b/js/src/build/autoconf/config.status.m4
@@ -88,7 +88,7 @@ if not os.path.isabs(topsrcdir):
rel = os.path.join(os.path.dirname(<<<__file__>>>), topsrcdir)
topsrcdir = os.path.normpath(os.path.abspath(rel))
-topobjdir = os.path.dirname(<<<__file__>>>)
+topobjdir = os.path.abspath(os.path.dirname(<<<__file__>>>))
dnl All defines and substs are stored with an additional space at the beginning
dnl and at the end of the string, to avoid any problem with values starting or
diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
index b5c3cfb9f970..57962a620e46 100644
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -731,6 +731,29 @@ CountHeap(JSContext *cx, unsigned argc, jsval *vp)
return true;
}
+#ifdef DEBUG
+static JSBool
+OOMAfterAllocations(JSContext *cx, unsigned argc, jsval *vp)
+{
+ CallArgs args = CallArgsFromVp(argc, vp);
+ if (args.length() != 1) {
+ JS_ReportError(cx, "count argument required");
+ return false;
+ }
+
+ int32_t count;
+ if (!JS_ValueToInt32(cx, args[0], &count))
+ return false;
+ if (count <= 0) {
+ JS_ReportError(cx, "count argument must be positive");
+ return false;
+ }
+
+ OOM_maxAllocations = OOM_counter + count;
+ return true;
+}
+#endif
+
static unsigned finalizeCount = 0;
static void
@@ -919,6 +942,13 @@ static JSFunctionSpecWithHelp TestingFunctions[] = {
" count all things or one of 'object', 'double', 'string', 'function'\n"
" to count only things of that kind."),
+#ifdef DEBUG
+ JS_FN_HELP("oomAfterAllocations", OOMAfterAllocations, 1, 0,
+"oomAfterAllocations(count)",
+" After 'count' js_malloc memory allocations, fail every following allocation\n"
+" (return NULL)."),
+#endif
+
JS_FN_HELP("makeFinalizeObserver", MakeFinalizeObserver, 0, 0,
"makeFinalizeObserver()",
" Get a special object whose finalization increases the counter returned\n"
diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk
index 9d1acf183dac..86f7e80fd6d7 100644
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -66,6 +66,17 @@ endif
USE_AUTOTARGETS_MK = 1
include $(topsrcdir)/config/makefiles/makeutils.mk
+# Only build with Pymake (not GNU make) on Windows.
+ifeq ($(HOST_OS_ARCH),WINNT)
+ifndef L10NBASEDIR
+ifndef .PYMAKE
+$(error Pymake is required to build on Windows. Run |./mach build| to \
+automatically use pymake or invoke pymake directly via \
+|python build/pymake/make.py|.)
+endif
+endif
+endif
+
ifdef SDK_HEADERS
_EXTRA_EXPORTS := $(filter-out $(EXPORTS),$(SDK_HEADERS))
EXPORTS += $(_EXTRA_EXPORTS)
@@ -615,8 +626,14 @@ endif
# per traversal, hence the ifdef and the export. This rule needs to come before
# other rules for the default target or else it may not run in time.
ifndef MOZBUILD_BACKEND_CHECKED
-default::
- $(MAKE) -C $(DEPTH) backend.RecursiveMakeBackend.built
+
+$(DEPTH)/backend.RecursiveMakeBackend.built:
+ @echo "Build configuration changed. Regenerating backend."
+ @cd $(DEPTH) && $(PYTHON) ./config.status
+
+include $(DEPTH)/backend.RecursiveMakeBackend.built.pp
+
+default:: $(DEPTH)/backend.RecursiveMakeBackend.built
export MOZBUILD_BACKEND_CHECKED=1
endif
@@ -1610,6 +1627,21 @@ endif
endif
endif
+
+
+ifneq (,$(filter export,$(MAKECMDGOALS)))
+MDDEPEND_FILES := $(strip $(wildcard $(addprefix $(MDDEPDIR)/,$(EXTRA_EXPORT_MDDEPEND_FILES))))
+
+ifneq (,$(MDDEPEND_FILES))
+ifdef .PYMAKE
+includedeps $(MDDEPEND_FILES)
+else
+include $(MDDEPEND_FILES)
+endif
+endif
+
+endif
+
#############################################################################
-include $(topsrcdir)/$(MOZ_BUILD_APP)/app-rules.mk
diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
index 1b35aec3acea..658659f1cace 100644
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -4356,8 +4356,7 @@ EmitFunc(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
.setCompileAndGo(parent->compileAndGo)
.setSelfHostingMode(parent->selfHosted)
.setNoScriptRval(false)
- .setVersion(parent->getVersion())
- .setUserBit(parent->userBit);
+ .setVersion(parent->getVersion());
bool generateBytecode = true;
#ifdef JS_ION
@@ -5856,6 +5855,8 @@ frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
break;
case PNK_DEBUGGER:
+ if (!UpdateSourceCoordNotes(cx, bce, pn->pn_pos.begin))
+ return false;
if (Emit1(cx, bce, JSOP_DEBUGGER) < 0)
return false;
break;
diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp
index 845052e7e5d9..ca8534b6636b 100644
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -246,6 +246,8 @@ class NameResolver
return NULL;
JSAtom *atom = buf.finishAtom();
+ if (!atom)
+ return NULL;
fun->setGuessedAtom(atom);
return atom;
}
diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp
index 1fc8ad5f6ba4..174a558c37e5 100644
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -838,7 +838,9 @@ CodeGenerator::visitOsrEntry(LOsrEntry *lir)
setOsrEntryOffset(masm.size());
// Allocate the full frame for this function.
- masm.subPtr(Imm32(frameSize()), StackPointer);
+ uint32_t size = frameSize();
+ if (size != 0)
+ masm.subPtr(Imm32(size), StackPointer);
return true;
}
diff --git a/js/src/jit-test/tests/debug/Debugger-debuggees-21.js b/js/src/jit-test/tests/debug/Debugger-debuggees-21.js
new file mode 100644
index 000000000000..fb5f1b849d8e
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Debugger-debuggees-21.js
@@ -0,0 +1,12 @@
+// Errors adding globals in addAllGlobalsAsDebuggees should be reported.
+
+// The exception that might be thrown in this test reflects our inability
+// to change compartments to debug mode while they have frames on the
+// stack. If we run this test with --debugjit, it won't throw an error at
+// all, since all compartments are already in debug mode. So, pass if the
+// script completes normally, or throws an appropriate exception.
+try {
+ newGlobal().eval("(new Debugger).addAllGlobalsAsDebuggees();");
+} catch (ex) {
+ assertEq(!!(''+ex).match(/can't start debugging: a debuggee script is on the stack/), true);
+}
diff --git a/js/src/js-config.in b/js/src/js-config.in
index a43a19af1e3a..d46a96982a99 100644
--- a/js/src/js-config.in
+++ b/js/src/js-config.in
@@ -6,7 +6,6 @@
prefix='@prefix@'
mozilla_version='@MOZILLA_VERSION@'
-MODULE='@MODULE@'
LIBRARY_NAME='@LIBRARY_NAME@'
NSPR_CFLAGS='@NSPR_CFLAGS@'
JS_CONFIG_LIBS='@JS_CONFIG_LIBS@'
@@ -110,7 +109,7 @@ if test "$echo_libdir" = "yes"; then
fi
if test "$echo_cflags" = "yes"; then
- echo "-include $includedir/$MODULE/js/RequiredDefines.h -I$includedir/$MODULE $NSPR_CFLAGS"
+ echo "-include $includedir/$LIBRARY_NAME/js/RequiredDefines.h -I$includedir/$LIBRARY_NAME $NSPR_CFLAGS"
fi
if test "$echo_libs" = "yes"; then
diff --git a/js/src/js.pc.in b/js/src/js.pc.in
index 13d761d5733e..4debb8b07806 100644
--- a/js/src/js.pc.in
+++ b/js/src/js.pc.in
@@ -8,4 +8,4 @@ Description: The Mozilla library for JavaScript
Version: @MOZILLA_VERSION@
Requires.private: @NSPR_PKGCONF_CHECK@
Libs: -L${libdir} -l@LIBRARY_NAME@
-Cflags: -include ${includedir}/@MODULE@/js/RequiredDefines.h -I${includedir}/@MODULE@
+Cflags: -include ${includedir}/@LIBRARY_NAME@/js/RequiredDefines.h -I${includedir}/@LIBRARY_NAME@
diff --git a/js/src/jsapi-tests/testIntern.cpp b/js/src/jsapi-tests/testIntern.cpp
index aef0682b5dae..96f268c1358b 100644
--- a/js/src/jsapi-tests/testIntern.cpp
+++ b/js/src/jsapi-tests/testIntern.cpp
@@ -22,7 +22,7 @@ BEGIN_TEST(testAtomizedIsNotInterned)
}
END_TEST(testAtomizedIsNotInterned)
-struct StringWrapper
+struct StringWrapperStruct
{
JSString *str;
bool strOk;
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index 9da9647219b4..114b01de5a7e 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5262,7 +5262,6 @@ JS::CompileOptions::CompileOptions(JSContext *cx)
forEval(false),
noScriptRval(cx->hasOption(JSOPTION_NO_SCRIPT_RVAL)),
selfHostingMode(false),
- userBit(false),
sourcePolicy(SAVE_SOURCE)
{
}
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index 8deb5c55aede..e10df367a865 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -3887,7 +3887,6 @@ struct JS_PUBLIC_API(CompileOptions) {
bool forEval;
bool noScriptRval;
bool selfHostingMode;
- bool userBit;
enum SourcePolicy {
NO_SOURCE,
LAZY_SOURCE,
@@ -3906,7 +3905,6 @@ struct JS_PUBLIC_API(CompileOptions) {
CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }
CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
- CompileOptions &setUserBit(bool bit) { userBit = bit; return *this; }
CompileOptions &setSourcePolicy(SourcePolicy sp) { sourcePolicy = sp; return *this; }
};
diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp
index ac68d638de18..a2b4be12def5 100644
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -599,18 +599,6 @@ JS_GetScriptVersion(JSContext *cx, JSScript *script)
return VersionNumber(script->getVersion());
}
-JS_PUBLIC_API(bool)
-JS_GetScriptUserBit(JSScript *script)
-{
- return script->userBit;
-}
-
-JS_PUBLIC_API(void)
-JS_SetScriptUserBit(JSScript *script, bool b)
-{
- script->userBit = b;
-}
-
JS_PUBLIC_API(bool)
JS_GetScriptIsSelfHosted(JSScript *script)
{
diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h
index 4907d913a08b..0ce04d7b3bf2 100644
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -224,12 +224,6 @@ JS_GetScriptLineExtent(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(JSVersion)
JS_GetScriptVersion(JSContext *cx, JSScript *script);
-extern JS_PUBLIC_API(bool)
-JS_GetScriptUserBit(JSScript *script);
-
-extern JS_PUBLIC_API(void)
-JS_SetScriptUserBit(JSScript *script, bool b);
-
extern JS_PUBLIC_API(bool)
JS_GetScriptIsSelfHosted(JSScript *script);
diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp
index 9e4f7a6264c0..48fa1af12f76 100644
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -1677,7 +1677,6 @@ JSScript::Create(JSContext *cx, HandleObject enclosingScope, bool savedCallerFun
script->setScriptSource(ss);
script->sourceStart = bufStart;
script->sourceEnd = bufEnd;
- script->userBit = options.userBit;
return script;
}
@@ -2308,8 +2307,7 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun,
.setCompileAndGo(src->compileAndGo)
.setSelfHostingMode(src->selfHosted)
.setNoScriptRval(src->noScriptRval)
- .setVersion(src->getVersion())
- .setUserBit(src->userBit);
+ .setVersion(src->getVersion());
RootedScript dst(cx, JSScript::Create(cx, enclosingScope, src->savedCallerFun,
options, src->staticLevel,
src->scriptSource(), src->sourceStart, src->sourceEnd));
diff --git a/js/src/jsscript.h b/js/src/jsscript.h
index d9d7e6243343..ddc03d945f58 100644
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -441,7 +441,6 @@ class JSScript : public js::gc::Cell
JSCompartment::debugScriptMap */
bool hasFreezeConstraints:1; /* freeze constraints for stack
* type sets have been generated */
- bool userBit:1; /* Opaque, used by the embedding. */
private:
/* See comments below. */
diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp
index 0bc645e4b5a6..d5ec5f1323c9 100644
--- a/js/src/jstypedarray.cpp
+++ b/js/src/jstypedarray.cpp
@@ -1738,6 +1738,8 @@ class TypedArrayTemplate
? UseNewTypeForInitializer(cx, script, pc, fastClass())
: GenericObject;
RootedObject obj(cx, NewBuiltinClassInstance(cx, fastClass(), newKind));
+ if (!obj)
+ return NULL;
if (script) {
if (!types::SetInitializerObjectType(cx, script, pc, obj, newKind))
diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp
index 33a87fd76961..f990b7e173db 100644
--- a/js/src/jswrapper.cpp
+++ b/js/src/jswrapper.cpp
@@ -981,6 +981,7 @@ js::RemapWrapper(JSContext *cx, JSObject *wobjArg, JSObject *newTargetArg)
// Update the entry in the compartment's wrapper map to point to the old
// wrapper, which has now been updated (via reuse or swap).
+ JS_ASSERT(wobj->isWrapper());
wcompartment->putWrapper(ObjectValue(*newTarget), ObjectValue(*wobj));
return true;
}
diff --git a/js/src/moz.build b/js/src/moz.build
index 973439e18a99..39844a4ba674 100644
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -23,9 +23,6 @@ if CONFIG['OS_ARCH'] != 'ANDROID':
TEST_DIRS += ['tests', 'gdb']
MODULE = 'js'
-if CONFIG['JS_STANDALONE']:
- MODULE = 'js-%s.%s%s' % (CONFIG['MOZJS_MAJOR_VERSION'], CONFIG['MOZJS_MINOR_VERSION'],
- CONFIG['MOZJS_ALPHA'])
CONFIGURE_SUBST_FILES += ['devtools/rootAnalysis/Makefile']
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
index 76fecd7a363f..a246b3d4191d 100644
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5262,7 +5262,6 @@ main(int argc, char **argv, char **envp)
|| !op.addBoolOption('D', "dump-bytecode", "Dump bytecode with exec count for all scripts")
|| !op.addBoolOption('b', "print-timing", "Print sub-ms runtime for each file that's run")
#ifdef DEBUG
- || !op.addIntOption('A', "oom-after", "COUNT", "Trigger OOM after COUNT allocations", -1)
|| !op.addBoolOption('O', "print-alloc", "Print the number of allocations at exit")
#endif
|| !op.addOptionalStringArg("script", "A script to execute (after all options)")
@@ -5344,8 +5343,6 @@ main(int argc, char **argv, char **envp)
* Process OOM options as early as possible so that we can observe as many
* allocations as possible.
*/
- if (op.getIntOption('A') >= 0)
- OOM_maxAllocations = op.getIntOption('A');
if (op.getBoolOption('O'))
OOM_printAllocationCount = true;
diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
index 6117ca492c0c..89cc92c83ce4 100644
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -1945,7 +1945,8 @@ Debugger::addAllGlobalsAsDebuggees(JSContext *cx, unsigned argc, Value *vp)
GlobalObject *global = c->maybeGlobal();
if (global) {
Rooted rg(cx, global);
- dbg->addDebuggeeGlobal(cx, rg, dmgc);
+ if (!dbg->addDebuggeeGlobal(cx, rg, dmgc))
+ return false;
}
}
diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp
index 9f9d71af561c..c4cfc7588c35 100644
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -24,6 +24,7 @@
#include "nsLayoutStatics.h"
#include "nsContentUtils.h"
#include "nsCCUncollectableMarker.h"
+#include "nsCycleCollectionNoteRootCallback.h"
#include "nsCycleCollectorUtils.h"
#include "nsScriptLoader.h"
#include "jsfriendapi.h"
@@ -448,7 +449,7 @@ void XPCJSRuntime::TraceXPConnectRoots(JSTracer *trc)
struct Closure
{
bool cycleCollectionEnabled;
- nsCycleCollectionTraversalCallback *cb;
+ nsCycleCollectionNoteRootCallback *cb;
};
static void
@@ -483,7 +484,7 @@ NoteJSHolder(void *holder, nsScriptObjectTracer *&tracer, void *arg)
// static
void
XPCJSRuntime::SuspectWrappedNative(XPCWrappedNative *wrapper,
- nsCycleCollectionTraversalCallback &cb)
+ nsCycleCollectionNoteRootCallback &cb)
{
if (!wrapper->IsValid() || wrapper->IsWrapperExpired())
return;
@@ -528,7 +529,7 @@ CanSkipWrappedJS(nsXPCWrappedJS *wrappedJS)
}
void
-XPCJSRuntime::AddXPConnectRoots(nsCycleCollectionTraversalCallback &cb)
+XPCJSRuntime::AddXPConnectRoots(nsCycleCollectionNoteRootCallback &cb)
{
// For all JS objects that are held by native objects but aren't held
// through rooting or locking, we need to add all the native objects that
@@ -1077,6 +1078,18 @@ class AutoLockWatchdog {
}
};
+bool
+XPCJSRuntime::IsRuntimeActive()
+{
+ return mRuntimeState == RUNTIME_ACTIVE;
+}
+
+PRTime
+XPCJSRuntime::TimeSinceLastRuntimeStateChange()
+{
+ return PR_Now() - mTimeAtLastRuntimeStateChange;
+}
+
//static
void
XPCJSRuntime::WatchdogMain(void *arg)
@@ -1091,14 +1104,19 @@ XPCJSRuntime::WatchdogMain(void *arg)
PRIntervalTime sleepInterval;
while (self->mWatchdogThread) {
// Sleep only 1 second if recently (or currently) active; otherwise, hibernate
- if (self->mLastActiveTime == -1 || PR_Now() - self->mLastActiveTime <= PRTime(2*PR_USEC_PER_SEC))
+ if (self->IsRuntimeActive() || self->TimeSinceLastRuntimeStateChange() <= PRTime(2*PR_USEC_PER_SEC))
sleepInterval = PR_TicksPerSecond();
else {
sleepInterval = PR_INTERVAL_NO_TIMEOUT;
self->mWatchdogHibernating = true;
}
MOZ_ALWAYS_TRUE(PR_WaitCondVar(self->mWatchdogWakeup, sleepInterval) == PR_SUCCESS);
- JS_TriggerOperationCallback(self->mJSRuntime);
+
+ // Don't trigger the operation callback if activity started less than one second ago.
+ // The callback is only used for detecting long running scripts, and triggering the
+ // callback from off the main thread can be expensive.
+ if (self->IsRuntimeActive() && self->TimeSinceLastRuntimeStateChange() >= PRTime(PR_USEC_PER_SEC))
+ JS_TriggerOperationCallback(self->mJSRuntime);
}
/* Wake up the main thread waiting for the watchdog to terminate. */
@@ -1112,15 +1130,14 @@ XPCJSRuntime::ActivityCallback(void *arg, JSBool active)
XPCJSRuntime* self = static_cast(arg);
AutoLockWatchdog lock(self);
-
- if (active) {
- self->mLastActiveTime = -1;
- if (self->mWatchdogHibernating) {
- self->mWatchdogHibernating = false;
- PR_NotifyCondVar(self->mWatchdogWakeup);
- }
- } else {
- self->mLastActiveTime = PR_Now();
+
+ self->mTimeAtLastRuntimeStateChange = PR_Now();
+ self->mRuntimeState = active ? RUNTIME_ACTIVE : RUNTIME_INACTIVE;
+
+ // Wake the watchdog up if it is hibernating due to a long period of inactivity.
+ if (active && self->mWatchdogHibernating) {
+ self->mWatchdogHibernating = false;
+ PR_NotifyCondVar(self->mWatchdogWakeup);
}
}
@@ -2652,7 +2669,8 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
mWatchdogWakeup(nullptr),
mWatchdogThread(nullptr),
mWatchdogHibernating(false),
- mLastActiveTime(-1),
+ mRuntimeState(RUNTIME_INACTIVE),
+ mTimeAtLastRuntimeStateChange(PR_Now()),
mJunkScope(nullptr),
mExceptionManagerNotAvailable(false)
#ifdef DEBUG
diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp
index 5b827f53b127..6759110ffcf4 100644
--- a/js/xpconnect/src/XPCWrappedNativeScope.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp
@@ -9,6 +9,7 @@
#include "XPCWrapper.h"
#include "jsproxy.h"
#include "nsContentUtils.h"
+#include "nsCycleCollectionNoteRootCallback.h"
#include "nsPrincipal.h"
#include "mozilla/Preferences.h"
@@ -415,8 +416,8 @@ WrappedNativeSuspecter(JSDHashTable *table, JSDHashEntryHdr *hdr,
XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value;
if (wrapper->HasExternalReference()) {
- nsCycleCollectionTraversalCallback *cb =
- static_cast(arg);
+ nsCycleCollectionNoteRootCallback *cb =
+ static_cast(arg);
XPCJSRuntime::SuspectWrappedNative(wrapper, *cb);
}
@@ -424,7 +425,7 @@ WrappedNativeSuspecter(JSDHashTable *table, JSDHashEntryHdr *hdr,
}
static void
-SuspectDOMExpandos(JSObject *obj, nsCycleCollectionTraversalCallback &cb)
+SuspectDOMExpandos(JSObject *obj, nsCycleCollectionNoteRootCallback &cb)
{
const dom::DOMClass* clasp = dom::GetDOMClass(obj);
MOZ_ASSERT(clasp && clasp->mDOMObjectIsISupports);
@@ -435,7 +436,7 @@ SuspectDOMExpandos(JSObject *obj, nsCycleCollectionTraversalCallback &cb)
// static
void
XPCWrappedNativeScope::SuspectAllWrappers(XPCJSRuntime* rt,
- nsCycleCollectionTraversalCallback& cb)
+ nsCycleCollectionNoteRootCallback& cb)
{
XPCAutoLock lock(rt->GetMapLock());
diff --git a/js/xpconnect/src/dictionary_helper_gen.conf b/js/xpconnect/src/dictionary_helper_gen.conf
index d5d8a4aa9a0f..7965745947cb 100644
--- a/js/xpconnect/src/dictionary_helper_gen.conf
+++ b/js/xpconnect/src/dictionary_helper_gen.conf
@@ -4,11 +4,6 @@
# Dictionary interface name, interface file name
dictionaries = [
- [ 'EventInit', 'nsIDOMEvent.idl' ],
- [ 'UIEventInit', 'nsIDOMUIEvent.idl' ],
- [ 'MouseEventInit', 'nsIDOMMouseEvent.idl' ],
- [ 'ClipboardEventInit', 'nsIDOMClipboardEvent.idl' ],
- [ 'WheelEventInit', 'nsIDOMWheelEvent.idl' ],
[ 'IDBIndexParameters', 'nsIIDBObjectStore.idl' ],
[ 'GeoPositionOptions', 'nsIDOMGeoGeolocation.idl' ],
[ 'DOMFileMetadataParameters', 'nsIDOMLockedFile.idl' ],
diff --git a/js/xpconnect/src/dom_quickstubs.qsconf b/js/xpconnect/src/dom_quickstubs.qsconf
index 5e4e6413dfa7..20203ab9017c 100644
--- a/js/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/xpconnect/src/dom_quickstubs.qsconf
@@ -53,7 +53,6 @@ members = [
# dom/interfaces/core
'nsIDOMDOMStringList.*',
- 'nsIDOMDragEvent.*',
'nsIDOMProgressEvent.lengthComputable',
'nsIDOMProgressEvent.loaded',
'nsIDOMProgressEvent.total',
@@ -110,7 +109,6 @@ members = [
'nsIIDBRequest.*',
'nsIIDBTransaction.*',
'nsIIDBOpenDBRequest.*',
- 'nsIIDBVersionChangeEvent.*',
'nsIIndexedDatabaseManager.*',
# dom/file
@@ -150,8 +148,6 @@ customIncludes = [
'nsPerformance.h',
'mozilla/dom/EventTargetBinding.h',
'mozilla/dom/EventBinding.h',
- 'mozilla/dom/MouseEventBinding.h',
- 'mozilla/dom/UIEventBinding.h',
]
nsIDOMStorage_Clear_customMethodCallCode = """
@@ -195,6 +191,4 @@ newBindingProperties = {
'nsIDOMHTMLElement': 'mozilla::dom::HTMLElementBinding::sNativePropertyHooks.mNativeProperties.regular',
'nsIDOMEventTarget': 'mozilla::dom::EventTargetBinding::sNativePropertyHooks.mNativeProperties.regular',
'nsIDOMEvent': 'mozilla::dom::EventBinding::sNativePropertyHooks.mNativeProperties.regular',
- 'nsIDOMMouseEvent': 'mozilla::dom::MouseEventBinding::sNativePropertyHooks.mNativeProperties.regular',
- 'nsIDOMUIEvent': 'mozilla::dom::UIEventBinding::sNativePropertyHooks.mNativeProperties.regular',
}
diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp
index d49a573ae243..0ce7c23a58af 100644
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -40,6 +40,7 @@
#include "mozilla/dom/DOMErrorBinding.h"
#include "nsWrapperCacheInlines.h"
+#include "nsCycleCollectionNoteRootCallback.h"
#include "nsCycleCollector.h"
#include "nsCycleCollectorUtils.h"
#include "nsDOMMutationObserver.h"
@@ -328,11 +329,11 @@ nsXPConnect::GarbageCollect(uint32_t reason)
struct NoteWeakMapChildrenTracer : public JSTracer
{
- NoteWeakMapChildrenTracer(nsCycleCollectionTraversalCallback &cb)
+ NoteWeakMapChildrenTracer(nsCycleCollectionNoteRootCallback &cb)
: mCb(cb)
{
}
- nsCycleCollectionTraversalCallback &mCb;
+ nsCycleCollectionNoteRootCallback &mCb;
bool mTracedAny;
JSObject *mMap;
void *mKey;
@@ -361,12 +362,12 @@ TraceWeakMappingChild(JSTracer *trc, void **thingp, JSGCTraceKind kind)
struct NoteWeakMapsTracer : public js::WeakMapTracer
{
NoteWeakMapsTracer(JSRuntime *rt, js::WeakMapTraceCallback cb,
- nsCycleCollectionTraversalCallback &cccb)
+ nsCycleCollectionNoteRootCallback &cccb)
: js::WeakMapTracer(rt, cb), mCb(cccb), mChildTracer(cccb)
{
JS_TracerInit(&mChildTracer, rt, TraceWeakMappingChild);
}
- nsCycleCollectionTraversalCallback &mCb;
+ nsCycleCollectionNoteRootCallback &mCb;
NoteWeakMapChildrenTracer mChildTracer;
};
@@ -486,7 +487,7 @@ nsXPConnect::FixWeakMappingGrayBits()
}
nsresult
-nsXPConnect::BeginCycleCollection(nsCycleCollectionTraversalCallback &cb)
+nsXPConnect::BeginCycleCollection(nsCycleCollectionNoteRootCallback &cb)
{
JSRuntime* rt = GetRuntime()->GetJSRuntime();
static bool gcHasRun = false;
diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
index 43cafd1f0af7..df59ecb9b86d 100644
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -522,7 +522,7 @@ public:
virtual void NotifyEnterCycleCollectionThread();
virtual void NotifyLeaveCycleCollectionThread();
virtual void NotifyEnterMainThread();
- virtual nsresult BeginCycleCollection(nsCycleCollectionTraversalCallback &cb);
+ virtual nsresult BeginCycleCollection(nsCycleCollectionNoteRootCallback &cb);
virtual nsCycleCollectionParticipant *GetParticipant();
virtual bool UsefulToMergeZones();
virtual void FixWeakMappingGrayBits();
@@ -786,7 +786,7 @@ public:
static void TraceBlackJS(JSTracer* trc, void* data);
static void TraceGrayJS(JSTracer* trc, void* data);
void TraceXPConnectRoots(JSTracer *trc);
- void AddXPConnectRoots(nsCycleCollectionTraversalCallback& cb);
+ void AddXPConnectRoots(nsCycleCollectionNoteRootCallback& cb);
void UnmarkSkippableJSHolders();
static void GCCallback(JSRuntime *rt, JSGCStatus status);
@@ -808,7 +808,7 @@ public:
#endif
static void SuspectWrappedNative(XPCWrappedNative *wrapper,
- nsCycleCollectionTraversalCallback &cb);
+ nsCycleCollectionNoteRootCallback &cb);
void DebugDump(int16_t depth);
@@ -905,6 +905,8 @@ private:
static void WatchdogMain(void *arg);
void ReleaseIncrementally(nsTArray &array);
+ bool IsRuntimeActive();
+ PRTime TimeSinceLastRuntimeStateChange();
static const char* mStrings[IDX_TOTAL_COUNT];
jsid mStrIDs[IDX_TOTAL_COUNT];
@@ -940,7 +942,8 @@ private:
PRThread *mWatchdogThread;
nsTArray extraGCCallbacks;
bool mWatchdogHibernating;
- PRTime mLastActiveTime; // -1 if active NOW
+ enum { RUNTIME_ACTIVE, RUNTIME_INACTIVE } mRuntimeState;
+ PRTime mTimeAtLastRuntimeStateChange;
nsRefPtr mReleaseRunnable;
JS::GCSliceCallback mPrevGCSliceCallback;
JSObject* mJunkScope;
@@ -1624,7 +1627,7 @@ public:
}
static void
- SuspectAllWrappers(XPCJSRuntime* rt, nsCycleCollectionTraversalCallback &cb);
+ SuspectAllWrappers(XPCJSRuntime* rt, nsCycleCollectionNoteRootCallback &cb);
static void
StartFinalizationPhaseOfGC(JSFreeOp *fop, XPCJSRuntime* rt);
diff --git a/js/xpconnect/tests/mochitest/test_bug789713.html b/js/xpconnect/tests/mochitest/test_bug789713.html
index 86d069a9d97c..bb0f857f17cc 100644
--- a/js/xpconnect/tests/mochitest/test_bug789713.html
+++ b/js/xpconnect/tests/mochitest/test_bug789713.html
@@ -28,6 +28,10 @@ function go() {
var walker = doc.createTreeWalker(doc.body);
pass = pass && (walker.root === doc.body);
+ // Grab a reference to Object.prototype to make sure we test the machinery
+ // with respect to standard prototype remapping.
+ var objProto = ifr.contentWindow.Object.prototype;
+
// First, do the document.domain operation. This shouldn't crash.
document.domain = "example.org";
diff --git a/js/xpconnect/tests/mochitest/test_bug871887.html b/js/xpconnect/tests/mochitest/test_bug871887.html
index 89599f5968f7..89239eb44bcd 100644
--- a/js/xpconnect/tests/mochitest/test_bug871887.html
+++ b/js/xpconnect/tests/mochitest/test_bug871887.html
@@ -13,14 +13,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=871887
/** Test for Bug 871887 **/
SimpleTest.waitForExplicitFinish();
- function checkpoint() {
+ // NB: onstart ends up getting invoked twice, for mysterious and potentially-
+ // IE6-related reasons.
+ function checkpoint(invocant) {
ok(true, "onstart called");
+ is(invocant, $('llama'), "this-binding is correct");
$('llama').loop = 1;
$('llama').scrollDelay = 1;
$('llama').scrollAmount = 500;
}
- function done() {
+ function done(invocant) {
+ is(invocant, $('llama'), "this-binding is correct");
ok(true, "onfinish called");
SimpleTest.finish();
}
@@ -31,7 +35,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=871887
Mozilla Bug 871887
-Watch the Llama
+Watch the Llama
diff --git a/js/xpconnect/wrappers/WrapperFactory.cpp b/js/xpconnect/wrappers/WrapperFactory.cpp
index c36a4b5a7add..0c2091a82ea5 100644
--- a/js/xpconnect/wrappers/WrapperFactory.cpp
+++ b/js/xpconnect/wrappers/WrapperFactory.cpp
@@ -172,8 +172,12 @@ WrapperFactory::PrepareForWrapping(JSContext *cx, HandleObject scope,
// COW(obj) => COW(foo) => COW(bar) => contentWin.StandardClass.prototype
//
// NB: We now remap all non-subsuming access of standard prototypes.
- bool subsumes = AccessCheck::subsumes(js::GetContextCompartment(cx),
- js::GetObjectCompartment(obj));
+ //
+ // NB: We need to ignore domain here so that the security relationship we
+ // compute here can't change over time. See the comment above the other
+ // subsumesIgnoringDomain call below.
+ bool subsumes = AccessCheck::subsumesIgnoringDomain(js::GetContextCompartment(cx),
+ js::GetObjectCompartment(obj));
XrayType xrayType = GetXrayType(obj);
if (!subsumes && xrayType == NotXray) {
JSProtoKey key = JSProto_Null;
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index d9dafe8fdb79..67b3b023ed09 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -692,22 +692,6 @@ nsFrame::GetOffsets(int32_t &aStart, int32_t &aEnd) const
return NS_OK;
}
-static bool
-EqualImages(imgIRequest *aOldImage, imgIRequest *aNewImage)
-{
- if (aOldImage == aNewImage)
- return true;
-
- if (!aOldImage || !aNewImage)
- return false;
-
- nsCOMPtr oldURI, newURI;
- aOldImage->GetURI(getter_AddRefs(oldURI));
- aNewImage->GetURI(getter_AddRefs(newURI));
- bool equal;
- return NS_SUCCEEDED(oldURI->Equals(newURI, &equal)) && equal;
-}
-
// Subclass hook for style post processing
/* virtual */ void
nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
@@ -730,7 +714,7 @@ nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, oldBG) {
// If there is an image in oldBG that's not in newBG, drop it.
if (i >= newBG->mImageCount ||
- oldBG->mLayers[i].mImage != newBG->mLayers[i].mImage) {
+ !oldBG->mLayers[i].mImage.ImageDataEquals(newBG->mLayers[i].mImage)) {
const nsStyleImage& oldImage = oldBG->mLayers[i].mImage;
if (oldImage.GetType() != eStyleImageType_Image) {
continue;
@@ -745,7 +729,7 @@ nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, newBG) {
// If there is an image in newBG that's not in oldBG, add it.
if (!oldBG || i >= oldBG->mImageCount ||
- newBG->mLayers[i].mImage != oldBG->mLayers[i].mImage) {
+ !newBG->mLayers[i].mImage.ImageDataEquals(oldBG->mLayers[i].mImage)) {
const nsStyleImage& newImage = newBG->mLayers[i].mImage;
if (newImage.GetType() != eStyleImageType_Image) {
continue;
@@ -809,7 +793,7 @@ nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
// is loaded) and paint. We also don't really care about any callers
// who try to paint borders with a different style context, because
// they won't have the correct size for the border either.
- if (!EqualImages(oldBorderImage, newBorderImage)) {
+ if (oldBorderImage != newBorderImage) {
// stop and restart the image loading/notification
if (oldBorderImage) {
imageLoader->DisassociateRequestFromFrame(oldBorderImage, this);
diff --git a/layout/reftests/text/arabic-marks-1-ref.html b/layout/reftests/text/arabic-marks-1-ref.html
new file mode 100644
index 000000000000..78c86992aa65
--- /dev/null
+++ b/layout/reftests/text/arabic-marks-1-ref.html
@@ -0,0 +1,42 @@
+
+
+
+
+bug 873902 - marks should not affect width of Arabic text
+
+
+
+
+fooالرحمن الرحيم bar
+
+
+fooالرحمن الرحيم bar
+
+
+fooالرحمن الرحيم bar
+
+
+
diff --git a/layout/reftests/text/arabic-marks-1.html b/layout/reftests/text/arabic-marks-1.html
new file mode 100644
index 000000000000..442de13ab78c
--- /dev/null
+++ b/layout/reftests/text/arabic-marks-1.html
@@ -0,0 +1,42 @@
+
+
+
+
+bug 873902 - marks should not affect width of Arabic text
+
+
+
+
+fooالرَّحْمَنِ الرَّحِيمِ bar
+
+
+fooالرَّحْمَنِ الرَّحِيمِ bar
+
+
+fooالرَّحْمَنِ الرَّحِيمِ bar
+
+
+
diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list
index fa6813fb54b7..cca53a6e0157 100644
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -157,6 +157,7 @@ skip-if(B2G) fails-if(cocoaWidget) HTTP(..) == arabic-fallback-1.html arabic-fal
fails-if(cocoaWidget) HTTP(..) == arabic-fallback-2.html arabic-fallback-2-ref.html
fails-if(cocoaWidget) HTTP(..) == arabic-fallback-3.html arabic-fallback-3-ref.html
fails-if(!cocoaWidget) HTTP(..) != arabic-fallback-4.html arabic-fallback-4-notref.html
+== arabic-marks-1.html arabic-marks-1-ref.html
== 726392-1.html 726392-1-ref.html
== 726392-2.html 726392-2-ref.html
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index a4ea2de39e91..5a9cb837f9e5 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -256,6 +256,13 @@ struct nsStyleImage {
return !(*this == aOther);
}
+ bool ImageDataEquals(const nsStyleImage& aOther) const
+ {
+ return GetType() == eStyleImageType_Image &&
+ aOther.GetType() == eStyleImageType_Image &&
+ GetImageData() == aOther.GetImageData();
+ }
+
private:
void DoCopy(const nsStyleImage& aOther);
diff --git a/layout/style/xbl-marquee/xbl-marquee.xml b/layout/style/xbl-marquee/xbl-marquee.xml
index 853e7668439e..83b74325a3e0 100644
--- a/layout/style/xbl-marquee/xbl-marquee.xml
+++ b/layout/style/xbl-marquee/xbl-marquee.xml
@@ -265,7 +265,7 @@
// NB: Make sure to wrap the constructor in parentheses to
// deal with the weird precedence of |new| in JS.
var contentFn = new (XPCNativeWrapper.unwrap(window).Function)("event", aValue);
- this["_on" + aName] = function(e) { return contentFn(e); };
+ this["_on" + aName] = function(e) { return contentFn.call(this, e); };
}
catch(e) {
return false;
diff --git a/media/mtransport/dtlsidentity.cpp b/media/mtransport/dtlsidentity.cpp
index cc10fbed6fd0..a64b2b0c9ead 100644
--- a/media/mtransport/dtlsidentity.cpp
+++ b/media/mtransport/dtlsidentity.cpp
@@ -4,6 +4,7 @@
* 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/. */
+#include "logging.h"
#include "nspr.h"
#include "cryptohi.h"
#include "ssl.h"
@@ -12,7 +13,6 @@
#include "sechash.h"
#include "nsError.h"
#include "dtlsidentity.h"
-#include "logging.h"
namespace mozilla {
diff --git a/media/mtransport/logging.h b/media/mtransport/logging.h
index bce17624294f..f5848dd40e8b 100644
--- a/media/mtransport/logging.h
+++ b/media/mtransport/logging.h
@@ -9,8 +9,16 @@
#ifndef logging_h__
#define logging_h__
-#include
+#if defined(PR_LOG)
+#error "Must #include logging.h before before any IPDL-generated files or other files that #include prlog.h."
+#endif
+// Enforce logging under production builds for MOZ_MTLOG friends.
+#ifndef PR_LOGGING
+#define FORCE_PR_LOG 1
+#endif
+
+#include
#include
#if defined(PR_LOGGING)
@@ -31,7 +39,6 @@
PR_LOG(getLogModule(), level, ("%s", str.str().c_str())); } while(0)
#else
-
// PR_LOGGING is off --> make no-op MTLOG macros
#define MOZ_MTLOG_MODULE(n)
#define MOZ_MTLOG(level, b)
diff --git a/media/mtransport/nr_socket_prsock.cpp b/media/mtransport/nr_socket_prsock.cpp
index ea4288874cda..11e647a14840 100644
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -330,7 +330,7 @@ int NrSocket::create(nr_transport_addr *addr) {
ABORT(R_INTERNAL);
}
- r_log(LOG_GENERIC,LOG_DEBUG,"Creating socket %d with addr %s",
+ r_log(LOG_GENERIC,LOG_DEBUG,"Creating socket %p with addr %s",
fd_, addr->as_string);
nr_transport_addr_copy(&my_addr_,addr);
diff --git a/media/mtransport/nricectx.cpp b/media/mtransport/nricectx.cpp
index a2865bc55721..1e74e8bc2110 100644
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -44,10 +44,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include
#include
+#include "logging.h"
#include "nspr.h"
#include "nss.h"
#include "pk11pub.h"
-#include "prlog.h"
#include "nsCOMPtr.h"
#include "nsComponentManagerUtils.h"
@@ -79,7 +79,6 @@ extern "C" {
}
// Local includes
-#include "logging.h"
#include "nricectx.h"
#include "nricemediastream.h"
#include "nr_socket_prsock.h"
diff --git a/media/mtransport/nricemediastream.cpp b/media/mtransport/nricemediastream.cpp
index 98cfb6893467..4c815b0a53a7 100644
--- a/media/mtransport/nricemediastream.cpp
+++ b/media/mtransport/nricemediastream.cpp
@@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include
#include
+#include "logging.h"
#include "nsError.h"
// nICEr includes
@@ -64,7 +65,6 @@ extern "C" {
}
// Local includes
-#include "logging.h"
#include "nricectx.h"
#include "nricemediastream.h"
diff --git a/media/mtransport/nriceresolver.cpp b/media/mtransport/nriceresolver.cpp
index 3447166ad811..48d9c4500d8d 100644
--- a/media/mtransport/nriceresolver.cpp
+++ b/media/mtransport/nriceresolver.cpp
@@ -41,6 +41,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "logging.h"
#include "nspr.h"
#include "prnetdb.h"
@@ -65,9 +66,6 @@ extern "C" {
#include "nr_socket_prsock.h"
#include "mtransport/runnable_utils.h"
-// Local includes
-#include "logging.h"
-
namespace mozilla {
MOZ_MTLOG_MODULE("mtransport")
diff --git a/media/mtransport/test/ice_unittest.cpp b/media/mtransport/test/ice_unittest.cpp
index 092be8a436f1..54fcea953d62 100644
--- a/media/mtransport/test/ice_unittest.cpp
+++ b/media/mtransport/test/ice_unittest.cpp
@@ -13,6 +13,7 @@
#include "sigslot.h"
+#include "logging.h"
#include "nspr.h"
#include "nss.h"
#include "ssl.h"
@@ -21,7 +22,6 @@
#include "nsThreadUtils.h"
#include "nsXPCOM.h"
-#include "logging.h"
#include "nricectx.h"
#include "nricemediastream.h"
#include "nriceresolverfake.h"
diff --git a/media/mtransport/test/sctp_unittest.cpp b/media/mtransport/test/sctp_unittest.cpp
index 19e74d69a190..471d2083df52 100644
--- a/media/mtransport/test/sctp_unittest.cpp
+++ b/media/mtransport/test/sctp_unittest.cpp
@@ -12,6 +12,7 @@
#include "sigslot.h"
+#include "logging.h"
#include "nsNetCID.h"
#include "nsITimer.h"
#include "nsComponentManagerUtils.h"
@@ -22,7 +23,6 @@
#include "transportlayer.h"
#include "transportlayerloopback.h"
-#include "logging.h"
#include "mtransport_test_utils.h"
#include "runnable_utils.h"
#include "usrsctp.h"
diff --git a/media/mtransport/test/transport_unittests.cpp b/media/mtransport/test/transport_unittests.cpp
index d798e9e548d9..5787cc79b61a 100644
--- a/media/mtransport/test/transport_unittests.cpp
+++ b/media/mtransport/test/transport_unittests.cpp
@@ -12,6 +12,7 @@
#include "sigslot.h"
+#include "logging.h"
#include "nspr.h"
#include "nss.h"
#include "ssl.h"
@@ -29,7 +30,6 @@
#include "transportlayerlog.h"
#include "transportlayerloopback.h"
-#include "logging.h"
#include "mtransport_test_utils.h"
#include "runnable_utils.h"
diff --git a/media/mtransport/test/turn_unittest.cpp b/media/mtransport/test/turn_unittest.cpp
index 817de10d090b..bda362fcadd8 100644
--- a/media/mtransport/test/turn_unittest.cpp
+++ b/media/mtransport/test/turn_unittest.cpp
@@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "sigslot.h"
+#include "logging.h"
#include "nspr.h"
#include "nss.h"
#include "ssl.h"
@@ -52,7 +53,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "nsThreadUtils.h"
#include "nsXPCOM.h"
-#include "logging.h"
#include "mtransport_test_utils.h"
#include "runnable_utils.h"
diff --git a/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c b/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c
index 2412b3570c9f..fcdf06f85146 100644
--- a/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c
@@ -661,7 +661,7 @@ static void nr_turn_client_refresh_cb(NR_SOCKET s, int how, void *arg)
UINT4 lifetime = ctx->stun->results.refresh_response.lifetime_secs;
r_log(NR_LOG_TURN, LOG_DEBUG, "TURN(%s): Refresh succeeded. lifetime=%u",
- lifetime);
+ ctx->tctx->label, lifetime);
if ((r=nr_turn_client_start_refresh_timer(
ctx->tctx, ctx, lifetime)))
@@ -709,7 +709,8 @@ int nr_turn_client_send_indication(nr_turn_client_ctx *ctx,
if ((r=nr_socket_sendto(ctx->sock,
ind->buffer, ind->length, flags,
&ctx->turn_server_addr))) {
- r_log(NR_LOG_TURN, LOG_ERR, "TURN(%s): Failed sending send indication");
+ r_log(NR_LOG_TURN, LOG_ERR, "TURN(%s): Failed sending send indication",
+ ctx->label);
ABORT(r);
}
@@ -902,9 +903,11 @@ abort:
return(_status);
}
-static void nr_turn_client_permissions_cb(NR_SOCKET s, int how, void *cb)
+static void nr_turn_client_permissions_cb(NR_SOCKET s, int how, void *arg)
{
- r_log(NR_LOG_TURN, LOG_DEBUG, "TURN(%s): Successfully refreshed permission");
+ nr_turn_stun_ctx *ctx = (nr_turn_stun_ctx *)arg;
+ r_log(NR_LOG_TURN, LOG_DEBUG, "TURN(%s): Successfully refreshed permission",
+ ctx->tctx->label);
}
/* Note that we don't destroy the nr_turn_stun_ctx. That is owned by the
diff --git a/media/mtransport/third_party/nrappkit/src/log/r_log.h b/media/mtransport/third_party/nrappkit/src/log/r_log.h
index 85581bfec8e9..a72dfa0667ed 100644
--- a/media/mtransport/third_party/nrappkit/src/log/r_log.h
+++ b/media/mtransport/third_party/nrappkit/src/log/r_log.h
@@ -46,13 +46,28 @@
#include
#include
-int r_log(int facility,int level,const char *fmt,...);
+int r_log(int facility,int level,const char *fmt,...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 3, 4)))
+#endif
+;
+
int r_vlog(int facility,int level,const char *fmt,va_list ap);
int r_dump(int facility,int level,char *name,char *data,int len);
-int r_log_e(int facility,int level,const char *fmt,...);
+int r_log_e(int facility,int level,const char *fmt,...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 3, 4)))
+#endif
+;
+
int r_vlog_e(int facility,int level,const char *fmt,va_list ap);
-int r_log_nr(int facility,int level,int r,const char *fmt,...);
+int r_log_nr(int facility,int level,int r,const char *fmt,...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 4, 5)))
+#endif
+;
+
int r_vlog_nr(int facility,int level,int r,const char *fmt,va_list ap);
int r_log_register(char *tipename,int *facility);
diff --git a/media/mtransport/transportflow.cpp b/media/mtransport/transportflow.cpp
index c9ea46fc2448..3ebdf0c2babb 100644
--- a/media/mtransport/transportflow.cpp
+++ b/media/mtransport/transportflow.cpp
@@ -7,8 +7,6 @@
// Original author: ekr@rtfm.com
#include
-#include
-
#include "logging.h"
#include "runnable_utils.h"
#include "transportflow.h"
diff --git a/media/mtransport/transportlayer.cpp b/media/mtransport/transportlayer.cpp
index 5337a69c273c..f04451d8f7bb 100644
--- a/media/mtransport/transportlayer.cpp
+++ b/media/mtransport/transportlayer.cpp
@@ -5,8 +5,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
// Original author: ekr@rtfm.com
-#include
-
#include "logging.h"
#include "transportflow.h"
#include "transportlayer.h"
diff --git a/media/mtransport/transportlayerdtls.cpp b/media/mtransport/transportlayerdtls.cpp
index 7405680dbc2a..41cb0a1745a2 100644
--- a/media/mtransport/transportlayerdtls.cpp
+++ b/media/mtransport/transportlayerdtls.cpp
@@ -9,6 +9,7 @@
#include
#include
+#include "logging.h"
#include "ssl.h"
#include "sslerr.h"
#include "sslproto.h"
@@ -22,7 +23,6 @@
#include "nsServiceManagerUtils.h"
#include "dtlsidentity.h"
-#include "logging.h"
#include "transportflow.h"
#include "transportlayerdtls.h"
diff --git a/media/mtransport/transportlayerloopback.cpp b/media/mtransport/transportlayerloopback.cpp
index 27470c761b06..319aeb996536 100644
--- a/media/mtransport/transportlayerloopback.cpp
+++ b/media/mtransport/transportlayerloopback.cpp
@@ -6,6 +6,7 @@
// Original author: ekr@rtfm.com
+#include "logging.h"
#include "nspr.h"
#include "prlock.h"
@@ -19,7 +20,6 @@
#include "nsISocketTransportService.h"
#include "nsServiceManagerUtils.h"
-#include "logging.h"
#include "transportflow.h"
#include "transportlayerloopback.h"
diff --git a/media/mtransport/transportlayerprsock.cpp b/media/mtransport/transportlayerprsock.cpp
index cbf4e4875639..ed4ea16d1042 100644
--- a/media/mtransport/transportlayerprsock.cpp
+++ b/media/mtransport/transportlayerprsock.cpp
@@ -6,6 +6,7 @@
// Original author: ekr@rtfm.com
+#include "logging.h"
#include "nspr.h"
#include "prerror.h"
#include "prio.h"
@@ -17,7 +18,6 @@
#include "nsServiceManagerUtils.h"
#include "nsXPCOM.h"
-#include "logging.h"
#include "transportflow.h"
#include "transportlayerprsock.h"
diff --git a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
index 8068547a0724..b9f5d9e812f7 100644
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -2668,7 +2668,7 @@ vcmCreateTransportFlow(sipcc::PeerConnectionImpl *pc, int level, bool rtcp,
ScopedDeletePtr ice(
- new TransportLayerIce("flow", pc->media()->ice_ctx(),
+ new TransportLayerIce(pc->GetHandle(), pc->media()->ice_ctx(),
pc->media()->ice_media_stream(level-1),
rtcp ? 2 : 1));
diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
index 80893eeff4a3..db7b31b080da 100644
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -4,6 +4,7 @@
// Original author: ekr@rtfm.com
+#include "logging.h"
#include "MediaPipeline.h"
#ifndef USE_FAKE_MEDIA_STREAMS
@@ -13,7 +14,6 @@
#include
#include "nspr.h"
-#include
#include "srtp.h"
#ifdef MOZILLA_INTERNAL_API
@@ -27,7 +27,6 @@
#endif
#endif
-#include "logging.h"
#include "nsError.h"
#include "AudioSegment.h"
#include "MediaSegment.h"
@@ -36,7 +35,6 @@
#include "transportlayer.h"
#include "transportlayerdtls.h"
#include "transportlayerice.h"
-
#include "runnable_utils.h"
using namespace mozilla;
@@ -48,7 +46,6 @@ using namespace mozilla;
#define MP_LOG_INFO PR_LOG_DEBUG
#endif
-
// Logging context
MOZ_MTLOG_MODULE("mediapipeline")
@@ -56,6 +53,11 @@ namespace mozilla {
static char kDTLSExporterLabel[] = "EXTRACTOR-dtls_srtp";
+MediaPipeline::~MediaPipeline() {
+ MOZ_ASSERT(!stream_); // Check that we have shut down already.
+ MOZ_MTLOG(PR_LOG_DEBUG, "Destroying MediaPipeline: " << description_);
+}
+
nsresult MediaPipeline::Init() {
ASSERT_ON_THREAD(main_thread_);
diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
index f245002707b9..46376227fbc6 100644
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h
@@ -97,9 +97,7 @@ class MediaPipeline : public sigslot::has_slots<> {
description_() {
}
- virtual ~MediaPipeline() {
- MOZ_ASSERT(!stream_); // Check that we have shut down already.
- }
+ virtual ~MediaPipeline();
// Must be called on the STS thread. Must be called after ShutdownMedia_m().
void ShutdownTransport_s();
diff --git a/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp b/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp
index 1fff6fdd921f..a216c3316c7f 100644
--- a/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/SrtpFlow.cpp
@@ -4,14 +4,13 @@
// Original author: ekr@rtfm.com
+#include "logging.h"
#include "SrtpFlow.h"
#include "srtp.h"
#include "ssl.h"
#include "sslproto.h"
-#include "logging.h"
-
#include "mozilla/RefPtr.h"
// Logging context
diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
index b9dc28504a3c..0689031c44ec 100644
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -465,6 +465,27 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver,
{
nsresult res;
+ // Generate a random handle
+ unsigned char handle_bin[8];
+ SECStatus rv;
+ rv = PK11_GenerateRandom(handle_bin, sizeof(handle_bin));
+ if (rv != SECSuccess) {
+ return NS_ERROR_UNEXPECTED;
+ }
+
+ char hex[17];
+ PR_snprintf(hex,sizeof(hex),"%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
+ handle_bin[0],
+ handle_bin[1],
+ handle_bin[2],
+ handle_bin[3],
+ handle_bin[4],
+ handle_bin[5],
+ handle_bin[6],
+ handle_bin[7]);
+
+ mHandle = hex;
+
#ifdef MOZILLA_INTERNAL_API
MOZ_ASSERT(NS_IsMainThread());
#endif
@@ -524,23 +545,6 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver,
return res;
}
- // Generate a random handle
- unsigned char handle_bin[8];
- PK11_GenerateRandom(handle_bin, sizeof(handle_bin));
-
- char hex[17];
- PR_snprintf(hex,sizeof(hex),"%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
- handle_bin[0],
- handle_bin[1],
- handle_bin[2],
- handle_bin[3],
- handle_bin[4],
- handle_bin[5],
- handle_bin[6],
- handle_bin[7]);
-
- mHandle += hex;
-
// Store under mHandle
mCall->setPeerConnection(mHandle);
PeerConnectionCtx::GetInstance()->mPeerConnections[mHandle] = this;
diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
index acf8e46dd2e6..16930b6fd689 100644
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -179,9 +179,12 @@ nsresult PeerConnectionMedia::Init(const std::vector& stun_serv
// Create three streams to start with.
// One each for audio, video and DataChannel
// TODO: this will be re-visited
- RefPtr audioStream = mIceCtx->CreateStream("stream1", 2);
- RefPtr videoStream = mIceCtx->CreateStream("stream2", 2);
- RefPtr dcStream = mIceCtx->CreateStream("stream3", 2);
+ RefPtr audioStream =
+ mIceCtx->CreateStream((mParent->GetHandle()+"/stream1/audio").c_str(), 2);
+ RefPtr videoStream =
+ mIceCtx->CreateStream((mParent->GetHandle()+"/stream2/video").c_str(), 2);
+ RefPtr dcStream =
+ mIceCtx->CreateStream((mParent->GetHandle()+"/stream3/data").c_str(), 2);
if (!audioStream) {
CSFLogError(logTag, "%s: audio stream is NULL", __FUNCTION__);
diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c
index f261a2823144..3baeb760eb40 100755
--- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c
@@ -3516,6 +3516,10 @@ fsmdef_ev_setpeerconnection(sm_event_t *event) {
sstrncpy(dcb->peerconnection, msg->data.pc.pc_handle, sizeof(dcb->peerconnection));
dcb->peerconnection_set = TRUE;
+ FSM_DEBUG_SM(DEB_F_PREFIX"Setting peerconnection handle for (%d/%d) to %s",
+ DEB_F_PREFIX_ARGS(FSM, __FUNCTION__),
+ line, call_id, dcb->peerconnection);
+
return (SM_RC_END);
}
diff --git a/media/webrtc/signaling/test/mediapipeline_unittest.cpp b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
index 86b1e2fdd16c..9e25dac66d43 100644
--- a/media/webrtc/signaling/test/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
@@ -8,6 +8,7 @@
#include "sigslot.h"
+#include "logging.h"
#include "nsThreadUtils.h"
#include "nsXPCOM.h"
#include "nss.h"
@@ -15,7 +16,6 @@
#include "sslproto.h"
#include "dtlsidentity.h"
-#include "logging.h"
#include "mozilla/RefPtr.h"
#include "FakeMediaStreams.h"
#include "FakeMediaStreamsImpl.h"
diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/android/java/org/webrtc/videoengine/VideoCaptureAndroid.java b/media/webrtc/trunk/webrtc/modules/video_capture/android/java/org/webrtc/videoengine/VideoCaptureAndroid.java
index 220425853a22..f6e3ca1da705 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/android/java/org/webrtc/videoengine/VideoCaptureAndroid.java
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/android/java/org/webrtc/videoengine/VideoCaptureAndroid.java
@@ -134,7 +134,6 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
int result;
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
result = (info.orientation + degrees) % 360;
- result = (360 - result) % 360; // compensate the mirror
} else { // back-facing
result = (info.orientation - degrees + 360) % 360;
}
diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/android/video_capture_android.cc b/media/webrtc/trunk/webrtc/modules/video_capture/android/video_capture_android.cc
index 0e8f16a65c21..b2b49b65b587 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/android/video_capture_android.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/android/video_capture_android.cc
@@ -71,6 +71,13 @@ WebRtc_Word32 VideoCaptureAndroid::SetAndroidObjects(void* javaVM,
g_jvm = static_cast (javaVM);
if (javaVM) {
+ // Already done? Exit early.
+ if (g_javaCmClass != NULL
+ && g_javaCmDevInfoClass != NULL
+ && g_javaCmDevInfoObject != NULL) {
+ return 0;
+ }
+
JNIEnv* env = NULL;
if (g_jvm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, -1,
@@ -514,11 +521,6 @@ WebRtc_Word32 VideoCaptureAndroid::StartCapture(
}
}
- // I guess the libyuv rotate is CCW vs Android being CW,
- // so we need to invert.
- // Note that SetCaptureRotation calls SetDisplayOrientation,
- // but we don't use a visible Surface so we can ignore that one.
- rotation = (360 - rotation) % 360;
switch (rotation) {
case 90:
SetCaptureRotation(kCameraRotate90);
diff --git a/mfbt/TypeTraits.h b/mfbt/TypeTraits.h
index 656bc775f8e0..32c7ec749bb7 100644
--- a/mfbt/TypeTraits.h
+++ b/mfbt/TypeTraits.h
@@ -197,6 +197,21 @@ template<> struct IsPod : TrueType {};
template<> struct IsPod : TrueType {};
template struct IsPod : TrueType {};
+namespace detail {
+
+template::value>
+struct IsSignedHelper;
+
+template
+struct IsSignedHelper : TrueType {};
+
+template
+struct IsSignedHelper
+ : IntegralConstant::value && T(-1) < T(1)>
+{};
+
+} // namespace detail
+
/**
* IsSigned determines whether a type is a signed arithmetic type.
*
@@ -209,10 +224,26 @@ template struct IsPod : TrueType {};
* mozilla::IsSigned::value is true.
*/
template
-struct IsSigned
- : IntegralConstant::value && T(-1) < T(0)>
+struct IsSigned : detail::IsSignedHelper {};
+
+namespace detail {
+
+template::value>
+struct IsUnsignedHelper;
+
+template
+struct IsUnsignedHelper : FalseType {};
+
+template
+struct IsUnsignedHelper
+ : IntegralConstant::value &&
+ (IsSame::Type, bool>::value ||
+ T(1) < T(-1))>
{};
+} // namespace detail
+
/**
* IsUnsigned determines whether a type is an unsigned arithmetic type.
*
@@ -225,9 +256,7 @@ struct IsSigned
* mozilla::IsUnsigned::value is false.
*/
template
-struct IsUnsigned
- : IntegralConstant::value && T(0) < T(-1)>
-{};
+struct IsUnsigned : detail::IsUnsignedHelper {};
/* 20.9.5 Type property queries [meta.unary.prop.query] */
diff --git a/mfbt/tests/TestTypeTraits.cpp b/mfbt/tests/TestTypeTraits.cpp
index a7b2eaf5eda6..62ff743a21a7 100644
--- a/mfbt/tests/TestTypeTraits.cpp
+++ b/mfbt/tests/TestTypeTraits.cpp
@@ -8,6 +8,57 @@
using mozilla::IsBaseOf;
using mozilla::IsConvertible;
+using mozilla::IsSigned;
+using mozilla::IsUnsigned;
+
+MOZ_STATIC_ASSERT(!IsSigned::value, "bool shouldn't be signed");
+MOZ_STATIC_ASSERT(IsUnsigned::value, "bool should be unsigned");
+
+MOZ_STATIC_ASSERT(!IsSigned::value, "const bool shouldn't be signed");
+MOZ_STATIC_ASSERT(IsUnsigned::value, "const bool should be unsigned");
+
+MOZ_STATIC_ASSERT(!IsSigned::value, "volatile bool shouldn't be signed");
+MOZ_STATIC_ASSERT(IsUnsigned::value, "volatile bool should be unsigned");
+
+MOZ_STATIC_ASSERT(!IsSigned::value, "unsigned char shouldn't be signed");
+MOZ_STATIC_ASSERT(IsUnsigned::value, "unsigned char should be unsigned");
+MOZ_STATIC_ASSERT(IsSigned::value, "signed char should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "signed char shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(!IsSigned::value, "unsigned short shouldn't be signed");
+MOZ_STATIC_ASSERT(IsUnsigned::value, "unsigned short should be unsigned");
+MOZ_STATIC_ASSERT(IsSigned::value, "short should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "short shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(!IsSigned::value, "unsigned int shouldn't be signed");
+MOZ_STATIC_ASSERT(IsUnsigned::value, "unsigned int should be unsigned");
+MOZ_STATIC_ASSERT(IsSigned::value, "int should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "int shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(!IsSigned::value, "unsigned long shouldn't be signed");
+MOZ_STATIC_ASSERT(IsUnsigned::value, "unsigned long should be unsigned");
+MOZ_STATIC_ASSERT(IsSigned::value, "long should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "long shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(IsSigned::value, "float should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "float shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(IsSigned::value, "const float should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "const float shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(IsSigned::value, "double should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "double shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(IsSigned::value, "volatile double should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "volatile double shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(IsSigned::value, "long double should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value, "long double shouldn't be unsigned");
+
+MOZ_STATIC_ASSERT(IsSigned::value,
+ "const volatile long double should be signed");
+MOZ_STATIC_ASSERT(!IsUnsigned::value,
+ "const volatile long double shouldn't be unsigned");
namespace CPlusPlus11IsBaseOf {
diff --git a/mobile/android/base/BrowserToolbar.java b/mobile/android/base/BrowserToolbar.java
index c1e870dca26b..751e3d29fbca 100644
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -321,11 +321,7 @@ public class BrowserToolbar implements Tabs.OnTabsChangedListener,
public void onClick(View view) {
Tab tab = Tabs.getInstance().getSelectedTab();
if (tab != null) {
- if (ReaderModeUtils.isAboutReader(tab.getURL())) {
- tab.doBack();
- } else {
- tab.readerMode();
- }
+ tab.toggleReaderMode();
}
}
});
diff --git a/mobile/android/base/GeckoAccessibility.java b/mobile/android/base/GeckoAccessibility.java
index 92d51f487aa4..9cfeef0d76c9 100644
--- a/mobile/android/base/GeckoAccessibility.java
+++ b/mobile/android/base/GeckoAccessibility.java
@@ -162,6 +162,18 @@ public class GeckoAccessibility {
sVirtualCursorNode.setEnabled(message.optBoolean("enabled", true));
sVirtualCursorNode.setChecked(message.optBoolean("checked"));
sVirtualCursorNode.setPassword(message.optBoolean("password"));
+
+ final JSONArray textArray = message.optJSONArray("text");
+ StringBuilder sb = new StringBuilder();
+ if (textArray != null && textArray.length() > 0) {
+ sb.append(textArray.optString(0));
+ for (int i = 1; i < textArray.length(); i++) {
+ sb.append(" ").append(textArray.optString(i));
+ }
+ }
+ sVirtualCursorNode.setText(sb.toString());
+ sVirtualCursorNode.setContentDescription(message.optString("description"));
+
JSONObject bounds = message.optJSONObject("bounds");
if (bounds != null) {
Rect relativeBounds = new Rect(bounds.optInt("left"), bounds.optInt("top"),
@@ -223,13 +235,14 @@ public class GeckoAccessibility {
@Override
public void onPopulateAccessibilityEvent (View host, AccessibilityEvent event) {
super.onPopulateAccessibilityEvent(host, event);
- if (sEventMessage != null)
+ if (sEventMessage != null) {
populateEventFromJSON(event, sEventMessage);
+ // No matter where the a11y focus is requested, we always force it back to the current vc position.
+ event.setSource(host, VIRTUAL_CURSOR_POSITION);
+ }
// We save the hover enter event so that we could reuse it for a subsequent accessibility focus event.
if (event.getEventType() != AccessibilityEvent.TYPE_VIEW_HOVER_ENTER)
sEventMessage = null;
- // No matter where the a11y focus is requested, we always force it back to the current vc position.
- event.setSource(host, VIRTUAL_CURSOR_POSITION);
}
@Override
diff --git a/mobile/android/base/GeckoAppShell.java b/mobile/android/base/GeckoAppShell.java
index f3fb4c86b554..8c475c62ecc2 100644
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -1172,7 +1172,6 @@ public class GeckoAppShell
/* On some devices, access to the clipboard service needs to happen
* on a thread with a looper, so this function requires a looper is
* present on the thread. */
- @SuppressWarnings("deprecation")
private static String getClipboardTextImpl() {
Context context = GeckoApp.mAppContext;
if (android.os.Build.VERSION.SDK_INT >= 11) {
@@ -1220,10 +1219,13 @@ public class GeckoAppShell
}
}
- static void setClipboardText(final String text) {
+ static void setClipboardText(String copiedText) {
+ // Copy an empty string instead of null to avoid clipboard crashes.
+ // AndroidBridge::EmptyClipboard() passes null to clear the clipboard's current contents.
+ final String text = (copiedText != null) ? copiedText : "";
+
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
- @SuppressWarnings("deprecation")
public void run() {
Context context = GeckoApp.mAppContext;
if (android.os.Build.VERSION.SDK_INT >= 11) {
diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in
index 887442a8d9de..9fee5b369d90 100644
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -361,6 +361,7 @@ GARBAGE += \
$(FENNEC_PP_XML_FILES) \
$(SYNC_PP_RES_XML) \
package-name.txt \
+ fennec_ids.txt \
Manifest.java \
javah.out \
jni-stubs.inc \
@@ -1269,7 +1270,10 @@ R.java: $(MOZ_APP_ICON) $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDP
gecko.ap_: AndroidManifest.xml res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(PP_RES_XML) res/values/strings.xml FORCE
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
-libs:: classes.dex package-name.txt jni-stubs.inc
+fennec_ids.txt: fennec-ids-generator.py R.java
+ $(PYTHON) $(topsrcdir)/mobile/android/base/fennec-ids-generator.py -i R.java -o $@
+
+libs:: classes.dex package-name.txt jni-stubs.inc fennec_ids.txt
$(INSTALL) classes.dex $(FINAL_TARGET)
$(INSTALL) package-name.txt $(FINAL_TARGET)
@(diff jni-stubs.inc $(topsrcdir)/mozglue/android/jni-stubs.inc >/dev/null) || \
diff --git a/mobile/android/base/ReaderModeUtils.java b/mobile/android/base/ReaderModeUtils.java
index 51c0d99deb0b..ff800b8e58c3 100644
--- a/mobile/android/base/ReaderModeUtils.java
+++ b/mobile/android/base/ReaderModeUtils.java
@@ -75,4 +75,15 @@ public class ReaderModeUtils {
return aboutReaderUrl;
}
+
+ /**
+ * Performs the inverse of getAboutReaderForUrl.
+ */
+ public static String getUrlForAboutReader(String aboutReaderUrl) {
+ String query = Uri.parse(aboutReaderUrl).getQuery();
+
+ // It would be nice if we could use Uri.getQueryParameter, but that
+ // doesn't work because "about:reader" isn't a hierarchical URI.
+ return query.substring(4, query.indexOf("&readingList="));
+ }
}
diff --git a/mobile/android/base/Tab.java b/mobile/android/base/Tab.java
index fbe48ef3c450..9d8f21727323 100644
--- a/mobile/android/base/Tab.java
+++ b/mobile/android/base/Tab.java
@@ -426,12 +426,13 @@ public class Tab {
GeckoAppShell.sendEventToGecko(e);
}
- public void readerMode() {
- if (!mReaderEnabled)
- return;
-
- mEnteringReaderMode = true;
- Tabs.getInstance().loadUrl(ReaderModeUtils.getAboutReaderForUrl(getURL(), mId, mReadingListItem));
+ public void toggleReaderMode() {
+ if (ReaderModeUtils.isAboutReader(mUrl)) {
+ Tabs.getInstance().loadUrl(ReaderModeUtils.getUrlForAboutReader(mUrl));
+ } else if (mReaderEnabled) {
+ mEnteringReaderMode = true;
+ Tabs.getInstance().loadUrl(ReaderModeUtils.getAboutReaderForUrl(mUrl, mId, mReadingListItem));
+ }
}
public boolean isEnteringReaderMode() {
diff --git a/build/mobile/robocop/parse_ids.py b/mobile/android/base/fennec-ids-generator.py
similarity index 97%
rename from build/mobile/robocop/parse_ids.py
rename to mobile/android/base/fennec-ids-generator.py
index ba4d89c46704..ee0d7da39584 100644
--- a/build/mobile/robocop/parse_ids.py
+++ b/mobile/android/base/fennec-ids-generator.py
@@ -12,27 +12,27 @@ def getFile(filename):
data = fHandle.read()
fHandle.close()
return data
-
+
def findIDs(data):
start_function = False
reID = re.compile('.*public static final class id {.*')
reEnd = re.compile('.*}.*')
idlist = []
-
+
for line in data.split('\n'):
if reEnd.match(line):
start_function = False
-
+
if start_function:
id_value = line.split(' ')[-1]
idlist.append(id_value.split(';')[0].split('='))
-
+
if reID.match(line):
start_function = True
-
+
return idlist
-
-
+
+
def printIDs(outputFile, idlist):
fOutput = open(outputFile, 'w')
for item in idlist:
@@ -46,7 +46,7 @@ def main(args=sys.argv[1:]):
parser.add_option('-i', '--input', dest='inputFile', default='',
help="filename of the input R.java file")
options, args = parser.parse_args(args)
-
+
if options.inputFile == '':
print "Error: please provide input file: -i "
sys.exit(1)
@@ -61,4 +61,3 @@ def main(args=sys.argv[1:]):
if __name__ == "__main__":
main()
-
diff --git a/mobile/android/base/resources/layout/abouthome_last_tabs_row.xml b/mobile/android/base/resources/layout/abouthome_last_tabs_row.xml
index 4050b57637a5..c528cfe71c7e 100644
--- a/mobile/android/base/resources/layout/abouthome_last_tabs_row.xml
+++ b/mobile/android/base/resources/layout/abouthome_last_tabs_row.xml
@@ -17,7 +17,7 @@
android:layout_centerVertical="true"
android:minWidth="@dimen/favicon_bg"
android:minHeight="@dimen/favicon_bg"
- android:background="@drawable/favicon_bg"/>
+ android:background="@drawable/favicon"/>
data, valueLen, &mode);
+ (char *)avaValue->data,
+ PR_MIN(avaValue->len, valueLen), &mode);
bigTmpBuf[valueLen--] = '\0'; /* hard stop here */
/* See if we're in the middle of a multi-byte UTF8 character */
diff --git a/security/nss/lib/ckfw/builtins/certdata.perl b/security/nss/lib/ckfw/builtins/certdata.perl
index 26866b80310f..56771f5cb439 100644
--- a/security/nss/lib/ckfw/builtins/certdata.perl
+++ b/security/nss/lib/ckfw/builtins/certdata.perl
@@ -3,7 +3,6 @@
# 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/.
-my $cvs_id = '@(#) $RCSfile$ $Revision$ $Date$';
use strict;
my %constants;
@@ -11,7 +10,6 @@ my $count = 0;
my $o;
my @objects = ();
my @objsize;
-my $cvsid;
$constants{CKO_DATA} = "static const CK_OBJECT_CLASS cko_data = CKO_DATA;\n";
$constants{CK_TRUE} = "static const CK_BBOOL ck_true = CK_TRUE;\n";
@@ -24,21 +22,6 @@ while(<>) {
s/^((?:[^"#]+|"[^"]*")*)(\s*#.*$)/$1/;
next if (/^\s*$/);
- if( /(^CVS_ID\s+)(.*)/ ) {
- $cvsid = $2 . "\"; $cvs_id\"";
- my $scratch = $cvsid;
- $size = 1 + $scratch =~ s/[^"\n]//g;
- @{$objects[0][0]} = ( "CKA_CLASS", "&cko_data", "sizeof(CK_OBJECT_CLASS)" );
- @{$objects[0][1]} = ( "CKA_TOKEN", "&ck_true", "sizeof(CK_BBOOL)" );
- @{$objects[0][2]} = ( "CKA_PRIVATE", "&ck_false", "sizeof(CK_BBOOL)" );
- @{$objects[0][3]} = ( "CKA_MODIFIABLE", "&ck_false", "sizeof(CK_BBOOL)" );
- @{$objects[0][4]} = ( "CKA_LABEL", "\"CVS ID\"", "7" );
- @{$objects[0][5]} = ( "CKA_APPLICATION", "\"NSS\"", "4" );
- @{$objects[0][6]} = ( "CKA_VALUE", $cvsid, "$size" );
- $objsize[0] = 7;
- next;
- }
-
# This was taken from the perl faq #4.
my $text = $_;
push(@fields, $+) while $text =~ m{
@@ -110,7 +93,7 @@ doprint();
sub dudump {
my $i;
-for( $i = 0; $i <= $count; $i++ ) {
+for( $i = 1; $i <= $count; $i++ ) {
print "\n";
$o = $objects[$i];
my @ob = @{$o};
@@ -133,9 +116,6 @@ print <candidateCert;
if (state->buildConstants.numAnchors) {
- trustOnlyUserAnchors = state->buildConstants.trustOnlyUserAnchors;
+ if (state->buildConstants.trustOnlyUserAnchors) {
+ trustAnchorMode = PKIX_PL_TrustAnchorMode_Exclusive;
+ } else {
+ trustAnchorMode = PKIX_PL_TrustAnchorMode_Additive;
+ }
+ } else {
+ trustAnchorMode = PKIX_PL_TrustAnchorMode_Ignore;
}
PKIX_CHECK(
- PKIX_PL_Cert_IsCertTrusted(candidateCert,
- trustOnlyUserAnchors,
+ PKIX_PL_Cert_IsCertTrusted(candidateCert, trustAnchorMode,
&trusted, plContext),
PKIX_CERTISCERTTRUSTEDFAILED);
@@ -3041,19 +3047,27 @@ pkix_Build_CheckInCache(
(matchingAnchor, &trustedCert, plContext),
PKIX_TRUSTANCHORGETTRUSTEDCERTFAILED);
- if (state->buildConstants.anchors &&
- state->buildConstants.anchors->length) {
+ if (anchors && state->buildConstants.numAnchors) {
/* Check if it is one of the trust anchors */
PKIX_CHECK(
- pkix_List_Contains(state->buildConstants.anchors,
+ pkix_List_Contains(anchors,
(PKIX_PL_Object *)matchingAnchor,
&trusted,
plContext),
PKIX_LISTCONTAINSFAILED);
- } else {
- PKIX_CHECK(PKIX_PL_Cert_IsCertTrusted
- (trustedCert, PKIX_FALSE, &trusted, plContext),
- PKIX_CERTISCERTTRUSTEDFAILED);
+ }
+
+ if ((!trusted && !state->buildConstants.trustOnlyUserAnchors) ||
+ !state->buildConstants.numAnchors) {
+ /* If it is not one of the trust anchors and the trust anchors
+ * are supplemental, or if there are no trust anchors, then check
+ * if the cert is trusted directly.
+ */
+ PKIX_CHECK(
+ PKIX_PL_Cert_IsCertTrusted(trustedCert,
+ PKIX_PL_TrustAnchorMode_Ignore,
+ &trusted, plContext),
+ PKIX_CERTISCERTTRUSTEDFAILED);
}
if (!trusted) {
diff --git a/security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c b/security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c
index 147e03de2c1a..f13c835699ef 100644
--- a/security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c
+++ b/security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c
@@ -3294,7 +3294,7 @@ pkix_pl_Cert_GetTrusted(void *plContext,
PKIX_Error *
PKIX_PL_Cert_IsCertTrusted(
PKIX_PL_Cert *cert,
- PKIX_Boolean trustOnlyUserAnchors,
+ PKIX_PL_TrustAnchorMode trustAnchorMode,
PKIX_Boolean *pTrusted,
void *plContext)
{
@@ -3315,8 +3315,10 @@ PKIX_PL_Cert_IsCertTrusted(
PKIX_ERROR(PKIX_CERTISCERTTRUSTEDFAILED);
}
- if (trustOnlyUserAnchors || cert->isUserTrustAnchor) {
- /* discard our |trusted| value since we are using the anchors */
+ if (trustAnchorMode == PKIX_PL_TrustAnchorMode_Exclusive ||
+ (trustAnchorMode == PKIX_PL_TrustAnchorMode_Additive &&
+ cert->isUserTrustAnchor)) {
+ /* Use the trust anchor's |trusted| value */
*pTrusted = cert->isUserTrustAnchor;
goto cleanup;
}
diff --git a/security/nss/lib/ssl/ssl.h b/security/nss/lib/ssl/ssl.h
index 53a1de92116e..6db0e3403281 100644
--- a/security/nss/lib/ssl/ssl.h
+++ b/security/nss/lib/ssl/ssl.h
@@ -417,14 +417,13 @@ SSL_IMPORT const SECItemArray * SSL_PeerStapledOCSPResponses(PRFileDesc *fd);
/* SSL_SetStapledOCSPResponses stores an array of one or multiple OCSP responses
* in the fd's data, which may be sent as part of a server side cert_status
- * handshake message.
- * If takeOwnership is false, the function will duplicate the responses.
- * If takeOwnership is true, the ownership of responses is transfered into the
- * SSL library, and the caller must stop using it.
+ * handshake message. Parameter |responses| is for the server certificate of
+ * the key exchange type |kea|.
+ * The function will duplicate the responses array.
*/
SSL_IMPORT SECStatus
-SSL_SetStapledOCSPResponses(PRFileDesc *fd, SECItemArray *responses,
- PRBool takeOwnership);
+SSL_SetStapledOCSPResponses(PRFileDesc *fd, const SECItemArray *responses,
+ SSLKEAType kea);
/*
** Authenticate certificate hook. Called when a certificate comes in
diff --git a/security/nss/lib/ssl/ssl3con.c b/security/nss/lib/ssl/ssl3con.c
index b17f29332ba8..eb1deee03154 100644
--- a/security/nss/lib/ssl/ssl3con.c
+++ b/security/nss/lib/ssl/ssl3con.c
@@ -8444,23 +8444,36 @@ ssl3_SendCertificate(sslSocket *ss)
static SECStatus
ssl3_SendCertificateStatus(sslSocket *ss)
{
- SECStatus rv;
- int len = 0;
+ SECStatus rv;
+ int len = 0;
+ SECItemArray *statusToSend = NULL;
+ SSL3KEAType certIndex;
SSL_TRC(3, ("%d: SSL3[%d]: send certificate status handshake",
SSL_GETPID(), ss->fd));
PORT_Assert( ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
PORT_Assert( ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
+ PORT_Assert( ss->sec.isServer);
if (!ssl3_ExtensionNegotiated(ss, ssl_cert_status_xtn))
return SECSuccess;
- if (!ss->certStatusArray || !ss->certStatusArray->len)
+ /* Use certStatus based on the cert being used. */
+ if ((ss->ssl3.hs.kea_def->kea == kea_ecdhe_rsa) ||
+ (ss->ssl3.hs.kea_def->kea == kea_dhe_rsa)) {
+ certIndex = kt_rsa;
+ } else {
+ certIndex = ss->ssl3.hs.kea_def->exchKeyType;
+ }
+ if (ss->certStatusArray[certIndex] && ss->certStatusArray[certIndex]->len) {
+ statusToSend = ss->certStatusArray[certIndex];
+ }
+ if (!statusToSend)
return SECSuccess;
/* Use the array's first item only (single stapling) */
- len = 1 + ss->certStatusArray->items[0].len + 3;
+ len = 1 + statusToSend->items[0].len + 3;
rv = ssl3_AppendHandshakeHeader(ss, certificate_status, len);
if (rv != SECSuccess) {
@@ -8471,8 +8484,8 @@ ssl3_SendCertificateStatus(sslSocket *ss)
return rv; /* err set by AppendHandshake. */
rv = ssl3_AppendHandshakeVariable(ss,
- ss->certStatusArray->items[0].data,
- ss->certStatusArray->items[0].len,
+ statusToSend->items[0].data,
+ statusToSend->items[0].len,
3);
if (rv != SECSuccess)
return rv; /* err set by AppendHandshake. */
diff --git a/security/nss/lib/ssl/ssl3ext.c b/security/nss/lib/ssl/ssl3ext.c
index 1559268951aa..965d212c630e 100644
--- a/security/nss/lib/ssl/ssl3ext.c
+++ b/security/nss/lib/ssl/ssl3ext.c
@@ -681,8 +681,21 @@ ssl3_ServerSendStatusRequestXtn(
{
PRInt32 extension_length;
SECStatus rv;
+ int i;
+ PRBool haveStatus = PR_FALSE;
- if (!ss->certStatusArray || !ss->certStatusArray->len)
+ for (i = kt_null; i < kt_kea_size; i++) {
+ /* TODO: This is a temporary workaround.
+ * The correct code needs to see if we have an OCSP response for
+ * the server certificate being used, rather than if we have any
+ * OCSP response. See also ssl3_SendCertificateStatus.
+ */
+ if (ss->certStatusArray[i] && ss->certStatusArray[i]->len) {
+ haveStatus = PR_TRUE;
+ break;
+ }
+ }
+ if (!haveStatus)
return 0;
extension_length = 2 + 2;
diff --git a/security/nss/lib/ssl/sslimpl.h b/security/nss/lib/ssl/sslimpl.h
index 9f3f522c345c..9875e5967031 100644
--- a/security/nss/lib/ssl/sslimpl.h
+++ b/security/nss/lib/ssl/sslimpl.h
@@ -1175,7 +1175,8 @@ const unsigned char * preferredCipher;
/* Configuration state for server sockets */
/* server cert and key for each KEA type */
sslServerCerts serverCerts[kt_kea_size];
- SECItemArray * certStatusArray;
+ /* each cert needs its own status */
+ SECItemArray * certStatusArray[kt_kea_size];
ssl3CipherSuiteCfg cipherSuites[ssl_V3_SUITES_IMPLEMENTED];
ssl3KeyPair * ephemeralECDHKeyPair; /* for ECDHE-* handshake */
diff --git a/security/nss/lib/ssl/sslsock.c b/security/nss/lib/ssl/sslsock.c
index f25fa31d8bbe..74a0a92ee33b 100644
--- a/security/nss/lib/ssl/sslsock.c
+++ b/security/nss/lib/ssl/sslsock.c
@@ -321,13 +321,13 @@ ssl_DupSocket(sslSocket *os)
if (oc->serverKeyPair && !sc->serverKeyPair)
goto loser;
sc->serverKeyBits = oc->serverKeyBits;
+ ss->certStatusArray[i] = !os->certStatusArray[i] ? NULL :
+ SECITEM_DupArray(NULL, os->certStatusArray[i]);
}
ss->stepDownKeyPair = !os->stepDownKeyPair ? NULL :
ssl3_GetKeyPairRef(os->stepDownKeyPair);
ss->ephemeralECDHKeyPair = !os->ephemeralECDHKeyPair ? NULL :
ssl3_GetKeyPairRef(os->ephemeralECDHKeyPair);
- ss->certStatusArray = !os->certStatusArray ? NULL :
- SECITEM_DupArray(NULL, os->certStatusArray);
/*
* XXX the preceding CERT_ and SECKEY_ functions can fail and return NULL.
* XXX We should detect this, and not just march on with NULL pointers.
@@ -430,6 +430,10 @@ ssl_DestroySocketContents(sslSocket *ss)
CERT_DestroyCertificateList(sc->serverCertChain);
if (sc->serverKeyPair != NULL)
ssl3_FreeKeyPair(sc->serverKeyPair);
+ if (ss->certStatusArray[i] != NULL) {
+ SECITEM_FreeArray(ss->certStatusArray[i], PR_TRUE);
+ ss->certStatusArray[i] = NULL;
+ }
}
if (ss->stepDownKeyPair) {
ssl3_FreeKeyPair(ss->stepDownKeyPair);
@@ -439,10 +443,6 @@ ssl_DestroySocketContents(sslSocket *ss)
ssl3_FreeKeyPair(ss->ephemeralECDHKeyPair);
ss->ephemeralECDHKeyPair = NULL;
}
- if (ss->certStatusArray) {
- SECITEM_FreeArray(ss->certStatusArray, PR_TRUE);
- ss->certStatusArray = NULL;
- }
SECITEM_FreeItem(&ss->opt.nextProtoNego, PR_FALSE);
PORT_Assert(!ss->xtnData.sniNameArr);
if (ss->xtnData.sniNameArr) {
@@ -1668,6 +1668,15 @@ SSL_ReconfigFD(PRFileDesc *model, PRFileDesc *fd)
sc->serverCertChain = CERT_DupCertList(mc->serverCertChain);
if (!sc->serverCertChain)
goto loser;
+ if (sm->certStatusArray[i]) {
+ if (ss->certStatusArray[i]) {
+ SECITEM_FreeArray(ss->certStatusArray[i], PR_TRUE);
+ ss->certStatusArray[i] = NULL;
+ }
+ ss->certStatusArray[i] = SECITEM_DupArray(NULL, sm->certStatusArray[i]);
+ if (!ss->certStatusArray[i])
+ goto loser;
+ }
}
if (mc->serverKeyPair) {
if (sc->serverKeyPair) {
@@ -1690,13 +1699,6 @@ SSL_ReconfigFD(PRFileDesc *model, PRFileDesc *fd)
ss->ephemeralECDHKeyPair =
ssl3_GetKeyPairRef(sm->ephemeralECDHKeyPair);
}
- if (sm->certStatusArray) {
- if (ss->certStatusArray) {
- SECITEM_FreeArray(ss->certStatusArray, PR_TRUE);
- ss->certStatusArray = NULL;
- }
- ss->certStatusArray = SECITEM_DupArray(NULL, sm->certStatusArray);
- }
/* copy trust anchor names */
if (sm->ssl3.ca_list) {
if (ss->ssl3.ca_list) {
@@ -2229,8 +2231,8 @@ ssl_GetSockName(PRFileDesc *fd, PRNetAddr *name)
}
SECStatus
-SSL_SetStapledOCSPResponses(PRFileDesc *fd, SECItemArray *responses,
- PRBool takeOwnership)
+SSL_SetStapledOCSPResponses(PRFileDesc *fd, const SECItemArray *responses,
+ SSLKEAType kea)
{
sslSocket *ss;
@@ -2241,19 +2243,20 @@ SSL_SetStapledOCSPResponses(PRFileDesc *fd, SECItemArray *responses,
return SECFailure;
}
- if (ss->certStatusArray) {
- SECITEM_FreeArray(ss->certStatusArray, PR_TRUE);
- ss->certStatusArray = NULL;
+ if ( kea <= 0 || kea >= kt_kea_size) {
+ SSL_DBG(("%d: SSL[%d]: invalid key in SSL_SetStapledOCSPResponses",
+ SSL_GETPID(), fd));
+ return SECFailure;
+ }
+
+ if (ss->certStatusArray[kea]) {
+ SECITEM_FreeArray(ss->certStatusArray[kea], PR_TRUE);
+ ss->certStatusArray[kea] = NULL;
}
if (responses) {
- if (takeOwnership) {
- ss->certStatusArray = responses;
- }
- else {
- ss->certStatusArray = SECITEM_DupArray(NULL, responses);
- }
+ ss->certStatusArray[kea] = SECITEM_DupArray(NULL, responses);
}
- return (ss->certStatusArray || !responses) ? SECSuccess : SECFailure;
+ return (ss->certStatusArray[kea] || !responses) ? SECSuccess : SECFailure;
}
SECStatus
@@ -2953,10 +2956,10 @@ ssl_NewSocket(PRBool makeLocks, SSLProtocolVariant protocolVariant)
sc->serverCertChain = NULL;
sc->serverKeyPair = NULL;
sc->serverKeyBits = 0;
+ ss->certStatusArray[i] = NULL;
}
ss->stepDownKeyPair = NULL;
ss->dbHandle = CERT_GetDefaultCertDB();
- ss->certStatusArray = NULL;
/* Provide default implementation of hooks */
ss->authCertificate = SSL_AuthCertificate;
diff --git a/security/patches/README b/security/patches/README
index 788bf6a533c4..beff0219a544 100644
--- a/security/patches/README
+++ b/security/patches/README
@@ -1,2 +1,6 @@
This directory contains patches that were added locally
on top of the NSS release.
+
+revert-bug-808217.patch: Revert the patch for bug 808217 because it
+broke the "B2G Arm opt", "B2G Arm debug", and "Android 2.2 Armv6 opt"
+build bots. See bug 874261.
diff --git a/security/patches/revert-bug-808217.patch b/security/patches/revert-bug-808217.patch
new file mode 100644
index 000000000000..9409cba0fdf5
--- /dev/null
+++ b/security/patches/revert-bug-808217.patch
@@ -0,0 +1,189 @@
+diff --git a/cmd/bltest/blapitest.c b/cmd/bltest/blapitest.c
+--- a/cmd/bltest/blapitest.c
++++ b/cmd/bltest/blapitest.c
+@@ -1028,17 +1028,18 @@ bltestCopyIO(PLArenaPool *arena, bltestI
+ }
+
+ void
+ misalignBuffer(PLArenaPool *arena, bltestIO *io, int off)
+ {
+ ptrdiff_t offset = (ptrdiff_t)io->buf.data % WORDSIZE;
+ int length = io->buf.len;
+ if (offset != off) {
+- SECITEM_ReallocItemV2(arena, &io->buf, length + 2*WORDSIZE);
++ SECITEM_ReallocItem(arena, &io->buf, length, length + 2*WORDSIZE);
++ io->buf.len = length + 2*WORDSIZE; /* why doesn't realloc do this? */
+ /* offset may have changed? */
+ offset = (ptrdiff_t)io->buf.data % WORDSIZE;
+ if (offset != off) {
+ memmove(io->buf.data + off, io->buf.data, length);
+ io->pBuf.data = io->buf.data + off;
+ io->pBuf.len = length;
+ } else {
+ io->pBuf.data = io->buf.data;
+diff --git a/cmd/lib/secutil.c b/cmd/lib/secutil.c
+--- a/cmd/lib/secutil.c
++++ b/cmd/lib/secutil.c
+@@ -525,17 +525,17 @@ SECU_ReadDERFromFile(SECItem *der, PRFil
+ *trailer = '\0';
+ if (!body || !trailer) {
+ fprintf(stderr, "input has header but no trailer\n");
+ PORT_Free(filedata.data);
+ return SECFailure;
+ }
+ } else {
+ /* need one additional byte for zero terminator */
+- rv = SECITEM_ReallocItemV2(NULL, &filedata, filedata.len+1);
++ rv = SECITEM_ReallocItem(NULL, &filedata, filedata.len, filedata.len+1);
+ if (rv != SECSuccess) {
+ PORT_Free(filedata.data);
+ return rv;
+ }
+ body = (char*)filedata.data;
+ body[filedata.len-1] = '\0';
+ }
+
+diff --git a/lib/util/nssutil.def b/lib/util/nssutil.def
+--- a/lib/util/nssutil.def
++++ b/lib/util/nssutil.def
+@@ -261,13 +261,12 @@ NSSUTIL_QuoteSize;
+ ;+ local:
+ ;+ *;
+ ;+};
+ ;+NSSUTIL_3.15 { # NSS Utilities 3.15 release
+ ;+ global:
+ SECITEM_AllocArray;
+ SECITEM_DupArray;
+ SECITEM_FreeArray;
+-SECITEM_ReallocItemV2;
+ SECITEM_ZfreeArray;
+ ;+ local:
+ ;+ *;
+ ;+};
+diff --git a/lib/util/secitem.c b/lib/util/secitem.c
+--- a/lib/util/secitem.c
++++ b/lib/util/secitem.c
+@@ -110,73 +110,16 @@ SECITEM_ReallocItem(PLArenaPool *arena,
+
+ if (item->data == NULL) {
+ return SECFailure;
+ }
+
+ return SECSuccess;
+ }
+
+-SECStatus
+-SECITEM_ReallocItemV2(PLArenaPool *arena, SECItem *item, unsigned int newlen)
+-{
+- unsigned char *newdata = NULL;
+-
+- PORT_Assert(item);
+- if (!item) {
+- PORT_SetError(SEC_ERROR_INVALID_ARGS);
+- return SECFailure;
+- }
+-
+- if (item->len == newlen) {
+- return SECSuccess;
+- }
+-
+- if (!newlen) {
+- SECITEM_FreeItem(item, PR_FALSE);
+- return SECSuccess;
+- }
+-
+- if (!item->len) {
+- /* allocate fresh block of memory */
+- PORT_Assert(!item->data);
+- if (arena) {
+- newdata = PORT_ArenaAlloc(arena, newlen);
+- } else {
+- newdata = PORT_Alloc(newlen);
+- }
+- } else {
+- /* reallocate or adjust existing block of memory */
+- if (arena) {
+- if (item->len > newlen) {
+- /* There's no need to realloc a shorter block from the arena,
+- * because it would result in using even more memory!
+- * Therefore we'll continue to use the old block and
+- * set the item to the shorter size.
+- */
+- item->len = newlen;
+- return SECSuccess;
+- } else {
+- newdata = PORT_ArenaGrow(arena, item->data, item->len, newlen);
+- }
+- } else {
+- newdata = PORT_Realloc(item->data, newlen);
+- }
+- }
+-
+- if (!newdata) {
+- PORT_SetError(SEC_ERROR_NO_MEMORY);
+- return SECFailure;
+- }
+-
+- item->len = newlen;
+- item->data = newdata;
+- return SECSuccess;
+-}
+-
+ SECComparison
+ SECITEM_CompareItem(const SECItem *a, const SECItem *b)
+ {
+ unsigned m;
+ int rv;
+
+ if (a == b)
+ return SECEqual;
+diff --git a/lib/util/secitem.h b/lib/util/secitem.h
+--- a/lib/util/secitem.h
++++ b/lib/util/secitem.h
+@@ -31,45 +31,27 @@ SEC_BEGIN_PROTOS
+ **
+ ** XXX This probably should take a SECItemType, but since that is mostly
+ ** unused and our improved APIs (aka Stan) are looming, I left it out.
+ */
+ extern SECItem *SECITEM_AllocItem(PLArenaPool *arena, SECItem *item,
+ unsigned int len);
+
+ /*
+-** This is a legacy function containing bugs. It doesn't update item->len,
+-** and it has other issues as described in bug 298649 and bug 298938.
+-** However, the function is kept unchanged for consumers that might depend
+-** on the broken behaviour. New code should call SECITEM_ReallocItemV2.
+-**
+ ** Reallocate the data for the specified "item". If "arena" is not NULL,
+ ** then reallocate from there, otherwise reallocate from the heap.
+ ** In the case where oldlen is 0, the data is allocated (not reallocated).
+ ** In any case, "item" is expected to be a valid SECItem pointer;
+ ** SECFailure is returned if it is not. If the allocation succeeds,
+ ** SECSuccess is returned.
+ */
+-extern SECStatus SECITEM_ReallocItem( /* deprecated function */
+- PLArenaPool *arena, SECItem *item,
++extern SECStatus SECITEM_ReallocItem(PLArenaPool *arena, SECItem *item,
+ unsigned int oldlen, unsigned int newlen);
+
+ /*
+-** Reallocate the data for the specified "item". If "arena" is not NULL,
+-** then reallocate from there, otherwise reallocate from the heap.
+-** If the item already has at least the request new size,
+-** then the item is kept unchanged and SECSuccess is returned.
+-** In any case, "item" is expected to be a valid SECItem pointer;
+-** SECFailure is returned if it is not, and the item will remain unchanged.
+-** If the allocation succeeds, the item is updated and SECSuccess is returned.
+- */
+-extern SECStatus SECITEM_ReallocItemV2(PLArenaPool *arena, SECItem *item,
+- unsigned int newlen);
+-
+-/*
+ ** Compare two items returning the difference between them.
+ */
+ extern SECComparison SECITEM_CompareItem(const SECItem *a, const SECItem *b);
+
+ /*
+ ** Compare two items -- if they are the same, return true; otherwise false.
+ */
+ extern PRBool SECITEM_ItemsAreEqual(const SECItem *a, const SECItem *b);
diff --git a/testing/marionette/client/marionette/tests/unit/test_click.py b/testing/marionette/client/marionette/tests/unit/test_click.py
index f36a332901ef..bfede2c19fd8 100644
--- a/testing/marionette/client/marionette/tests/unit/test_click.py
+++ b/testing/marionette/client/marionette/tests/unit/test_click.py
@@ -5,8 +5,7 @@
import time
from marionette_test import MarionetteTestCase
-"""
-### Disabled due to bug 838607
+
class TestClick(MarionetteTestCase):
def test_click(self):
test_html = self.marionette.absolute_url("test.html")
@@ -27,7 +26,7 @@ class TestClick(MarionetteTestCase):
self.fail("Element id=username not found after 30 seconds")
self.assertEqual(self.marionette.title, "XHTML Test Page")
-"""
+
class TestClickChrome(MarionetteTestCase):
def setUp(self):
diff --git a/testing/mochitest/android.json b/testing/mochitest/android.json
index a7d370ee2440..aac80c788351 100644
--- a/testing/mochitest/android.json
+++ b/testing/mochitest/android.json
@@ -5,6 +5,7 @@
"content/base/test/test_bug338583.html": "",
"content/base/test/test_bug466080.html": "",
"content/base/test/test_bug475156.html": "bug 855762",
+ "content/base/test/test_bug482935.html": "bug 855762",
"content/base/test/test_bug503481.html": "TIMED_OUT",
"content/base/test/test_bug503481b.html": "TIMED_OUT",
"content/base/test/test_bug505783.html": "TIMED_OUT",
diff --git a/testing/mochitest/runtestsremote.py b/testing/mochitest/runtestsremote.py
index e882d173c6f3..9eb26a1db20a 100644
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -80,14 +80,24 @@ class RemoteOptions(MochitestOptions):
help = "name of the pidfile to generate")
defaults["pidFile"] = ""
+ self.add_option("--robocop-ini", action = "store",
+ type = "string", dest = "robocopIni",
+ help = "name of the .ini file containing the list of tests to run")
+ defaults["robocopIni"] = ""
+
self.add_option("--robocop", action = "store",
type = "string", dest = "robocop",
- help = "name of the .ini file containing the list of tests to run")
+ help = "name of the .ini file containing the list of tests to run. [DEPRECATED- please use --robocop-ini")
defaults["robocop"] = ""
+ self.add_option("--robocop-apk", action = "store",
+ type = "string", dest = "robocopApk",
+ help = "name of the Robocop APK to use for ADB test running")
+ defaults["robocopApk"] = ""
+
self.add_option("--robocop-path", action = "store",
type = "string", dest = "robocopPath",
- help = "Path to the folder where robocop.apk is located at. Primarily used for ADB test running")
+ help = "Path to the folder where robocop.apk is located at. Primarily used for ADB test running. [DEPRECATED- please use --robocop-apk]")
defaults["robocopPath"] = ""
self.add_option("--robocop-ids", action = "store",
@@ -158,22 +168,37 @@ class RemoteOptions(MochitestOptions):
f.write("%s" % os.getpid())
f.close()
- # Robocop specific options
- if options.robocop != "":
- if not os.path.exists(options.robocop):
- print "ERROR: Unable to find specified manifest '%s'" % options.robocop
+ # Robocop specific deprecated options.
+ if options.robocop:
+ if options.robocopIni:
+ print "ERROR: can not use deprecated --robocop and replacement --robocop-ini together"
return None
- options.robocop = os.path.abspath(options.robocop)
+ options.robocopIni = options.robocop
+ del options.robocop
- if options.robocopPath != "":
- if not os.path.exists(os.path.join(options.robocopPath, 'robocop.apk')):
- print "ERROR: Unable to find robocop.apk in path '%s'" % options.robocopPath
+ if options.robocopPath:
+ if options.robocopApk:
+ print "ERROR: can not use deprecated --robocop-path and replacement --robocop-apk together"
return None
- options.robocopPath = os.path.abspath(options.robocopPath)
+ options.robocopApk = os.path.join(options.robocopPath, 'robocop.apk')
+ del options.robocopPath
+
+ # Robocop specific options
+ if options.robocopIni != "":
+ if not os.path.exists(options.robocopIni):
+ print "ERROR: Unable to find specified robocop .ini manifest '%s'" % options.robocopIni
+ return None
+ options.robocopIni = os.path.abspath(options.robocopIni)
+
+ if options.robocopApk != "":
+ if not os.path.exists(options.robocopApk):
+ print "ERROR: Unable to find robocop APK '%s'" % options.robocopApk
+ return None
+ options.robocopApk = os.path.abspath(options.robocopApk)
if options.robocopIds != "":
if not os.path.exists(options.robocopIds):
- print "ERROR: Unable to find specified IDs file '%s'" % options.robocopIds
+ print "ERROR: Unable to find specified robocop IDs file '%s'" % options.robocopIds
return None
options.robocopIds = os.path.abspath(options.robocopIds)
@@ -309,7 +334,7 @@ class MochiRemote(Mochitest):
self._dm.removeDir(self.remoteProfile)
# we do not need this for robotium based tests, lets save a LOT of time
- if options.robocop:
+ if options.robocopIni:
shutil.rmtree(os.path.join(options.profilePath, 'webapps'))
shutil.rmtree(os.path.join(options.profilePath, 'extensions', 'staged', 'mochikit@mozilla.org'))
shutil.rmtree(os.path.join(options.profilePath, 'extensions', 'staged', 'worker-test@mozilla.org'))
@@ -336,7 +361,7 @@ class MochiRemote(Mochitest):
env["MOZ_HIDE_RESULTS_TABLE"] = "1"
retVal = Mochitest.buildURLOptions(self, options, env)
- if not options.robocop:
+ if not options.robocopIni:
#we really need testConfig.js (for browser chrome)
try:
self._dm.pushDir(options.profilePath, self.remoteProfile)
@@ -491,6 +516,7 @@ def main():
auto = RemoteAutomation(None, "fennec")
parser = RemoteOptions(auto, scriptdir)
options, args = parser.parse_args()
+
if (options.dm_trans == "adb"):
if (options.deviceIP):
dm = droid.DroidADB(options.deviceIP, options.devicePort, deviceRoot=options.remoteTestRoot)
@@ -527,12 +553,12 @@ def main():
if (dm.processExist(procName)):
dm.killProcess(procName)
- if options.robocop != "":
+ if options.robocopIni != "":
# sut may wait up to 300 s for a robocop am process before returning
dm.default_timeout = 320
mp = manifestparser.TestManifest(strict=False)
# TODO: pull this in dynamically
- mp.read(options.robocop)
+ mp.read(options.robocopIni)
robocop_tests = mp.active_tests(exists=False)
tests = []
my_tests = tests
@@ -560,8 +586,8 @@ def main():
options.extraPrefs.append('browser.viewport.scaleRatio=100')
options.extraPrefs.append('browser.chrome.dynamictoolbar=false')
- if (options.dm_trans == 'adb' and options.robocopPath):
- dm._checkCmd(["install", "-r", os.path.join(options.robocopPath, "robocop.apk")])
+ if (options.dm_trans == 'adb' and options.robocopApk):
+ dm._checkCmd(["install", "-r", options.robocopApk])
retVal = None
for test in robocop_tests:
diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk
index 3a1c2feac202..f4f1cf315ffe 100644
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -63,13 +63,15 @@ RUN_MOCHITEST_REMOTE = \
--testing-modules-dir=$(call core_abspath,_tests/modules) \
$(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
-RUN_MOCHITEST_ROBOTIUM = \
+RUN_MOCHITEST_ROBOCOP = \
rm -f ./$@.log && \
- $(PYTHON) _tests/testing/mochitest/runtestsremote.py --robocop-path=$(DEPTH)/dist \
- --robocop-ids=$(DEPTH)/build/mobile/robocop/fennec_ids.txt \
+ $(PYTHON) _tests/testing/mochitest/runtestsremote.py \
+ --robocop-apk=$(DEPTH)/build/mobile/robocop/robocop-debug-signed.apk \
+ --robocop-ids=$(DEPTH)/mobile/android/base/fennec_ids.txt \
+ --robocop-ini=$(DEPTH)/build/mobile/robocop/robocop.ini \
--console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \
--app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
- --robocop=$(DEPTH)/build/mobile/robocop/robocop.ini $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
+ $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
ifndef NO_FAIL_ON_TEST_ERRORS
define check_test_error_internal
@@ -95,15 +97,17 @@ mochitest-remote:
$(RUN_MOCHITEST_REMOTE); \
fi
-mochitest-robotium: robotium-id-map
-mochitest-robotium: DM_TRANS?=adb
-mochitest-robotium:
+mochitest-robotium: mochitest-robocop
+ @echo "mochitest-robotium is deprecated -- please use mochitest-robocop"
+
+mochitest-robocop: DM_TRANS?=adb
+mochitest-robocop:
@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
echo "please prepare your host with the environment variable TEST_DEVICE"; \
else \
- $(RUN_MOCHITEST_ROBOTIUM); \
+ $(RUN_MOCHITEST_ROBOCOP); \
fi
ifdef MOZ_B2G
@@ -435,16 +439,10 @@ make-stage-dir:
stage-b2g: make-stage-dir
$(NSINSTALL) $(topsrcdir)/b2g/test/b2g-unittest-requirements.txt $(PKG_STAGE)/b2g
-robotium-id-map:
-ifeq ($(MOZ_BUILD_APP),mobile/android)
- $(PYTHON) $(DEPTH)/build/mobile/robocop/parse_ids.py -i $(DEPTH)/mobile/android/base/R.java -o $(DEPTH)/build/mobile/robocop/fennec_ids.txt
-endif
-
-stage-mochitest: robotium-id-map
stage-mochitest: make-stage-dir
$(MAKE) -C $(DEPTH)/testing/mochitest stage-package
ifeq ($(MOZ_BUILD_APP),mobile/android)
- $(NSINSTALL) $(DEPTH)/build/mobile/robocop/fennec_ids.txt $(PKG_STAGE)/mochitest
+ $(NSINSTALL) $(DEPTH)/mobile/android/base/fennec_ids.txt $(PKG_STAGE)/mochitest
endif
stage-reftest: make-stage-dir
diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js
index f26933d297e6..6ae7f8402b6d 100644
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -81,11 +81,27 @@ let snapshotFormatters = {
function localizedMsg(msgArray) {
let nameOrMsg = msgArray.shift();
- try {
- return strings.formatStringFromName(nameOrMsg, msgArray,
- msgArray.length);
+ if (msgArray.length) {
+ // formatStringFromName logs an NS_ASSERTION failure otherwise that says
+ // "use GetStringFromName". Lame.
+ try {
+ return strings.formatStringFromName(nameOrMsg, msgArray,
+ msgArray.length);
+ }
+ catch (err) {
+ // Throws if nameOrMsg is not a name in the bundle. This shouldn't
+ // actually happen though, since msgArray.length > 1 => nameOrMsg is a
+ // name in the bundle, not a message, and the remaining msgArray
+ // elements are parameters.
+ return nameOrMsg;
+ }
+ }
+ try {
+ return strings.GetStringFromName(nameOrMsg);
+ }
+ catch (err) {
+ // Throws if nameOrMsg is not a name in the bundle.
}
- catch (err) {}
return nameOrMsg;
}
@@ -311,15 +327,8 @@ function copyContentsToClipboard() {
// Return the plain text representation of an element. Do a little bit
// of pretty-printing to make it human-readable.
function createTextForElement(elem) {
- // Generate the initial text.
- let textFragmentAccumulator = [];
- generateTextForElement(elem, "", textFragmentAccumulator);
- let text = textFragmentAccumulator.join("");
-
- // Trim extraneous whitespace before newlines, then squash extraneous
- // blank lines.
- text = text.replace(/[ \t]+\n/g, "\n");
- text = text.replace(/\n\n\n+/g, "\n\n");
+ let serializer = new Serializer();
+ let text = serializer.serialize(elem);
// Actual CR/LF pairs are needed for some Windows text editors.
#ifdef XP_WIN
@@ -329,44 +338,160 @@ function createTextForElement(elem) {
return text;
}
-function generateTextForElement(elem, indent, textFragmentAccumulator) {
- if (elem.classList.contains("no-copy"))
- return;
-
- // Add a little extra spacing around most elements.
- if (elem.tagName != "td")
- textFragmentAccumulator.push("\n");
-
- // Generate the text representation for each child node.
- let node = elem.firstChild;
- while (node) {
-
- if (node.nodeType == Node.TEXT_NODE) {
- // Text belonging to this element uses its indentation level.
- generateTextForTextNode(node, indent, textFragmentAccumulator);
- }
- else if (node.nodeType == Node.ELEMENT_NODE) {
- // Recurse on the child element with an extra level of indentation.
- generateTextForElement(node, indent + " ", textFragmentAccumulator);
- }
-
- // Advance!
- node = node.nextSibling;
- }
+function Serializer() {
}
-function generateTextForTextNode(node, indent, textFragmentAccumulator) {
- // If the text node is the first of a run of text nodes, then start
- // a new line and add the initial indentation.
- let prevNode = node.previousSibling;
- if (!prevNode || prevNode.nodeType == Node.TEXT_NODE)
- textFragmentAccumulator.push("\n" + indent);
+Serializer.prototype = {
- // Trim the text node's text content and add proper indentation after
- // any internal line breaks.
- let text = node.textContent.trim().replace("\n", "\n" + indent, "g");
- textFragmentAccumulator.push(text);
-}
+ serialize: function (rootElem) {
+ this._lines = [];
+ this._startNewLine();
+ this._serializeElement(rootElem);
+ this._startNewLine();
+ return this._lines.join("\n").trim() + "\n";
+ },
+
+ // The current line is always the line that writing will start at next. When
+ // an element is serialized, the current line is updated to be the line at
+ // which the next element should be written.
+ get _currentLine() {
+ return this._lines.length ? this._lines[this._lines.length - 1] : null;
+ },
+
+ set _currentLine(val) {
+ return this._lines[this._lines.length - 1] = val;
+ },
+
+ _serializeElement: function (elem) {
+ if (this._ignoreElement(elem))
+ return;
+
+ // table
+ if (elem.localName == "table") {
+ this._serializeTable(elem);
+ return;
+ }
+
+ // all other elements
+
+ let hasText = false;
+ for (let child of elem.childNodes) {
+ if (child.nodeType == Node.TEXT_NODE) {
+ let text = this._nodeText(child);
+ this._appendText(text);
+ hasText = hasText || !!text.trim();
+ }
+ else if (child.nodeType == Node.ELEMENT_NODE)
+ this._serializeElement(child);
+ }
+
+ // For headings, draw a "line" underneath them so they stand out.
+ if (/^h[0-9]+$/.test(elem.localName)) {
+ let headerText = (this._currentLine || "").trim();
+ if (headerText) {
+ this._startNewLine();
+ this._appendText("-".repeat(headerText.length));
+ }
+ }
+
+ // Add a blank line underneath block elements but only if they contain text.
+ if (hasText) {
+ let display = window.getComputedStyle(elem).getPropertyValue("display");
+ if (display == "block") {
+ this._startNewLine();
+ this._startNewLine();
+ }
+ }
+ },
+
+ _startNewLine: function (lines) {
+ let currLine = this._currentLine;
+ if (currLine) {
+ // The current line is not empty. Trim it.
+ this._currentLine = currLine.trim();
+ if (!this._currentLine)
+ // The current line became empty. Discard it.
+ this._lines.pop();
+ }
+ this._lines.push("");
+ },
+
+ _appendText: function (text, lines) {
+ this._currentLine += text;
+ },
+
+ _serializeTable: function (table) {
+ // Collect the table's column headings if in fact there are any. First
+ // check thead. If there's no thead, check the first tr.
+ let colHeadings = {};
+ let tableHeadingElem = table.querySelector("thead");
+ if (!tableHeadingElem)
+ tableHeadingElem = table.querySelector("tr");
+ if (tableHeadingElem) {
+ let tableHeadingCols = tableHeadingElem.querySelectorAll("th,td");
+ // If there's a contiguous run of th's in the children starting from the
+ // rightmost child, then consider them to be column headings.
+ for (let i = tableHeadingCols.length - 1; i >= 0; i--) {
+ if (tableHeadingCols[i].localName != "th")
+ break;
+ colHeadings[i] = this._nodeText(tableHeadingCols[i]).trim();
+ }
+ }
+ let hasColHeadings = Object.keys(colHeadings).length > 0;
+ if (!hasColHeadings)
+ tableHeadingElem = null;
+
+ let trs = table.querySelectorAll("table > tr, tbody > tr");
+ let startRow =
+ tableHeadingElem && tableHeadingElem.localName == "tr" ? 1 : 0;
+
+ if (startRow >= trs.length)
+ // The table's empty.
+ return;
+
+ if (hasColHeadings && !this._ignoreElement(tableHeadingElem)) {
+ // Use column headings. Print each tr as a multi-line chunk like:
+ // Heading 1: Column 1 value
+ // Heading 2: Column 2 value
+ for (let i = startRow; i < trs.length; i++) {
+ if (this._ignoreElement(trs[i]))
+ continue;
+ let children = trs[i].querySelectorAll("td");
+ for (let j = 0; j < children.length; j++) {
+ let text = "";
+ if (colHeadings[j])
+ text += colHeadings[j] + ": ";
+ text += this._nodeText(children[j]).trim();
+ this._appendText(text);
+ this._startNewLine();
+ }
+ this._startNewLine();
+ }
+ return;
+ }
+
+ // Don't use column headings. Assume the table has only two columns and
+ // print each tr in a single line like:
+ // Column 1 value: Column 2 value
+ for (let i = startRow; i < trs.length; i++) {
+ if (this._ignoreElement(trs[i]))
+ continue;
+ let children = trs[i].querySelectorAll("th,td");
+ let rowHeading = this._nodeText(children[0]).trim();
+ this._appendText(rowHeading + ": " + this._nodeText(children[1]).trim());
+ this._startNewLine();
+ }
+ this._startNewLine();
+ },
+
+ _ignoreElement: function (elem) {
+ return elem.classList.contains("no-copy");
+ },
+
+ _nodeText: function (node) {
+ return node.textContent.replace(/\s+/g, " ");
+ },
+};
function openProfileDirectory() {
// Get the profile directory.
diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml
index f68ec5736fd8..9367b6fcf456 100644
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -195,7 +195,7 @@
-
+
&aboutSupport.modifiedPrefsName;
diff --git a/toolkit/modules/Preferences.jsm b/toolkit/modules/Preferences.jsm
index 93ad7991c73b..74255e76e2e9 100644
--- a/toolkit/modules/Preferences.jsm
+++ b/toolkit/modules/Preferences.jsm
@@ -208,24 +208,7 @@ Preferences.prototype = {
return;
}
- this._reset(prefName);
- },
-
- _reset: function(prefName) {
- try {
- this._prefSvc.clearUserPref(prefName);
- }
- catch(ex) {
- // The pref service throws NS_ERROR_UNEXPECTED when the caller tries
- // to reset a pref that doesn't exist or is already set to its default
- // value. This interface fails silently in those cases, so callers
- // can unconditionally reset a pref without having to check if it needs
- // resetting first or trap exceptions after the fact. It passes through
- // other exceptions, however, so callers know about them, since we don't
- // know what other exceptions might be thrown and what they might mean.
- if (ex.result != Cr.NS_ERROR_UNEXPECTED)
- throw ex;
- }
+ this._prefSvc.clearUserPref(prefName);
},
/**
diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk
index 06a9990743cf..137fb46c32c1 100644
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -328,11 +328,10 @@ UPLOAD_EXTRA_FILES += robocop.apk
UPLOAD_EXTRA_FILES += fennec_ids.txt
ROBOCOP_PATH = $(call core_abspath,$(_ABS_DIST)/../build/mobile/robocop)
INNER_ROBOCOP_PACKAGE= \
- $(PYTHON) $(abspath $(topsrcdir)/build/mobile/robocop/parse_ids.py) -i $(call core_abspath,$(DEPTH)/mobile/android/base/R.java) -o $(call core_abspath,$(DEPTH)/build/mobile/robocop/fennec_ids.txt) && \
- $(NSINSTALL) $(call core_abspath,$(DEPTH)/build/mobile/robocop/fennec_ids.txt) $(_ABS_DIST) && \
- $(APKBUILDER) $(_ABS_DIST)/robocop-raw.apk -v $(APKBUILDER_FLAGS) -z $(ROBOCOP_PATH)/robocop.ap_ -f $(ROBOCOP_PATH)/classes.dex && \
- $(JARSIGNER) $(_ABS_DIST)/robocop-raw.apk && \
- $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-raw.apk $(_ABS_DIST)/robocop.apk
+ $(NSINSTALL) $(GECKO_APP_AP_PATH)/fennec_ids.txt $(_ABS_DIST) && \
+ cp $(ROBOCOP_PATH)/robocop-debug-signed-unaligned.apk $(_ABS_DIST)/robocop-unaligned.apk && \
+ $(JARSIGNER) $(_ABS_DIST)/robocop-unaligned.apk && \
+ $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-unaligned.apk $(_ABS_DIST)/robocop.apk
endif
else
INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Robocop for you'
diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp
index 782ab797fe99..9a521990e1ba 100644
--- a/view/src/nsView.cpp
+++ b/view/src/nsView.cpp
@@ -132,6 +132,14 @@ nsView* nsView::GetViewFor(nsIWidget* aWidget)
void nsView::Destroy()
{
+#if 1 // XXXmats temporary investigation of bug 850571
+ if (mFrame) {
+ if (uintptr_t(mFrame) == mozPoisonValue()) {
+ NS_RUNTIMEABORT("bug 850571: poisoned frame");
+ }
+ NS_RUNTIMEABORT("bug 850571: have frame");
+ }
+#endif
this->~nsView();
mozWritePoison(this, sizeof(*this));
nsView::operator delete(this);
diff --git a/widget/xpwidgets/nsNativeTheme.cpp b/widget/xpwidgets/nsNativeTheme.cpp
index 3ea6e4808b70..b0a6185e8a7d 100644
--- a/widget/xpwidgets/nsNativeTheme.cpp
+++ b/widget/xpwidgets/nsNativeTheme.cpp
@@ -682,17 +682,20 @@ nsNativeTheme::IsRangeHorizontal(nsIFrame* aFrame)
bool
nsNativeTheme::IsDarkBackground(nsIFrame* aFrame)
{
- nsIScrollableFrame* scrollFrame = aFrame->GetScrollTargetFrame();
+ nsIScrollableFrame* scrollFrame = nullptr;
while (!scrollFrame && aFrame) {
- aFrame = aFrame->GetParent();
scrollFrame = aFrame->GetScrollTargetFrame();
+ aFrame = aFrame->GetParent();
}
+ if (!scrollFrame)
+ return false;
+
nsIFrame* frame = scrollFrame->GetScrolledFrame();
nsStyleContext* bgSC;
if (nsCSSRendering::FindBackground(frame, &bgSC)) {
nscolor bgColor = bgSC->StyleBackground()->mBackgroundColor;
// Consider the background color dark if the sum of the r, g and b values is
- // less than 384 in a semi-transparent docement. This heuristic matches what
+ // less than 384 in a semi-transparent document. This heuristic matches what
// WebKit does, and we can improve it later if needed.
return NS_GET_A(bgColor) > 127 &&
NS_GET_R(bgColor) + NS_GET_G(bgColor) + NS_GET_B(bgColor) < 384;
diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp
index be681eb420d2..a928dfe22868 100644
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -103,6 +103,7 @@
#include "nsCycleCollectionJSRuntime.h"
#include "nsCycleCollectionParticipant.h"
+#include "nsCycleCollectionNoteRootCallback.h"
#include "nsCycleCollectorUtils.h"
#include "nsIProgrammingLanguage.h"
#include "nsBaseHashtable.h"
@@ -1728,7 +1729,8 @@ static PLDHashTableOps PtrNodeOps = {
nullptr
};
-class GCGraphBuilder : public nsCycleCollectionTraversalCallback
+class GCGraphBuilder : public nsCycleCollectionTraversalCallback,
+ public nsCycleCollectionNoteRootCallback
{
private:
nsCycleCollector *mCollector;
@@ -1752,6 +1754,11 @@ public:
~GCGraphBuilder();
bool Initialized();
+ bool WantAllTraces() const
+ {
+ return nsCycleCollectionNoteRootCallback::WantAllTraces();
+ }
+
uint32_t Count() const { return mPtrToNodeMap.entryCount; }
PtrInfo* AddNode(void *s, nsCycleCollectionParticipant *aParticipant);
@@ -1766,22 +1773,22 @@ private:
}
public:
+ // nsCycleCollectionNoteRootCallback methods.
+ NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root);
+ NS_IMETHOD_(void) NoteJSRoot(void *root);
+ NS_IMETHOD_(void) NoteNativeRoot(void *root, nsCycleCollectionParticipant *participant);
+ NS_IMETHOD_(void) NoteWeakMapping(void *map, void *key, void *kdelegate, void *val);
+
// nsCycleCollectionTraversalCallback methods.
NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refCount,
const char *objName);
NS_IMETHOD_(void) DescribeGCedNode(bool isMarked, const char *objName);
- NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root);
- NS_IMETHOD_(void) NoteJSRoot(void *root);
- NS_IMETHOD_(void) NoteNativeRoot(void *root, nsCycleCollectionParticipant *participant);
-
NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child);
NS_IMETHOD_(void) NoteJSChild(void *child);
NS_IMETHOD_(void) NoteNativeChild(void *child,
nsCycleCollectionParticipant *participant);
-
NS_IMETHOD_(void) NoteNextEdgeName(const char* name);
- NS_IMETHOD_(void) NoteWeakMapping(void *map, void *key, void *kdelegate, void *val);
private:
NS_IMETHOD_(void) NoteRoot(void *root,
@@ -1849,12 +1856,16 @@ GCGraphBuilder::GCGraphBuilder(nsCycleCollector *aCollector,
mListener->GetWantAllTraces(&all);
if (all) {
flags |= nsCycleCollectionTraversalCallback::WANT_ALL_TRACES;
+ mWantAllTraces = true; // for nsCycleCollectionNoteRootCallback
}
}
mFlags |= flags;
mMergeZones = mMergeZones && MOZ_LIKELY(!WantAllTraces());
+
+ MOZ_ASSERT(nsCycleCollectionNoteRootCallback::WantAllTraces() ==
+ nsCycleCollectionTraversalCallback::WantAllTraces());
}
GCGraphBuilder::~GCGraphBuilder()
@@ -2098,12 +2109,7 @@ public:
const char *objname) {}
NS_IMETHOD_(void) DescribeGCedNode(bool ismarked,
const char *objname) {}
- NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root) {}
- NS_IMETHOD_(void) NoteJSRoot(void *root) {}
- NS_IMETHOD_(void) NoteNativeRoot(void *root,
- nsCycleCollectionParticipant *helper) {}
NS_IMETHOD_(void) NoteNextEdgeName(const char* name) {}
- NS_IMETHOD_(void) NoteWeakMapping(void *map, void *key, void *kdelegate, void *val) {}
bool MayHaveChild() {
return mMayHaveChild;
}
diff --git a/xpcom/ds/nsStaticNameTable.cpp b/xpcom/ds/nsStaticNameTable.cpp
index daf6cca71299..3d892ac67c01 100644
--- a/xpcom/ds/nsStaticNameTable.cpp
+++ b/xpcom/ds/nsStaticNameTable.cpp
@@ -26,7 +26,7 @@ struct NameTableKey
{
mKeyStr.m1b = aKeyStr;
}
-
+
NameTableKey(const nsAFlatString* aKeyStr)
: mIsUnichar(true)
{
@@ -56,7 +56,7 @@ matchNameKeysCaseInsensitive(PLDHashTable*, const PLDHashEntryHdr* aHdr,
const NameTableKey *keyValue = static_cast(key);
const nsAFlatCString* entryKey = entry->mString;
-
+
if (keyValue->mIsUnichar) {
return keyValue->mKeyStr.m2b->
LowerCaseEqualsASCII(entryKey->get(), entryKey->Length());
@@ -127,7 +127,7 @@ nsStaticCaseInsensitiveNameTable::~nsStaticCaseInsensitiveNameTable()
MOZ_COUNT_DTOR(nsStaticCaseInsensitiveNameTable);
}
-bool
+bool
nsStaticCaseInsensitiveNameTable::Init(const char* const aNames[], int32_t Count)
{
NS_ASSERTION(!mNameArray, "double Init");
@@ -179,6 +179,9 @@ nsStaticCaseInsensitiveNameTable::Init(const char* const aNames[], int32_t Count
entry->mString = strPtr; // not owned!
entry->mIndex = index;
}
+#ifdef DEBUG
+ PL_DHashMarkTableImmutable(&mNameTable);
+#endif
return true;
}
diff --git a/xpcom/glue/moz.build b/xpcom/glue/moz.build
index c37ef16d6247..9c341b6eadf1 100644
--- a/xpcom/glue/moz.build
+++ b/xpcom/glue/moz.build
@@ -15,6 +15,7 @@ MODULE = 'xpcom'
EXPORTS += [
'nsCycleCollectionNoteChild.h',
+ 'nsCycleCollectionNoteRootCallback.h',
'nsCycleCollectionTraversalCallback.h',
'nsCycleCollectorUtils.h',
'nsProxyRelease.h',
diff --git a/xpcom/glue/nsCycleCollectionJSRuntime.h b/xpcom/glue/nsCycleCollectionJSRuntime.h
index 19cd03136d55..66711523743c 100644
--- a/xpcom/glue/nsCycleCollectionJSRuntime.h
+++ b/xpcom/glue/nsCycleCollectionJSRuntime.h
@@ -8,12 +8,12 @@
#define nsCycleCollectionJSRuntime_h__
class nsCycleCollectionParticipant;
-class nsCycleCollectionTraversalCallback;
+class nsCycleCollectionNoteRootCallback;
// Various methods the cycle collector needs to deal with Javascript.
struct nsCycleCollectionJSRuntime
{
- virtual nsresult BeginCycleCollection(nsCycleCollectionTraversalCallback &aCb) = 0;
+ virtual nsresult BeginCycleCollection(nsCycleCollectionNoteRootCallback &aCb) = 0;
/**
* Called before/after transitioning to/from the main thread.
diff --git a/xpcom/glue/nsCycleCollectionNoteRootCallback.h b/xpcom/glue/nsCycleCollectionNoteRootCallback.h
new file mode 100644
index 000000000000..3a2ad09ead25
--- /dev/null
+++ b/xpcom/glue/nsCycleCollectionNoteRootCallback.h
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* 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/. */
+
+#ifndef nsCycleCollectionNoteRootCallback_h__
+#define nsCycleCollectionNoteRootCallback_h__
+
+class nsCycleCollectionParticipant;
+class nsISupports;
+
+class nsCycleCollectionNoteRootCallback
+{
+public:
+ NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root) = 0;
+ NS_IMETHOD_(void) NoteJSRoot(void *root) = 0;
+ NS_IMETHOD_(void) NoteNativeRoot(void *root, nsCycleCollectionParticipant *participant) = 0;
+
+ NS_IMETHOD_(void) NoteWeakMapping(void *map, void *key, void *kdelegate, void *val) = 0;
+
+ bool WantAllTraces() const { return mWantAllTraces; }
+protected:
+ nsCycleCollectionNoteRootCallback() : mWantAllTraces(false) {}
+
+ bool mWantAllTraces;
+};
+
+#endif // nsCycleCollectionNoteRootCallback_h__
diff --git a/xpcom/glue/nsCycleCollectionTraversalCallback.h b/xpcom/glue/nsCycleCollectionTraversalCallback.h
index a60de8c1855a..8bf7b41da8c1 100644
--- a/xpcom/glue/nsCycleCollectionTraversalCallback.h
+++ b/xpcom/glue/nsCycleCollectionTraversalCallback.h
@@ -22,10 +22,6 @@ public:
NS_IMETHOD_(void) DescribeGCedNode(bool ismarked,
const char* objname) = 0;
- NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root) = 0;
- NS_IMETHOD_(void) NoteJSRoot(void *root) = 0;
- NS_IMETHOD_(void) NoteNativeRoot(void *root, nsCycleCollectionParticipant *participant) = 0;
-
NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child) = 0;
NS_IMETHOD_(void) NoteJSChild(void *child) = 0;
NS_IMETHOD_(void) NoteNativeChild(void *child,
@@ -37,8 +33,6 @@ public:
// flags.
NS_IMETHOD_(void) NoteNextEdgeName(const char* name) = 0;
- NS_IMETHOD_(void) NoteWeakMapping(void *map, void *key, void *kdelegate, void *val) = 0;
-
enum {
// Values for flags:
diff --git a/xulrunner/config/mozconfigs/linux32/xulrunner b/xulrunner/config/mozconfigs/linux32/xulrunner
index 96697a4708de..b239933694cb 100644
--- a/xulrunner/config/mozconfigs/linux32/xulrunner
+++ b/xulrunner/config/mozconfigs/linux32/xulrunner
@@ -4,7 +4,7 @@ export JAVA_HOME=/tools/jdk
ac_add_options --enable-application=xulrunner
ac_add_options --disable-tests
-. $topsrcdir/build/unix/mozconfig.linux
+. $topsrcdir/build/unix/mozconfig.linux32
# Avoid dependency on libstdc++ 4.5
ac_add_options --enable-stdcxx-compat
diff --git a/xulrunner/config/mozconfigs/linux32/xulrunner-qt b/xulrunner/config/mozconfigs/linux32/xulrunner-qt
index c37fd2c9ec84..7383e36c1c07 100644
--- a/xulrunner/config/mozconfigs/linux32/xulrunner-qt
+++ b/xulrunner/config/mozconfigs/linux32/xulrunner-qt
@@ -4,7 +4,7 @@ export JAVA_HOME=/tools/jdk
ac_add_options --enable-application=xulrunner
ac_add_options --disable-tests
-. $topsrcdir/build/unix/mozconfig.linux
+. $topsrcdir/build/unix/mozconfig.linux32
# Avoid dependency on libstdc++ 4.5
ac_add_options --enable-stdcxx-compat