diff --git a/Makefile.in b/Makefile.in
index b3a4c6312bcf..dc53fbb7002c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -60,7 +60,7 @@ 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
- $(PYTHON) $(topsrcdir)/config/purge_directories.py -d _build_manifests/purge .
+ $(call py_action,purge_manifests,-d _build_manifests/purge .)
endif
CLOBBER: $(topsrcdir)/CLOBBER
diff --git a/accessible/src/atk/Makefile.in b/accessible/src/atk/Makefile.in
index 7255859e668c..70be75d8af48 100644
--- a/accessible/src/atk/Makefile.in
+++ b/accessible/src/atk/Makefile.in
@@ -12,9 +12,6 @@ include $(DEPTH)/config/autoconf.mk
EXPORT_LIBRARY = ..
LIBXUL_LIBRARY = 1
-# we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
ifdef MOZ_ENABLE_GTK
diff --git a/accessible/src/base/Makefile.in b/accessible/src/base/Makefile.in
index 9fb53fca53f1..67191a4b573d 100644
--- a/accessible/src/base/Makefile.in
+++ b/accessible/src/base/Makefile.in
@@ -11,9 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \
diff --git a/accessible/src/generic/Makefile.in b/accessible/src/generic/Makefile.in
index b2b938ed7058..68825db73f75 100644
--- a/accessible/src/generic/Makefile.in
+++ b/accessible/src/generic/Makefile.in
@@ -11,9 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
diff --git a/accessible/src/html/Makefile.in b/accessible/src/html/Makefile.in
index 55b0f157172e..c73ec9317cf1 100644
--- a/accessible/src/html/Makefile.in
+++ b/accessible/src/html/Makefile.in
@@ -12,9 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
diff --git a/accessible/src/jsat/AccessFu.jsm b/accessible/src/jsat/AccessFu.jsm
index 664f52fefdee..9a015f0046e4 100644
--- a/accessible/src/jsat/AccessFu.jsm
+++ b/accessible/src/jsat/AccessFu.jsm
@@ -785,6 +785,8 @@ var Input = {
B: ['movePrevious', 'Button'],
c: ['moveNext', 'Combobox'],
C: ['movePrevious', 'Combobox'],
+ d: ['moveNext', 'Landmark'],
+ D: ['movePrevious', 'Landmark'],
e: ['moveNext', 'Entry'],
E: ['movePrevious', 'Entry'],
f: ['moveNext', 'FormElement'],
diff --git a/accessible/src/jsat/OutputGenerator.jsm b/accessible/src/jsat/OutputGenerator.jsm
index 0dc6fc93ef22..7fbff338f5a0 100644
--- a/accessible/src/jsat/OutputGenerator.jsm
+++ b/accessible/src/jsat/OutputGenerator.jsm
@@ -176,22 +176,12 @@ this.OutputGenerator = {
* @param {nsIAccessible} aAccessible current accessible object.
*/
_addLandmark: function _addLandmark(aOutput, aAccessible) {
- let getLandmarkName = function getLandmarkName(aAccessible) {
- let roles = Utils.getAttributes(aAccessible)['xml-roles'];
- if (!roles) {
- return;
- }
-
- // Looking up a role that would match a landmark.
- for (let landmark of this.gLandmarks) {
- if (roles.indexOf(landmark) > -1) {
- return gStringBundle.GetStringFromName(landmark);
- }
- }
- };
-
- let landmark = getLandmarkName.apply(this, [aAccessible]);
+ let landmarkName = Utils.getLandmarkName(aAccessible);
+ if (!landmarkName) {
+ return;
+ }
+ let landmark = gStringBundle.GetStringFromName(landmarkName);
if (!landmark) {
return;
}
@@ -222,15 +212,6 @@ this.OutputGenerator = {
return str.replace('#1', aCount);
},
- gLandmarks: [
- 'banner',
- 'complementary',
- 'contentinfo',
- 'main',
- 'navigation',
- 'search'
- ],
-
roleRuleMap: {
'menubar': INCLUDE_DESC,
'scrollbar': INCLUDE_DESC,
diff --git a/accessible/src/jsat/TraversalRules.jsm b/accessible/src/jsat/TraversalRules.jsm
index e58f6e2f18cf..9473f56786c0 100644
--- a/accessible/src/jsat/TraversalRules.jsm
+++ b/accessible/src/jsat/TraversalRules.jsm
@@ -184,6 +184,14 @@ this.TraversalRules = {
[ROLE_COMBOBOX,
ROLE_LISTBOX]),
+ Landmark: new BaseTraversalRule(
+ [],
+ function Landmark_match(aAccessible) {
+ return Utils.getLandmarkName(aAccessible) ? FILTER_MATCH :
+ FILTER_IGNORE;
+ }
+ ),
+
Entry: new BaseTraversalRule(
[ROLE_ENTRY,
ROLE_PASSWORD_TEXT]),
diff --git a/accessible/src/jsat/Utils.jsm b/accessible/src/jsat/Utils.jsm
index 9968dbf15155..257a2e394c94 100644
--- a/accessible/src/jsat/Utils.jsm
+++ b/accessible/src/jsat/Utils.jsm
@@ -260,6 +260,28 @@ this.Utils = {
}
return true;
+ },
+
+ getLandmarkName: function getLandmarkName(aAccessible) {
+ const landmarks = [
+ 'banner',
+ 'complementary',
+ 'contentinfo',
+ 'main',
+ 'navigation',
+ 'search'
+ ];
+ let roles = this.getAttributes(aAccessible)['xml-roles'];
+ if (!roles) {
+ return;
+ }
+
+ // Looking up a role that would match a landmark.
+ for (let landmark of landmarks) {
+ if (roles.indexOf(landmark) > -1) {
+ return landmark;
+ }
+ }
}
};
diff --git a/accessible/src/mac/Makefile.in b/accessible/src/mac/Makefile.in
index 3f5cfc1e8d6f..90a6b6ae2d5c 100644
--- a/accessible/src/mac/Makefile.in
+++ b/accessible/src/mac/Makefile.in
@@ -13,9 +13,6 @@ EXPORT_LIBRARY = ..
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \
diff --git a/accessible/src/other/Makefile.in b/accessible/src/other/Makefile.in
index ae3671607f36..1c65f82a96a6 100644
--- a/accessible/src/other/Makefile.in
+++ b/accessible/src/other/Makefile.in
@@ -12,9 +12,6 @@ include $(DEPTH)/config/autoconf.mk
EXPORT_LIBRARY = ..
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \
diff --git a/accessible/src/windows/ia2/Makefile.in b/accessible/src/windows/ia2/Makefile.in
index 3672bbb1f984..68a7528c813a 100644
--- a/accessible/src/windows/ia2/Makefile.in
+++ b/accessible/src/windows/ia2/Makefile.in
@@ -17,9 +17,6 @@ LIBXUL_LIBRARY = 1
# macros which conflicts with std::min/max. Suppress the macros:
OS_CXXFLAGS += -DNOMINMAX
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
diff --git a/accessible/src/windows/msaa/Makefile.in b/accessible/src/windows/msaa/Makefile.in
index 092deff85ed4..374684e665a3 100644
--- a/accessible/src/windows/msaa/Makefile.in
+++ b/accessible/src/windows/msaa/Makefile.in
@@ -13,9 +13,6 @@ LIBRARY_NAME = accessibility_toolkit_msaa_s
EXPORT_LIBRARY = 1
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk
diff --git a/accessible/src/windows/sdn/Makefile.in b/accessible/src/windows/sdn/Makefile.in
index b61c86a86d17..e29ceb897647 100644
--- a/accessible/src/windows/sdn/Makefile.in
+++ b/accessible/src/windows/sdn/Makefile.in
@@ -16,9 +16,6 @@ LIBXUL_LIBRARY = 1
# macros which conflicts with std::min/max. Suppress the macros:
OS_CXXFLAGS += -DNOMINMAX
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
diff --git a/accessible/src/windows/uia/Makefile.in b/accessible/src/windows/uia/Makefile.in
index 86f84a2a62dd..9422f8cb6a65 100644
--- a/accessible/src/windows/uia/Makefile.in
+++ b/accessible/src/windows/uia/Makefile.in
@@ -16,9 +16,6 @@ LIBXUL_LIBRARY = 1
# macros which conflicts with std::min/max. Suppress the macros:
OS_CXXFLAGS += -DNOMINMAX
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
diff --git a/accessible/src/xpcom/Makefile.in b/accessible/src/xpcom/Makefile.in
index 31d2b799a445..e048bb5a46cc 100644
--- a/accessible/src/xpcom/Makefile.in
+++ b/accessible/src/xpcom/Makefile.in
@@ -12,9 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
EXTRA_MDDEPEND_FILES = xpcAccEvents.pp
include $(topsrcdir)/config/rules.mk
diff --git a/accessible/src/xul/Makefile.in b/accessible/src/xul/Makefile.in
index 8b134912ee08..c2dd89d8ffbf 100644
--- a/accessible/src/xul/Makefile.in
+++ b/accessible/src/xul/Makefile.in
@@ -12,9 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
diff --git a/addon-sdk/source/bin/activate.fish b/addon-sdk/source/bin/activate.fish
new file mode 100644
index 000000000000..1f728b69be13
--- /dev/null
+++ b/addon-sdk/source/bin/activate.fish
@@ -0,0 +1,66 @@
+# 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/.
+
+# This file must be used with "source bin/activate.fish" *from fish*
+# you cannot run it directly
+
+# Much of this code is based off of the activate.fish file for the
+# virtualenv project. http://ur1.ca/ehmd6
+
+function deactivate -d "Exit addon-sdk and return to normal shell environment"
+ if test -n "$_OLD_VIRTUAL_PATH"
+ set -gx PATH $_OLD_VIRTUAL_PATH
+ set -e _OLD_VIRTUAL_PATH
+ end
+
+ if test -n "$_OLD_PYTHONPATH"
+ set -gx PYTHONPATH $_OLD_PYTHONPATH
+ set -e _OLD_PYTHONPATH
+ end
+
+ if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
+ functions -e fish_prompt
+ set -e _OLD_FISH_PROMPT_OVERRIDE
+ . ( begin
+ printf "function fish_prompt\n\t#"
+ functions _old_fish_prompt
+ end | psub )
+
+ functions -e _old_fish_prompt
+ end
+
+ set -e CUDDLEFISH_ROOT
+ set -e VIRTUAL_ENV
+
+ if test "$argv[1]" != "nondestructive"
+ functions -e deactivate
+ end
+end
+
+# unset irrelavent variables
+deactivate nondestructive
+
+set -gx _OLD_PYTHONPATH $PYTHONPATH
+set -gx _OLD_VIRTUAL_PATH $PATH
+set -gx _OLD_FISH_PROMPT_OVERRIDE "true"
+
+set VIRTUAL_ENV (pwd)
+
+set -gx CUDDLEFISH_ROOT $VIRTUAL_ENV
+set -gx PYTHONPATH "$VIRTUAL_ENV/python-lib" $PYTHONPATH
+set -gx PATH "$VIRTUAL_ENV/bin" $PATH
+
+# save the current fish_prompt function as the function _old_fish_prompt
+. ( begin
+ printf "function _old_fish_prompt\n\t#"
+ functions fish_prompt
+ end | psub )
+
+# with the original prompt function renamed, we can override with our own.
+function fish_prompt
+ printf "(%s)%s%s" (basename "$VIRTUAL_ENV") (set_color normal) (_old_fish_prompt)
+ return
+end
+
+python -c "from jetpack_sdk_env import welcome; welcome()"
diff --git a/addon-sdk/source/doc/dev-guide-source/credits.md b/addon-sdk/source/doc/dev-guide-source/credits.md
index 8dfaad656bd9..30386881911b 100644
--- a/addon-sdk/source/doc/dev-guide-source/credits.md
+++ b/addon-sdk/source/doc/dev-guide-source/credits.md
@@ -43,6 +43,7 @@ We'd like to thank our many Jetpack project contributors! They include:
### F ###
+* [Corey Farwell](http://github.com/frewsxcv)
* [Matteo Ferretti](https://github.com/ZER0)
* fuzzykiller
diff --git a/addon-sdk/source/doc/module-source/sdk/page-mod/match-pattern.md b/addon-sdk/source/doc/module-source/sdk/page-mod/match-pattern.md
deleted file mode 100644
index a3ccea863c6d..000000000000
--- a/addon-sdk/source/doc/module-source/sdk/page-mod/match-pattern.md
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-The `match-pattern` module can be used to test strings containing URLs
-against simple patterns.
-
-## Specifying Patterns ##
-
-There are three ways you can specify patterns:
-
-* as an exact match string
-* using a wildcard in a string
-* using a regular expression
-
-### Exact Matches ###
-
-**A URL** matches only that URL. The URL must start with a scheme, end with a
-slash, and contain no wildcards.
-
-
-
-
-
-
-
-
-
-
- Example pattern
- Example matching URLs
- Example non-matching URLs
-
-
-
- "http://example.com/"
- http://example.com/
- http://example.com
- http://example.com/foo
- https://example.com/
- http://foo.example.com/
-
-
-
-
-### Wildcards ###
-
-**A single asterisk** matches any URL with an `http`, `https`, or `ftp`
-scheme. For other schemes like `file`, `resource`, or `data`, use a scheme
-followed by an asterisk, as below.
-
-
-
-
-
-
-
-
-
-
- Example pattern
- Example matching URLs
- Example non-matching URLs
-
-
-
- "*"
- http://example.com/
- https://example.com/
- ftp://example.com/
- http://bar.com/foo.js
- http://foo.com/
- file://example.js
- resource://me/my-addon/data/file.html
- data:text/html,Hi there
-
-
-
-
-**A domain name prefixed with an asterisk and dot** matches any URL of that
-domain or a subdomain, using any of `http`, `https`, `ftp`.
-
-
-
-
-
-
-
-
-
-
- Example pattern
- Example matching URLs
- Example non-matching URLs
-
-
-
- "*.example.com"
- http://example.com/
- http://foo.example.com/
- https://example.com/
- http://example.com/foo
- ftp://foo.example.com/
- ldap://example.com
- http://example.foo.com/
-
-
-
-
-**A URL followed by an asterisk** matches that URL and any URL prefixed with
-the pattern.
-
-
-
-
-
-
-
-
-
-
- Example pattern
- Example matching URLs
- Example non-matching URLs
-
-
-
- "https://foo.com/*"
- https://foo.com/
- https://foo.com/bar
- http://foo.com/
- https://foo.com
- https://bar.foo.com/
-
-
-
-
-**A scheme followed by an asterisk** matches all URLs with that scheme. To
-match local files, use `file://*`, and to match files loaded from your
-add-on's [data](modules/sdk/self.html#data) directory, use `resource://`.
-
-
-
-
-
-
-
-
-
- Example pattern
- Example matching URLs
-
-
-
- "file://*"
- file://C:/file.html
- file:///home/file.png
-
-
-
- "resource://*"
- resource://my-addon-at-me-dot-org/my-addon/data/file.html
-
-
-
- "data:*"
- data:text/html,Hi there
-
-
-
-
-### Regular Expressions ###
-
-You can specify patterns using a
-[regular expression](https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions):
-
- var { MatchPattern } = require("sdk/page-mod/match-pattern");
- var pattern = new MatchPattern(/.*example.*/);
-
-The regular expression is subject to restrictions based on those applied to the
-[HTML5 pattern attribute](http://dev.w3.org/html5/spec/common-input-element-attributes.html#attr-input-pattern). In particular:
-
-* The pattern must match the entire value, not just any subset. For example, the
-pattern `/moz.*/` will not match the URL `http://mozilla.org`.
-
-* The expression is compiled with the `global`, `ignoreCase`, and `multiline` flags
- disabled. The `MatchPattern` constructor will throw an exception
- if you try to set any of these flags.
-
-
-
-
-
-
-
-
-
-
- Example pattern
- Example matching URLs
- Example non-matching URLs
-
-
-
- /.*moz.*/
- http://foo.mozilla.org/
- http://mozilla.org
- https://mozilla.org
- http://foo.com/mozilla
- http://hemozoon.org
- mozscheme://foo.org
- http://foo.org
-
-
-
- /http:\/\/moz.*/
- http://mozilla.org
- http://mozzarella.com
- https://mozilla.org
- http://foo.mozilla.org/
- http://foo.com/moz
-
-
-
- /http.*moz.*/
- http://foo.mozilla.org/
- http://mozilla.org
- http://hemozoon.org/
- ftp://http/mozilla.org
-
-
-
-
-## Examples ##
-
- var { MatchPattern } = require("sdk/page-mod/match-pattern");
- var pattern = new MatchPattern("http://example.com/*");
- console.log(pattern.test("http://example.com/")); // true
- console.log(pattern.test("http://example.com/foo")); // true
- console.log(pattern.test("http://foo.com/")); // false!
-
-
-@class
-
-@constructor
- This constructor creates match pattern objects that can be used to test URLs.
-@param pattern {string}
- The pattern to use. See Patterns above.
-
-
-
-@method
- Tests a URL against the match pattern.
-@param url {string}
- The URL to test.
-@returns {boolean}
- True if the URL matches the pattern and false otherwise.
-
-
diff --git a/addon-sdk/source/doc/static-files/media/xul-migration-cs.png b/addon-sdk/source/doc/static-files/media/xul-migration-cs.png
deleted file mode 100644
index 639faaa2be35..000000000000
Binary files a/addon-sdk/source/doc/static-files/media/xul-migration-cs.png and /dev/null differ
diff --git a/addon-sdk/source/lib/sdk/core/promise.js b/addon-sdk/source/lib/sdk/core/promise.js
index 599b62654342..8b01a0f0a77a 100644
--- a/addon-sdk/source/lib/sdk/core/promise.js
+++ b/addon-sdk/source/lib/sdk/core/promise.js
@@ -22,6 +22,8 @@
return imports;
}, this[factory.name], { uri: __URI__, id: id });
this.EXPORTED_SYMBOLS = [factory.name];
+ } else if (~String(this).indexOf('Sandbox')) { // Sandbox
+ factory(function require(uri) {}, this, { id: id });
} else { // Browser or alike
var globals = this;
factory(function require(id) {
diff --git a/addon-sdk/source/lib/sdk/indexed-db.js b/addon-sdk/source/lib/sdk/indexed-db.js
index af6111d841c9..b0bd79b44990 100644
--- a/addon-sdk/source/lib/sdk/indexed-db.js
+++ b/addon-sdk/source/lib/sdk/indexed-db.js
@@ -56,7 +56,6 @@ exports.DOMException = Ci.nsIDOMDOMException;
exports.IDBCursor = Ci.nsIIDBCursor;
exports.IDBTransaction = Ci.nsIIDBTransaction;
exports.IDBOpenDBRequest = Ci.nsIIDBOpenDBRequest;
-exports.IDBVersionChangeEvent = Ci.nsIIDBVersionChangeEvent;
exports.IDBDatabase = Ci.nsIIDBDatabase;
exports.IDBIndex = Ci.nsIIDBIndex;
exports.IDBObjectStore = Ci.nsIIDBObjectStore;
diff --git a/addon-sdk/source/lib/sdk/panel/window.js b/addon-sdk/source/lib/sdk/panel/window.js
index a69c2eea72b1..5110e4b3880a 100644
--- a/addon-sdk/source/lib/sdk/panel/window.js
+++ b/addon-sdk/source/lib/sdk/panel/window.js
@@ -3,6 +3,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
+// The panel module currently supports only Firefox.
+// See: https://bugzilla.mozilla.org/show_bug.cgi?id=jetpack-panel-apps
+module.metadata = {
+ 'stability': 'unstable',
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
+
const { getMostRecentBrowserWindow, windows: getWindows } = require('../window/utils');
const { ignoreWindow } = require('../private-browsing/utils');
const { isPrivateBrowsingSupported } = require('../self');
diff --git a/addon-sdk/source/lib/sdk/places/favicon.js b/addon-sdk/source/lib/sdk/places/favicon.js
index baa77ed64822..1d0198c2d138 100644
--- a/addon-sdk/source/lib/sdk/places/favicon.js
+++ b/addon-sdk/source/lib/sdk/places/favicon.js
@@ -5,7 +5,10 @@
"use strict";
module.metadata = {
- "stability": "unstable"
+ "stability": "unstable",
+ "engines": {
+ "Firefox": "*"
+ }
};
const { Cc, Ci, Cu } = require("chrome");
diff --git a/addon-sdk/source/lib/sdk/test/utils.js b/addon-sdk/source/lib/sdk/test/utils.js
index f9ff72184bba..6821bcf63f29 100644
--- a/addon-sdk/source/lib/sdk/test/utils.js
+++ b/addon-sdk/source/lib/sdk/test/utils.js
@@ -12,7 +12,8 @@ module.metadata = {
function getTestNames (exports)
Object.keys(exports).filter(name => /^test/.test(name))
-function isAsync (fn) fn.length > 1
+function isTestAsync (fn) fn.length > 1
+function isHelperAsync (fn) fn.length > 2
/*
* Takes an `exports` object of a test file and a function `beforeFn`
@@ -24,31 +25,31 @@ function isAsync (fn) fn.length > 1
function before (exports, beforeFn) {
getTestNames(exports).map(name => {
let testFn = exports[name];
- if (!isAsync(testFn) && !isAsync(beforeFn)) {
+ if (!isTestAsync(testFn) && !isHelperAsync(beforeFn)) {
exports[name] = function (assert) {
- beforeFn(name);
+ beforeFn(name, assert);
testFn(assert);
};
}
- else if (isAsync(testFn) && !isAsync(beforeFn)) {
+ else if (isTestAsync(testFn) && !isHelperAsync(beforeFn)) {
exports[name] = function (assert, done) {
- beforeFn(name);
+ beforeFn(name, assert);
testFn(assert, done);
- }
+ };
}
- else if (!isAsync(testFn) && isAsync(beforeFn)) {
+ else if (!isTestAsync(testFn) && isHelperAsync(beforeFn)) {
exports[name] = function (assert, done) {
- beforeFn(name, () => {
+ beforeFn(name, assert, () => {
testFn(assert);
done();
});
- }
- } else if (isAsync(testFn) && isAsync(beforeFn)) {
+ };
+ } else if (isTestAsync(testFn) && isHelperAsync(beforeFn)) {
exports[name] = function (assert, done) {
- beforeFn(name, () => {
+ beforeFn(name, assert, () => {
testFn(assert, done);
});
- }
+ };
}
});
}
@@ -64,31 +65,31 @@ exports.before = before;
function after (exports, afterFn) {
getTestNames(exports).map(name => {
let testFn = exports[name];
- if (!isAsync(testFn) && !isAsync(afterFn)) {
+ if (!isTestAsync(testFn) && !isHelperAsync(afterFn)) {
exports[name] = function (assert) {
testFn(assert);
- afterFn(name);
+ afterFn(name, assert);
};
}
- else if (isAsync(testFn) && !isAsync(afterFn)) {
+ else if (isTestAsync(testFn) && !isHelperAsync(afterFn)) {
exports[name] = function (assert, done) {
testFn(assert, () => {
- afterFn(name);
+ afterFn(name, assert);
done();
});
- }
+ };
}
- else if (!isAsync(testFn) && isAsync(afterFn)) {
+ else if (!isTestAsync(testFn) && isHelperAsync(afterFn)) {
exports[name] = function (assert, done) {
testFn(assert);
- afterFn(name, done);
- }
- } else if (isAsync(testFn) && isAsync(afterFn)) {
+ afterFn(name, assert, done);
+ };
+ } else if (isTestAsync(testFn) && isHelperAsync(afterFn)) {
exports[name] = function (assert, done) {
testFn(assert, () => {
- afterFn(name, done);
+ afterFn(name, assert, done);
});
- }
+ };
}
});
}
diff --git a/addon-sdk/source/test/tabs/test-firefox-tabs.js b/addon-sdk/source/test/tabs/test-firefox-tabs.js
index 14525306fd44..1d5346ac783a 100644
--- a/addon-sdk/source/test/tabs/test-firefox-tabs.js
+++ b/addon-sdk/source/test/tabs/test-firefox-tabs.js
@@ -8,9 +8,10 @@ const { Loader } = require('sdk/test/loader');
const timer = require('sdk/timers');
const { getOwnerWindow } = require('sdk/private-browsing/window/utils');
const { windows, onFocus, getMostRecentBrowserWindow } = require('sdk/window/utils');
-const { open, focus } = require('sdk/window/helpers');
+const { open, focus, close } = require('sdk/window/helpers');
const { StringBundle } = require('sdk/deprecated/app-strings');
const tabs = require('sdk/tabs');
+const { browserWindows } = require('sdk/windows');
const base64png = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYA" +
"AABzenr0AAAASUlEQVRYhe3O0QkAIAwD0eyqe3Q993AQ3cBSUKpygfsNTy" +
@@ -93,14 +94,51 @@ exports.testAutomaticDestroy = function(test) {
timer.setTimeout(function () {
test.assert(!called, "Unloaded tab module is destroyed and inactive");
tab.close(test.done.bind(test));
- }, 0);
+ });
});
-
tabs.open("data:text/html;charset=utf-8,foo");
};
-// test tab properties
-exports.testTabProperties = function(test) {
+exports.testTabPropertiesInNewWindow = function(test) {
+ test.waitUntilDone();
+
+ let count = 0;
+ function onReadyOrLoad (tab) {
+ if (count++) {
+ close(getOwnerWindow(tab)).then(test.done.bind(test));
+ }
+ }
+
+ let url = "data:text/html;charset=utf-8,foo
foo";
+ tabs.open({
+ inNewWindow: true,
+ url: url,
+ onReady: function(tab) {
+ test.assertEqual(tab.title, "foo", "title of the new tab matches");
+ test.assertEqual(tab.url, url, "URL of the new tab matches");
+ test.assert(tab.favicon, "favicon of the new tab is not empty");
+ test.assertEqual(tab.style, null, "style of the new tab matches");
+ test.assertEqual(tab.index, 0, "index of the new tab matches");
+ test.assertNotEqual(tab.getThumbnail(), null, "thumbnail of the new tab matches");
+ test.assertNotEqual(tab.id, null, "a tab object always has an id property.");
+
+ onReadyOrLoad(tab);
+ },
+ onLoad: function(tab) {
+ test.assertEqual(tab.title, "foo", "title of the new tab matches");
+ test.assertEqual(tab.url, url, "URL of the new tab matches");
+ test.assert(tab.favicon, "favicon of the new tab is not empty");
+ test.assertEqual(tab.style, null, "style of the new tab matches");
+ test.assertEqual(tab.index, 0, "index of the new tab matches");
+ test.assertNotEqual(tab.getThumbnail(), null, "thumbnail of the new tab matches");
+ test.assertNotEqual(tab.id, null, "a tab object always has an id property.");
+
+ onReadyOrLoad(tab);
+ }
+ });
+};
+
+exports.testTabPropertiesInSameWindow = function(test) {
test.waitUntilDone();
let count = 0;
@@ -121,6 +159,7 @@ exports.testTabProperties = function(test) {
test.assertEqual(tab.index, 1, "index of the new tab matches");
test.assertNotEqual(tab.getThumbnail(), null, "thumbnail of the new tab matches");
test.assertNotEqual(tab.id, null, "a tab object always has an id property.");
+
onReadyOrLoad(tab);
},
onLoad: function(tab) {
@@ -131,6 +170,7 @@ exports.testTabProperties = function(test) {
test.assertEqual(tab.index, 1, "index of the new tab matches");
test.assertNotEqual(tab.getThumbnail(), null, "thumbnail of the new tab matches");
test.assertNotEqual(tab.id, null, "a tab object always has an id property.");
+
onReadyOrLoad(tab);
}
});
@@ -244,7 +284,7 @@ exports.testTabClose = function(test) {
exports.testTabMove = function(test) {
test.waitUntilDone();
- open().then(function(window) {
+ open().then(focus).then(function(window) {
let url = "data:text/html;charset=utf-8,foo";
tabs.open({
@@ -965,8 +1005,6 @@ exports.testFaviconGetterDeprecation = function (test) {
});
}
-
-
/******************* helpers *********************/
// Helper for getting the active window
diff --git a/addon-sdk/source/test/test-indexed-db.js b/addon-sdk/source/test/test-indexed-db.js
index 5ba45670e6d1..8a2fa6457dcb 100644
--- a/addon-sdk/source/test/test-indexed-db.js
+++ b/addon-sdk/source/test/test-indexed-db.js
@@ -9,8 +9,7 @@ if (xulApp.versionInRange(xulApp.platformVersion, "16.0a1", "*")) {
new function tests() {
const { indexedDB, IDBKeyRange, DOMException, IDBCursor, IDBTransaction,
- IDBOpenDBRequest, IDBVersionChangeEvent, IDBDatabase, IDBIndex,
- IDBObjectStore, IDBRequest
+ IDBOpenDBRequest, IDBDatabase, IDBIndex, IDBObjectStore, IDBRequest
} = require("sdk/indexed-db");
exports["test indexedDB is frozen"] = function(assert){
@@ -24,8 +23,8 @@ exports["test indexedDB is frozen"] = function(assert){
exports["test db variables"] = function(assert) {
[ indexedDB, IDBKeyRange, DOMException, IDBCursor, IDBTransaction,
- IDBOpenDBRequest, IDBOpenDBRequest, IDBVersionChangeEvent,
- IDBDatabase, IDBIndex, IDBObjectStore, IDBRequest
+ IDBOpenDBRequest, IDBOpenDBRequest, IDBDatabase, IDBIndex,
+ IDBObjectStore, IDBRequest
].forEach(function(value) {
assert.notEqual(typeof(value), "undefined", "variable is defined");
});
diff --git a/addon-sdk/source/test/test-panel.js b/addon-sdk/source/test/test-panel.js
index dc6af5cff231..d6f4966f7bf2 100644
--- a/addon-sdk/source/test/test-panel.js
+++ b/addon-sdk/source/test/test-panel.js
@@ -1,7 +1,13 @@
/* 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 strict';
+'use strict';
+
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
const { Cc, Ci } = require("chrome");
const { Loader } = require('sdk/test/loader');
@@ -923,18 +929,4 @@ else if (isGlobalPBSupported) {
}
}
-try {
- require("sdk/panel");
-}
-catch (e) {
- if (!/^Unsupported Application/.test(e.message))
- throw e;
-
- module.exports = {
- "test Unsupported Application": function Unsupported (assert) {
- assert.pass(e.message);
- }
- }
-}
-
require("test").run(exports);
diff --git a/addon-sdk/source/test/test-path.js b/addon-sdk/source/test/test-path.js
index 9c449c05adc8..9e9cb5c53190 100644
--- a/addon-sdk/source/test/test-path.js
+++ b/addon-sdk/source/test/test-path.js
@@ -335,8 +335,11 @@ if (isWindows) {
// arguments result
[[['/var/lib', '../', 'file/'], '/var/file'],
[['/var/lib', '/../', 'file/'], '/file'],
- [['a/b/c/', '../../..'], process.cwd()],
- [['.'], process.cwd()],
+ // For some mysterious reasons OSX debug builds resolve incorrectly
+ // https://tbpl.mozilla.org/php/getParsedLog.php?id=25105489&tree=Mozilla-Inbound
+ // Disable this tests until Bug 891698 is fixed.
+ // [['a/b/c/', '../../..'], process.cwd()],
+ // [['.'], process.cwd()],
[['/some/dir', '.', '/absolute/'], '/absolute']];
}
var failures = [];
diff --git a/addon-sdk/source/test/test-places-bookmarks.js b/addon-sdk/source/test/test-places-bookmarks.js
index 80f1cf4cf711..af18f1f53f27 100644
--- a/addon-sdk/source/test/test-places-bookmarks.js
+++ b/addon-sdk/source/test/test-places-bookmarks.js
@@ -3,6 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
+
const { Cc, Ci } = require('chrome');
const { request } = require('sdk/addon/host');
const { filter } = require('sdk/event/utils');
@@ -13,8 +19,6 @@ const { defer, all } = require('sdk/core/promise');
const { defer: async } = require('sdk/lang/functional');
const { before, after } = require('sdk/test/utils');
-// Test for unsupported platforms
-try {
const {
Bookmark, Group, Separator,
save, search, remove,
@@ -30,7 +34,6 @@ const bmsrv = Cc['@mozilla.org/browser/nav-bookmarks-service;1'].
getService(Ci.nsINavBookmarksService);
const tagsrv = Cc['@mozilla.org/browser/tagging-service;1'].
getService(Ci.nsITaggingService);
-} catch (e) { unsupported(e); }
exports.testDefaultFolders = function (assert) {
var ids = [
@@ -946,20 +949,6 @@ after(exports, name => {
clearAllBookmarks();
});
-// If the module doesn't support the app we're being run in, require() will
-// throw. In that case, remove all tests above from exports, and add one dummy
-// test that passes.
-function unsupported (err) {
- if (!/^Unsupported Application/.test(err.message))
- throw err;
-
- module.exports = {
- "test Unsupported Application": function Unsupported (assert) {
- assert.pass(err.message);
- }
- };
-}
-
function saveP () {
return promisedEmitter(save.apply(null, Array.slice(arguments)));
}
diff --git a/addon-sdk/source/test/test-places-favicon.js b/addon-sdk/source/test/test-places-favicon.js
index 77f58888a3df..80f921f7d316 100644
--- a/addon-sdk/source/test/test-places-favicon.js
+++ b/addon-sdk/source/test/test-places-favicon.js
@@ -2,6 +2,14 @@
* 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 strict';
+
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
+
const { Cc, Ci, Cu } = require('chrome');
const { getFavicon } = require('sdk/places/favicon');
const tabs = require('sdk/tabs');
diff --git a/addon-sdk/source/test/test-places-history.js b/addon-sdk/source/test/test-places-history.js
index f3829d01b4f4..d2c467bea5e7 100644
--- a/addon-sdk/source/test/test-places-history.js
+++ b/addon-sdk/source/test/test-places-history.js
@@ -1,14 +1,19 @@
/* 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 strict'
+'use strict';
+
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
const { Cc, Ci } = require('chrome');
const { defer, all } = require('sdk/core/promise');
const { has } = require('sdk/util/array');
const { setTimeout } = require('sdk/timers');
const { before, after } = require('sdk/test/utils');
-try {
const {
search
} = require('sdk/places/history');
@@ -19,7 +24,6 @@ const {
const { promisedEmitter } = require('sdk/places/utils');
const hsrv = Cc['@mozilla.org/browser/nav-history-service;1'].
getService(Ci.nsINavHistoryService);
-} catch(e) { unsupported(e); }
exports.testEmptyQuery = function (assert, done) {
let within = toBeWithin();
@@ -240,25 +244,11 @@ function clear (done) {
clearHistory(done);
}
-// If the module doesn't support the app we're being run in, require() will
-// throw. In that case, remove all tests above from exports, and add one dummy
-// test that passes.
-function unsupported (err) {
- if (!/^Unsupported Application/.test(err.message))
- throw err;
-
- module.exports = {
- "test Unsupported Application": function Unsupported (assert) {
- assert.pass(err.message);
- }
- };
-}
-
function searchP () {
return promisedEmitter(search.apply(null, Array.slice(arguments)));
}
-before(exports, (name, done) => clear(done));
-after(exports, (name, done) => clear(done));
+before(exports, (name, assert, done) => clear(done));
+after(exports, (name, assert, done) => clear(done));
require('test').run(exports);
diff --git a/addon-sdk/source/test/test-places-host.js b/addon-sdk/source/test/test-places-host.js
index c955f127c78a..b76049d5129a 100644
--- a/addon-sdk/source/test/test-places-host.js
+++ b/addon-sdk/source/test/test-places-host.js
@@ -3,12 +3,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
+
const { Cc, Ci } = require('chrome');
const { defer, all } = require('sdk/core/promise');
const { setTimeout } = require('sdk/timers');
const { newURI } = require('sdk/url/utils');
const { send } = require('sdk/addon/events');
-try {
+
require('sdk/places/host/host-bookmarks');
require('sdk/places/host/host-tags');
require('sdk/places/host/host-query');
@@ -24,7 +30,6 @@ const hsrv = Cc['@mozilla.org/browser/nav-history-service;1'].
const tagsrv = Cc['@mozilla.org/browser/tagging-service;1'].
getService(Ci.nsITaggingService);
clearAllBookmarks();
-} catch(e) { unsupported(e); }
exports.testBookmarksCreate = function (assert, done) {
let items = [{
@@ -276,17 +281,4 @@ exports.testGetAllChildren = function (assert, done) {
});
};
-// If the module doesn't support the app we're being run in, require() will
-// throw. In that case, remove all tests above from exports, and add one dummy
-// test that passes.
-function unsupported (err) {
- if (!/^Unsupported Application/.test(err.message))
- throw err;
-
- module.exports = {
- "test Unsupported Application": function Unsupported (assert) {
- assert.pass(err.message);
- }
- };
-}
require('test').run(exports);
diff --git a/addon-sdk/source/test/test-places-utils.js b/addon-sdk/source/test/test-places-utils.js
index 0babcc12e23f..54b039358bc7 100644
--- a/addon-sdk/source/test/test-places-utils.js
+++ b/addon-sdk/source/test/test-places-utils.js
@@ -3,11 +3,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
+
const { defer, all } = require('sdk/core/promise');
const { setTimeout } = require('sdk/timers');
-try {
const { TreeNode } = require('sdk/places/utils');
-} catch(e) { unsupported(e); }
exports['test construct tree'] = function (assert) {
let tree = TreeNode(1);
@@ -74,18 +78,4 @@ exports['test async walk'] = function (assert, done) {
});
};
-// If the module doesn't support the app we're being run in, require() will
-// throw. In that case, remove all tests above from exports, and add one dummy
-// test that passes.
-function unsupported (err) {
- if (!/^Unsupported Application/.test(err.message))
- throw err;
-
- module.exports = {
- "test Unsupported Application": function Unsupported (assert) {
- assert.pass(err.message);
- }
- };
-}
-
require('test').run(exports);
diff --git a/addon-sdk/source/test/test-selection.js b/addon-sdk/source/test/test-selection.js
index 7826234716e5..0b6a2c11fd7c 100644
--- a/addon-sdk/source/test/test-selection.js
+++ b/addon-sdk/source/test/test-selection.js
@@ -2,7 +2,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/. */
-"use strict";
+'use strict';
+
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
const HTML = "\
\
@@ -988,21 +994,4 @@ if (!require("sdk/private-browsing/utils").isWindowPBSupported) {
});
}
-// If the module doesn't support the app we're being run in, require() will
-// throw. In that case, remove all tests above from exports, and add one dummy
-// test that passes.
-try {
- require("sdk/selection");
-}
-catch (err) {
- if (!/^Unsupported Application/.test(err.message))
- throw err;
-
- module.exports = {
- "test Unsupported Application": function Unsupported (assert) {
- assert.pass(err.message);
- }
- }
-}
-
require("test").run(exports)
diff --git a/addon-sdk/source/test/test-tab-browser.js b/addon-sdk/source/test/test-tab-browser.js
index fc723be35f65..4178cdf61e2f 100644
--- a/addon-sdk/source/test/test-tab-browser.js
+++ b/addon-sdk/source/test/test-tab-browser.js
@@ -1,7 +1,13 @@
/* 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 strict";
+'use strict';
+
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
var timer = require("sdk/timers");
var { Cc, Ci } = require("chrome");
@@ -492,21 +498,4 @@ function activeWindow() {
return Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator).
getMostRecentWindow("navigator:browser");
-};
-
-// If the module doesn't support the app we're being run in, require() will
-// throw. In that case, remove all tests above from exports, and add one dummy
-// test that passes.
-try {
- require("sdk/deprecated/tab-browser");
-}
-catch (err) {
- if (!/^Unsupported Application/.test(err.message))
- throw err;
-
- module.exports = {
- testAppNotSupported: function (test) {
- test.pass(err.message);
- }
- };
}
diff --git a/addon-sdk/source/test/test-test-utils-async.js b/addon-sdk/source/test/test-test-utils-async.js
index 1eaaa66860f1..6699fd55bac8 100644
--- a/addon-sdk/source/test/test-test-utils-async.js
+++ b/addon-sdk/source/test/test-test-utils-async.js
@@ -55,21 +55,23 @@ exports.testSyncAfter = function (assert) {
AFTER_RUN = 0;
};
-before(exports, (name, done) => {
+before(exports, (name, assert, done) => {
if (name === 'testABeforeNameAsync')
BEFORE_RUN = 2;
else
BEFORE_RUN = 1;
+ assert.pass('assert passed into before function');
async(done)();
});
-after(exports, (name, done) => {
+after(exports, (name, assert, done) => {
// testAfterName runs after testAfter, which is where this
// check occurs in the assertation
if (name === 'testAfterAsync')
AFTER_RUN = 2;
else
AFTER_RUN = 1;
+ assert.pass('assert passed into after function');
async(done)();
});
diff --git a/addon-sdk/source/test/test-test-utils-sync.js b/addon-sdk/source/test/test-test-utils-sync.js
index 97f875be248d..c8f0c00b84cc 100644
--- a/addon-sdk/source/test/test-test-utils-sync.js
+++ b/addon-sdk/source/test/test-test-utils-sync.js
@@ -55,20 +55,22 @@ exports.testSyncAfter = function (assert) {
AFTER_RUN = 0;
};
-before(exports, (name) => {
+before(exports, (name, assert) => {
if (name === 'testABeforeNameAsync')
BEFORE_RUN = 2;
else
BEFORE_RUN = 1;
+ assert.pass('assert passed into before function');
});
-after(exports, (name) => {
+after(exports, (name, assert) => {
// testAfterName runs after testAfter, which is where this
// check occurs in the assertation
if (name === 'testAfterAsync')
AFTER_RUN = 2;
else
AFTER_RUN = 1;
+ assert.pass('assert passed into after function');
});
require('sdk/test').run(exports);
diff --git a/addon-sdk/source/test/test-widget.js b/addon-sdk/source/test/test-widget.js
index 3c4d2f0df07d..451591681586 100644
--- a/addon-sdk/source/test/test-widget.js
+++ b/addon-sdk/source/test/test-widget.js
@@ -1,8 +1,15 @@
/* 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 strict";
+'use strict';
+module.metadata = {
+ 'engines': {
+ 'Firefox': '*'
+ }
+};
+
+const widgets = require("sdk/widget");
const { Cc, Ci } = require("chrome");
const { Loader } = require('sdk/test/loader');
const url = require("sdk/url");
@@ -1174,22 +1181,3 @@ function closeBrowserWindow(window, callback) {
window.close();
}, 0);
}
-
-// ADD NO TESTS BELOW THIS LINE! ///////////////////////////////////////////////
-
-// If the module doesn't support the app we're being run in, require() will
-// throw. In that case, remove all tests above from exports, and add one dummy
-// test that passes.
-try {
- const widgets = require("sdk/widget");
-}
-catch (err) {
- if (!/^Unsupported Application/.test(err.message))
- throw err;
-
- module.exports = {
- testAppNotSupported: function (test) {
- test.pass(err.message);
- }
- };
-}
diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
index 118fc4e27a55..129e9bb50066 100644
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -648,6 +648,7 @@ pref("dom.disable_window_open_dialog_feature", true);
// Screen reader support
pref("accessibility.accessfu.activate", 2);
+pref("accessibility.accessfu.quicknav_modes", "Link,Heading,FormElement,Landmark,ListItem");
// Setting for an utterance order (0 - description first, 1 - description last).
pref("accessibility.accessfu.utterance", 1);
// Whether to skip images with empty alt text
@@ -739,6 +740,6 @@ pref("ping.manifestURL", "https://marketplace.firefox.com/packaged.webapp");
// Enable the disk space watcher
pref("disk_space_watcher.enabled", true);
-// Enable future
-pref("dom.future.enabled", false);
+// Enable promise
+pref("dom.promise.enabled", false);
diff --git a/browser/app/firefox.exe.manifest b/browser/app/firefox.exe.manifest
index b5a6cc7c4bca..521405477381 100644
--- a/browser/app/firefox.exe.manifest
+++ b/browser/app/firefox.exe.manifest
@@ -33,7 +33,10 @@
-
+
+
+
+
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index 294c4cfba1b0..79b855e449aa 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -207,7 +207,6 @@ pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name", "chrome://browser
pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description", "chrome://browser/locale/browser.properties");
pref("xpinstall.whitelist.add", "addons.mozilla.org");
-pref("xpinstall.whitelist.add.36", "getpersonas.com");
pref("xpinstall.whitelist.add.180", "marketplace.firefox.com");
pref("lightweightThemes.update.enabled", true);
diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml
index 7fe05923b1b7..4034a220deb0 100644
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1105,11 +1105,11 @@
}
}
- // If the find bar is focused, keep it focused.
- if (gFindBarInitialized &&
- !gFindBar.hidden &&
- gFindBar.getElement("findbar-textbox").getAttribute("focused") == "true")
+ // If the find bar is open, focus it.
+ if (gFindBarInitialized && !gFindBar.hidden) {
+ gFindBar._findField.focus();
break;
+ }
// Otherwise, focus the content area.
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
diff --git a/browser/base/content/test/browser_bug537013.js b/browser/base/content/test/browser_bug537013.js
index 87080b879a45..2a54dfc96407 100644
--- a/browser/base/content/test/browser_bug537013.js
+++ b/browser/base/content/test/browser_bug537013.js
@@ -69,6 +69,9 @@ function continueTests() {
ok(gFindBar.hidden, "First tab doesn't show find bar!");
gBrowser.selectedTab = tabs[1];
ok(!gFindBar.hidden, "Second tab shows find bar!");
+ // Test for bug 892384
+ is(gFindBar._findField.getAttribute("focused"), "true",
+ "Open findbar refocused on tab change!");
gBrowser.selectedTab = tabs[0];
ok(gFindBar.hidden, "First tab doesn't show find bar!");
diff --git a/browser/components/preferences/advanced.js b/browser/components/preferences/advanced.js
index be77782ae990..088f26e4e31a 100644
--- a/browser/components/preferences/advanced.js
+++ b/browser/components/preferences/advanced.js
@@ -630,6 +630,7 @@ var gAdvancedPane = {
#ifdef MOZ_METRO
if (this._showingWin8Prefs) {
warnIncompatible.disabled |= metroEnabledPref.value;
+ warnIncompatible.checked |= metroEnabledPref.value;
}
#endif
#endif
@@ -680,6 +681,7 @@ var gAdvancedPane = {
{
var enabledPref = document.getElementById("app.update.enabled");
var autoPref = document.getElementById("app.update.auto");
+ var modePref = document.getElementById("app.update.mode");
#ifdef XP_WIN
#ifdef MOZ_METRO
var metroEnabledPref = document.getElementById("app.update.metro.enabled");
@@ -701,6 +703,7 @@ var gAdvancedPane = {
enabledPref.value = true;
autoPref.value = true;
metroEnabledPref.value = true;
+ modePref.value = 1;
break;
#endif
#endif
@@ -714,7 +717,6 @@ var gAdvancedPane = {
}
var warnIncompatible = document.getElementById("warnIncompatible");
- var modePref = document.getElementById("app.update.mode");
warnIncompatible.disabled = enabledPref.locked || !enabledPref.value ||
autoPref.locked || !autoPref.value ||
modePref.locked;
@@ -723,6 +725,7 @@ var gAdvancedPane = {
#ifdef MOZ_METRO
if (this._showingWin8Prefs) {
warnIncompatible.disabled |= metroEnabledPref.value;
+ warnIncompatible.checked |= metroEnabledPref.value;
}
#endif
#endif
diff --git a/browser/components/preferences/in-content/advanced.js b/browser/components/preferences/in-content/advanced.js
index 466d99117069..a9e441e08fe6 100644
--- a/browser/components/preferences/in-content/advanced.js
+++ b/browser/components/preferences/in-content/advanced.js
@@ -613,6 +613,7 @@ var gAdvancedPane = {
#ifdef MOZ_METRO
if (this._showingWin8Prefs) {
warnIncompatible.disabled |= metroEnabledPref.value;
+ warnIncompatible.checked |= metroEnabledPref.value;
}
#endif
#endif
@@ -645,6 +646,7 @@ var gAdvancedPane = {
{
var enabledPref = document.getElementById("app.update.enabled");
var autoPref = document.getElementById("app.update.auto");
+ var modePref = document.getElementById("app.update.mode");
#ifdef XP_WIN
#ifdef MOZ_METRO
var metroEnabledPref = document.getElementById("app.update.metro.enabled");
@@ -666,6 +668,7 @@ var gAdvancedPane = {
enabledPref.value = true;
autoPref.value = true;
metroEnabledPref.value = true;
+ modePref.value = 1;
break;
#endif
#endif
@@ -679,7 +682,6 @@ var gAdvancedPane = {
}
var warnIncompatible = document.getElementById("warnIncompatible");
- var modePref = document.getElementById("app.update.mode");
warnIncompatible.disabled = enabledPref.locked || !enabledPref.value ||
autoPref.locked || !autoPref.value ||
modePref.locked;
@@ -687,6 +689,7 @@ var gAdvancedPane = {
#ifdef MOZ_METRO
if (this._showingWin8Prefs) {
warnIncompatible.disabled |= metroEnabledPref.value;
+ warnIncompatible.checked |= metroEnabledPref.value;
}
#endif
#endif
diff --git a/browser/config/mozconfigs/linux32/nightly b/browser/config/mozconfigs/linux32/nightly
index 8daaec36e3da..f0b34f1e3e31 100644
--- a/browser/config/mozconfigs/linux32/nightly
+++ b/browser/config/mozconfigs/linux32/nightly
@@ -3,6 +3,7 @@
ac_add_options --enable-codesighs
ac_add_options --enable-signmar
ac_add_options --enable-profiling
+ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
diff --git a/browser/config/mozconfigs/linux64/nightly b/browser/config/mozconfigs/linux64/nightly
index 223624b630f3..024c986662eb 100644
--- a/browser/config/mozconfigs/linux64/nightly
+++ b/browser/config/mozconfigs/linux64/nightly
@@ -3,6 +3,7 @@
ac_add_options --enable-codesighs
ac_add_options --enable-signmar
ac_add_options --enable-profiling
+ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
diff --git a/browser/confvars.sh b/browser/confvars.sh
index 88c8af12c00c..ac28078dee67 100755
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -57,3 +57,4 @@ MOZ_MEDIA_NAVIGATOR=1
if test "$OS_TARGET" = "WINNT" -o "$OS_TARGET" = "Darwin"; then
MOZ_FOLD_LIBS=1
fi
+MOZ_WEBGL_CONFORMANT=1
diff --git a/browser/metro/base/content/browser-ui.js b/browser/metro/base/content/browser-ui.js
index 8580a71d6df2..d21f72037bbe 100644
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -1017,9 +1017,8 @@ var BrowserUI = {
}
// Check content helper
- let contentHelper = Elements.contentNavigator;
- if (contentHelper.isActive) {
- contentHelper.model.hide();
+ if (FindHelperUI.isActive) {
+ FindHelperUI.hide();
return;
}
diff --git a/browser/metro/theme/browser.css b/browser/metro/theme/browser.css
index b4e125d10330..636f9ab918de 100644
--- a/browser/metro/theme/browser.css
+++ b/browser/metro/theme/browser.css
@@ -161,6 +161,9 @@ documenttab[closing] > .documenttab-container {
width: @thumbnail_width@;
height: @thumbnail_height@;
}
+#tray:not([expanded]) .documenttab-thumbnail {
+ background-image: none!important;
+}
.documenttab-title {
margin: @metro_spacing_normal@ @metro_spacing_snormal@;
diff --git a/build/autoconf/android.m4 b/build/autoconf/android.m4
index fa31afbf42bf..9fea2a9aba07 100644
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -69,7 +69,7 @@ case "$target" in
kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
- for version in $android_gnu_compiler_version 4.6 4.4.3 ; do
+ for version in $android_gnu_compiler_version 4.7 4.6 4.4.3 ; do
case "$target_cpu" in
arm)
target_name=arm-linux-androideabi-$version
diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp
index 712a7497e80b..55268d7a6608 100644
--- a/build/unix/elfhack/elfhack.cpp
+++ b/build/unix/elfhack/elfhack.cpp
@@ -16,6 +16,9 @@
#ifndef R_ARM_V4BX
#define R_ARM_V4BX 0x28
#endif
+#ifndef R_ARM_JUMP24
+#define R_ARM_JUMP24 0x1d
+#endif
#ifndef R_ARM_THM_JUMP24
#define R_ARM_THM_JUMP24 0x1e
#endif
@@ -326,6 +329,7 @@ class ElfRelHackCode_Section: public ElfSection {
case REL(ARM, REL32):
apply_relocation(the_code, buf, &*r, addr);
break;
+ case REL(ARM, JUMP24):
case REL(ARM, PLT32):
apply_relocation(the_code, buf, &*r, addr);
break;
diff --git a/build/unix/mozconfig.linux b/build/unix/mozconfig.linux
index 6324ba718531..60fc174c91f1 100644
--- a/build/unix/mozconfig.linux
+++ b/build/unix/mozconfig.linux
@@ -2,3 +2,5 @@
CC="/tools/gcc-4.7.2-0moz1/bin/gcc"
CXX="/tools/gcc-4.7.2-0moz1/bin/g++"
+
+ac_add_options --enable-elf-hack
diff --git a/caps/src/Makefile.in b/caps/src/Makefile.in
index 96a12d49fc43..b5804cf4278e 100644
--- a/caps/src/Makefile.in
+++ b/caps/src/Makefile.in
@@ -11,7 +11,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MSVC_ENABLE_PGO := 1
-FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
diff --git a/chrome/src/Makefile.in b/chrome/src/Makefile.in
index 2f8a78c0811f..5ab2203e1a9b 100644
--- a/chrome/src/Makefile.in
+++ b/chrome/src/Makefile.in
@@ -13,7 +13,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = chrome_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
diff --git a/config/Makefile.in b/config/Makefile.in
index f82a659c416b..d6cd35a12bcb 100644
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -73,9 +73,6 @@ ifeq ($(OS_CONFIG),SunOS4.1)
NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
endif
-export::
- -$(RM) $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES)
-
# Generate a new buildid every time we "export" in config... that's only
# supposed to be once per-build!
export::
diff --git a/config/config.mk b/config/config.mk
index 389b8077809e..e2fa07f47ad1 100644
--- a/config/config.mk
+++ b/config/config.mk
@@ -116,10 +116,6 @@ endif
OS_CONFIG := $(OS_ARCH)$(OS_RELEASE)
-FINAL_LINK_LIBS = $(DEPTH)/config/final-link-libs
-FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps
-FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
-
MOZ_UNICHARUTIL_LIBS = $(LIBXUL_DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
MOZ_WIDGET_SUPPORT_LIBS = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)
@@ -328,14 +324,7 @@ endif
# building libxul libraries
ifdef LIBXUL_LIBRARY
DEFINES += \
- -D_IMPL_NS_COM \
- -DEXPORT_XPT_API \
- -DEXPORT_XPTC_API \
- -D_IMPL_NS_GFX \
- -D_IMPL_NS_WIDGET \
- -DIMPL_XREAPI \
- -DIMPL_NS_NET \
- -DIMPL_THEBES \
+ -DIMPL_LIBXUL \
$(NULL)
ifndef JS_SHARED_LIBRARY
@@ -813,3 +802,11 @@ MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk2/compat $(MOZ_GTK2_CFLAGS)
endif
DEFINES += -DNO_NSPR_10_SUPPORT
+
+# Run a named Python build action. The first argument is the name of the build
+# action. The second argument are the arguments to pass to the action (space
+# delimited arguments). e.g.
+#
+# libs::
+# $(call py_action,purge_manifests,_build_manifests/purge/foo.manifest)
+py_action = $(PYTHON) -m mozbuild.action.$(1) $(2)
diff --git a/config/makefiles/target_export.mk b/config/makefiles/target_export.mk
index 7aa530bfe99f..d626af8674a9 100644
--- a/config/makefiles/target_export.mk
+++ b/config/makefiles/target_export.mk
@@ -30,18 +30,3 @@ export:: $(SUBMAKEFILES) $(MAKE_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
-
-#
-# Rule to create list of libraries for final link
-#
-# todo: use pre-req deps rather than conditionals
-export:: export-gen-final-lib-link-list
-export-gen-final-lib-link-list:
-ifdef LIBRARY_NAME #{
-ifdef EXPORT_LIBRARY #{
-ifdef IS_COMPONENT #{
-else # !IS_COMPONENT
- $(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
-endif #} IS_COMPONENT
-endif #} EXPORT_LIBRARY
-endif #} LIBRARY_NAME
diff --git a/config/makefiles/test/Makefile.in b/config/makefiles/test/Makefile.in
index 6472b525e6e4..8bb01d0ba2ff 100644
--- a/config/makefiles/test/Makefile.in
+++ b/config/makefiles/test/Makefile.in
@@ -19,12 +19,10 @@ include $(topsrcdir)/config/makefiles/makeutils.mk
dir-ts = .deps/test
check-arglist = $(dir-ts)/arglist.ts
check-autotargets = $(dir-ts)/autotargets_mk.ts
-check-export-targets = $(dir-ts)/export-targets-mk.ts
check-XinY = $(dir-ts)/check_XinY_mk.ts
check-tests =\
$(check-arglist) \
$(check-autotargets) \
- $(check-export-targets) \
$(check-XinY) \
$(NULL)
@@ -104,22 +102,4 @@ $(check-autotargets): $(check-autotargets-preqs)
@$(TOUCH) $@
#
-
-###########################################################################
-#
-check-export-targets-preqs=\
- $(call mkdir_deps,$(dir-ts)) \
- $(topsrcdir)/config/makefiles/makeutils.mk \
- $(topsrcdir)/config/makefiles/target_export.mk \
- $(srcdir)/check-export-targets.mk \
- checkup \
- $(NULL)
-
-# include then test
-checkup: $(eval include $(srcdir)/check-export-targets.mk)
-
-$(check-export-targets): $(check-export-targets-preqs)
- @$(TOUCH) $@
-#
-
endif #} findstring MAKECMDGOAL
diff --git a/config/makefiles/test/check-export-targets.mk b/config/makefiles/test/check-export-targets.mk
deleted file mode 100644
index c248c9b023c0..000000000000
--- a/config/makefiles/test/check-export-targets.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- makefile -*-
-#
-# 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/.
-
-ifdef VERBOSE
- $(warning loading test)
-endif
-
-MOZILLA_DIR ?= $(topsrcdir)
-checkup = \
- check-final-lib-link-list \
- $(NULL)
-
-checkup: $(checkup)
-
-
-#
-LIBRARY_NAME = foo# real_data: xptcmd
-EXPORT_LIBRARY = foo# real_data: ../..
-undefine IS_COMPONENT
-
-test-data = $(CURDIR)/check-export-targets-test-data
-FINAL_LINK_LIBS = $(test-data)
-STATIC_LIBRARY_NAME = /dev/null
-
-check-final-lib-link-list: export-gen-final-lib-link-list
- @cat $(test-data)
-#
-
-
-include $(topsrcdir)/config/makefiles/target_export.mk
diff --git a/config/makefiles/xpcshell.mk b/config/makefiles/xpcshell.mk
index 0af8caff7571..0a49e2c1c9de 100644
--- a/config/makefiles/xpcshell.mk
+++ b/config/makefiles/xpcshell.mk
@@ -29,9 +29,7 @@ libs:: libs-xpcshell-tests
libs-xpcshell-tests:
$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
ifndef NO_XPCSHELL_MANIFEST_CHECK #{
- $(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \
- $(topsrcdir) \
- $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS))
+ $(call py_action,xpccheck,$(topsrcdir) $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS)))
endif #} NO_XPCSHELL_MANIFEST_CHECK
###########################################################################
diff --git a/configure.in b/configure.in
index 1a49d1df99d4..a0575dcf086c 100644
--- a/configure.in
+++ b/configure.in
@@ -1341,6 +1341,15 @@ if test "$GNU_CC"; then
AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)
+
+ AC_MSG_CHECKING([for -z text option to ld])
+ _SAVE_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-z,text"
+ AC_TRY_LINK(,,AC_MSG_RESULT([yes])
+ [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,text"],
+ AC_MSG_RESULT([no])
+ LDFLAGS=$_SAVE_LDFLAGS)
+
AC_MSG_CHECKING([for --build-id option to ld])
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--build-id"
@@ -2174,7 +2183,6 @@ ia64*-hpux*)
AC_DEFINE(XP_WIN32)
AC_DEFINE(HW_THREADS)
AC_DEFINE(STDC_HEADERS)
- AC_DEFINE(NEW_H, )
AC_DEFINE(WIN32_LEAN_AND_MEAN)
TARGET_MD_ARCH=win32
_PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
@@ -3060,14 +3068,6 @@ if test "$ac_cv_sockaddr_sa_len" = true ; then
AC_DEFINE(HAVE_SA_LEN)
fi
-dnl Check whether the compiler supports the new-style C++ standard
-dnl library headers (i.e. ) or needs the old "new.h"
-AC_LANG_CPLUSPLUS
-NEW_H=new.h
-MOZ_CHECK_HEADER(new, [NEW_H=new])
-AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
-AC_LANG_C
-
AC_ARG_ENABLE(dtrace,
[ --enable-dtrace build with dtrace support if available (default=no)],
[enable_dtrace="yes"],)
@@ -6012,6 +6012,10 @@ if test -n "$MOZ_WEBGL_DISABLED"; then
MOZ_ANGLE_RENDERER=
fi
+if test -n "$MOZ_WEBGL_CONFORMANT"; then
+ AC_DEFINE(MOZ_WEBGL_CONFORMANT)
+fi
+
# Locate a DirectX SDK here so we can use it for both ANGLE and
# Joystick support.
if test "$OS_TARGET" = "WINNT" -a -z "$CROSS_COMPILE"; then
@@ -7553,13 +7557,16 @@ dnl ========================================================
USE_ELF_HACK=1
MOZ_ARG_DISABLE_BOOL(elf-hack,
[ --disable-elf-hack Disable elf hacks],
- USE_ELF_HACK=,
- USE_ELF_HACK=1)
+ [USE_ELF_HACK=],
+ [USE_ELF_HACK=F # Force enable elf-hack])
# Disable elf hack for profiling because the built in profiler
# doesn't read the segments properly with elf hack. This is
# temporary and should be fixed soon in the profiler.
if test "$MOZ_PROFILING" = 1; then
+ if test "$USE_ELF_HACK" = F; then
+ AC_ERROR([--enable-elf-hack is not compatible with --enable-profiling])
+ fi
USE_ELF_HACK=
fi
@@ -7582,7 +7589,7 @@ if test "$USE_ELF_HACK" = 1; then
esac
fi
-if test "$USE_ELF_HACK" = 1; then
+if test -n "$USE_ELF_HACK"; then
dnl PT_GNU_RELRO segment makes the dynamic linker set a read-only flag on
dnl memory addresses it maps to. The result is that by the time elfhack
dnl kicks in, it is not possible to apply relocations because of that,
@@ -7590,7 +7597,8 @@ if test "$USE_ELF_HACK" = 1; then
dnl segment. It makes elfhack mostly useless, so considering the problems
dnl we have we PT_GNU_RELRO (e.g. bug 664366), and until elfhack can deal
dnl with PT_GNU_RELRO segments, it's just simpler to disable elfhack when
- dnl the linker creates PT_GNU_RELRO segments.
+ dnl the linker creates PT_GNU_RELRO segments. However, when we do want
+ dnl elfhack enabled, disable PT_GNU_RELRO instead.
AC_CACHE_CHECK([whether linker creates PT_GNU_RELRO segments],
LINK_WITH_PT_GNU_RELRO,
[echo "int main() {return 0;}" > conftest.${ac_ext}
@@ -7607,8 +7615,18 @@ if test "$USE_ELF_HACK" = 1; then
fi
rm -rf conftest*])
if test "$LINK_WITH_PT_GNU_RELRO" = yes; then
- AC_MSG_WARN([Disabling elfhack])
- USE_ELF_HACK=
+ if test "$USE_ELF_HACK" = F; then
+ AC_MSG_CHECKING([for -z norelro option to ld])
+ _SAVE_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-z,norelro"
+ AC_TRY_LINK(,,AC_MSG_RESULT([yes])
+ [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,norelro"],
+ AC_ERROR([--enable-elf-hack is not compatible with a linker creating a PT_GNU_RELRO segment and that doesn't support the "-z norelro" option.]))
+ USE_ELF_HACK=1
+ else
+ AC_MSG_WARN([Disabling elfhack])
+ USE_ELF_HACK=
+ fi
fi
fi
@@ -9104,7 +9122,6 @@ HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
HAVE_CPP_PARTIAL_SPECIALIZATION
HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
NEED_CPP_UNUSED_IMPLEMENTATIONS
-NEW_H
HAVE_GETPAGESIZE
HAVE_ICONV
HAVE_ICONV_WITH_CONST_INPUT
diff --git a/content/base/public/nsIContent.h b/content/base/public/nsIContent.h
index 63f192f8af5d..3171afd30a1e 100644
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -33,8 +33,8 @@ enum nsLinkState {
// IID for the nsIContent interface
#define NS_ICONTENT_IID \
-{ 0x8a8b4b1d, 0x72d8, 0x428e, \
- { 0x95, 0x75, 0xf9, 0x18, 0xba, 0xf6, 0x9e, 0xa1 } }
+{ 0Xf22c131c, 0Xc554, 0X4d06, \
+ { 0X81, 0Xac, 0X86, 0X64, 0X2f, 0X05, 0Xcc, 0X81 } }
/**
* A node of content in a document's content model. This interface
@@ -305,6 +305,12 @@ class nsIContent : public nsINode {
return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
}
+ inline bool IsActiveChildrenElement() const
+ {
+ return mNodeInfo->Equals(nsGkAtoms::children, kNameSpaceID_XBL) &&
+ GetBindingParent();
+ }
+
/**
* Returns an atom holding the name of the attribute of type ID on
* this content node (if applicable). Returns null for non-element
diff --git a/content/base/src/Attr.h b/content/base/src/Attr.h
index 0b9d4a5b53c2..043aa0beb8e7 100644
--- a/content/base/src/Attr.h
+++ b/content/base/src/Attr.h
@@ -26,8 +26,8 @@ namespace dom {
// Attribute helper class used to wrap up an attribute with a dom
// object that implements nsIDOMAttr and nsIDOMNode
-class Attr : public nsIAttribute,
- public nsIDOMAttr
+class Attr MOZ_FINAL : public nsIAttribute,
+ public nsIDOMAttr
{
public:
Attr(nsDOMAttributeMap* aAttrMap,
diff --git a/content/base/src/ChildIterator.cpp b/content/base/src/ChildIterator.cpp
index f3f43e517e37..fa83d891c571 100644
--- a/content/base/src/ChildIterator.cpp
+++ b/content/base/src/ChildIterator.cpp
@@ -16,7 +16,7 @@ ExplicitChildIterator::GetNextChild()
// If we're already in the inserted-children array, look there first
if (mIndexInInserted) {
MOZ_ASSERT(mChild);
- MOZ_ASSERT(mChild->NodeInfo()->Equals(nsGkAtoms::children, kNameSpaceID_XBL));
+ MOZ_ASSERT(mChild->IsActiveChildrenElement());
MOZ_ASSERT(!mDefaultChild);
XBLChildrenElement* point = static_cast(mChild);
@@ -28,7 +28,7 @@ ExplicitChildIterator::GetNextChild()
} else if (mDefaultChild) {
// If we're already in default content, check if there are more nodes there
MOZ_ASSERT(mChild);
- MOZ_ASSERT(mChild->NodeInfo()->Equals(nsGkAtoms::children, kNameSpaceID_XBL));
+ MOZ_ASSERT(mChild->IsActiveChildrenElement());
mDefaultChild = mDefaultChild->GetNextSibling();
if (mDefaultChild) {
@@ -44,8 +44,7 @@ ExplicitChildIterator::GetNextChild()
}
// Iterate until we find a non-, or a with content.
- while (mChild &&
- mChild->NodeInfo()->Equals(nsGkAtoms::children, kNameSpaceID_XBL)) {
+ while (mChild && mChild->IsActiveChildrenElement()) {
XBLChildrenElement* point = static_cast(mChild);
if (!point->mInsertedChildren.IsEmpty()) {
mIndexInInserted = 1;
@@ -85,6 +84,7 @@ FlattenedChildIterator::FlattenedChildIterator(nsIContent* aParent)
child;
child = child->GetNextSibling()) {
if (child->NodeInfo()->Equals(nsGkAtoms::children, kNameSpaceID_XBL)) {
+ MOZ_ASSERT(child->GetBindingParent());
mXBLInvolved = true;
break;
}
@@ -131,8 +131,7 @@ nsIContent* FlattenedChildIterator::GetPreviousChild()
}
// Iterate until we find a non-, or a with content.
- while (mChild &&
- mChild->NodeInfo()->Equals(nsGkAtoms::children, kNameSpaceID_XBL)) {
+ while (mChild && mChild->IsActiveChildrenElement()) {
XBLChildrenElement* point = static_cast(mChild);
if (!point->mInsertedChildren.IsEmpty()) {
mIndexInInserted = point->InsertedChildrenLength();
diff --git a/content/base/src/Comment.h b/content/base/src/Comment.h
index 375d3d081dbf..530f2ab89c05 100644
--- a/content/base/src/Comment.h
+++ b/content/base/src/Comment.h
@@ -13,8 +13,8 @@
namespace mozilla {
namespace dom {
-class Comment : public nsGenericDOMDataNode,
- public nsIDOMComment
+class Comment MOZ_FINAL : public nsGenericDOMDataNode,
+ public nsIDOMComment
{
private:
void Init()
diff --git a/content/base/src/DocumentFragment.h b/content/base/src/DocumentFragment.h
index 47cce72d8181..884779f54fbc 100644
--- a/content/base/src/DocumentFragment.h
+++ b/content/base/src/DocumentFragment.h
@@ -23,8 +23,8 @@ namespace dom {
class Element;
class HTMLTemplateElement;
-class DocumentFragment : public FragmentOrElement,
- public nsIDOMDocumentFragment
+class DocumentFragment MOZ_FINAL : public FragmentOrElement,
+ public nsIDOMDocumentFragment
{
private:
void Init()
diff --git a/content/base/src/DocumentType.h b/content/base/src/DocumentType.h
index edc4176af4ef..507a6dd7cf97 100644
--- a/content/base/src/DocumentType.h
+++ b/content/base/src/DocumentType.h
@@ -38,7 +38,7 @@ class DocumentTypeForward : public nsGenericDOMDataNode,
NS_FORWARD_NSIDOMNODE_TO_NSINODE
};
-class DocumentType : public DocumentTypeForward
+class DocumentType MOZ_FINAL : public DocumentTypeForward
{
public:
DocumentType(already_AddRefed aNodeInfo,
diff --git a/content/base/src/Makefile.in b/content/base/src/Makefile.in
index e91a27665878..81d519ff4632 100644
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -22,10 +22,6 @@ endif
GQI_SRCS = contentbase.gqi
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
EXTRA_COMPONENTS = \
contentSecurityPolicy.manifest \
contentAreaDropListener.js \
diff --git a/content/base/src/nsGenConImageContent.cpp b/content/base/src/nsGenConImageContent.cpp
index 14750c530c0a..11939443804d 100644
--- a/content/base/src/nsGenConImageContent.cpp
+++ b/content/base/src/nsGenConImageContent.cpp
@@ -17,8 +17,8 @@
#include "nsEventStates.h"
#include "nsEventDispatcher.h"
-class nsGenConImageContent : public nsXMLElement,
- public nsImageLoadingContent
+class nsGenConImageContent MOZ_FINAL : public nsXMLElement,
+ public nsImageLoadingContent
{
public:
nsGenConImageContent(already_AddRefed aNodeInfo)
diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp
index 6c9fbf941ea2..b4e1ebc259a2 100644
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -3216,7 +3216,7 @@ nsObjectLoadingContent::SetupProtoChain(JSContext* aCx,
return;
}
- if (pi_proto && js::GetObjectClass(pi_proto) != &js::ObjectClass) {
+ if (pi_proto && js::GetObjectClass(pi_proto) != js::ObjectClassPtr) {
// The plugin wrapper has a proto that's not Object.prototype, set
// 'pi.__proto__.__proto__' to the original 'this.__proto__'
if (pi_proto != my_proto && !::JS_SetPrototype(aCx, pi_proto, my_proto)) {
diff --git a/content/base/src/nsRange.cpp b/content/base/src/nsRange.cpp
index 1d78cb45aacf..c8f0c25fc921 100644
--- a/content/base/src/nsRange.cpp
+++ b/content/base/src/nsRange.cpp
@@ -13,9 +13,7 @@
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsIDOMNode.h"
-#include "nsIDOMDocument.h"
#include "nsIDOMDocumentFragment.h"
-#include "nsIDOMDocumentType.h"
#include "nsIContent.h"
#include "nsIDocument.h"
#include "nsIDOMText.h"
@@ -30,16 +28,18 @@
#include "nsTextFrame.h"
#include "nsFontFaceList.h"
#include "mozilla/dom/DocumentFragment.h"
+#include "mozilla/dom/DocumentType.h"
#include "mozilla/dom/RangeBinding.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Likely.h"
using namespace mozilla;
+using namespace mozilla::dom;
JSObject*
nsRange::WrapObject(JSContext* aCx, JS::Handle aScope)
{
- return dom::RangeBinding::Wrap(aCx, aScope, this);
+ return RangeBinding::Wrap(aCx, aScope, this);
}
/******************************************************
@@ -209,7 +209,7 @@ nsRange::~nsRange()
// we want the side effects (releases and list removals)
DoSetRange(nullptr, 0, nullptr, 0, nullptr);
-}
+}
/* static */
nsresult
@@ -529,13 +529,13 @@ nsRange::CharacterDataChanged(nsIDocument* aDocument,
// point before the first child is never affected by normalize().)
nsINode* parentNode = aContent->GetParentNode();
if (parentNode == mStartParent && mStartOffset > 0 &&
- mStartOffset < parentNode->GetChildCount() &&
+ uint32_t(mStartOffset) < parentNode->GetChildCount() &&
removed == parentNode->GetChildAt(mStartOffset)) {
newStartNode = aContent;
newStartOffset = aInfo->mChangeStart;
}
if (parentNode == mEndParent && mEndOffset > 0 &&
- mEndOffset < parentNode->GetChildCount() &&
+ uint32_t(mEndOffset) < parentNode->GetChildCount() &&
removed == parentNode->GetChildAt(mEndOffset)) {
newEndNode = aContent;
newEndOffset = aInfo->mChangeEnd;
@@ -921,18 +921,6 @@ IndexOf(nsINode* aChild)
return parent ? parent->IndexOf(aChild) : -1;
}
-static int32_t
-IndexOf(nsIDOMNode* aChildNode)
-{
- // convert node to nsIContent, so that we can find the child index
-
- nsCOMPtr child = do_QueryInterface(aChildNode);
- if (!child) {
- return -1;
- }
- return IndexOf(child);
-}
-
nsINode*
nsRange::GetCommonAncestor() const
{
@@ -1165,7 +1153,7 @@ nsRange::SetStart(nsINode* aParent, int32_t aOffset)
}
DoSetRange(aParent, aOffset, mEndParent, mEndOffset, mRoot);
-
+
return NS_OK;
}
@@ -1423,8 +1411,8 @@ class MOZ_STACK_CLASS RangeSubtreeIterator
nsCOMPtr mIter;
RangeSubtreeIterState mIterState;
- nsCOMPtr mStart;
- nsCOMPtr mEnd;
+ nsCOMPtr mStart;
+ nsCOMPtr mEnd;
public:
@@ -1436,8 +1424,8 @@ class MOZ_STACK_CLASS RangeSubtreeIterator
{
}
- nsresult Init(nsIDOMRange *aRange);
- already_AddRefed GetCurrentNode();
+ nsresult Init(nsRange *aRange);
+ already_AddRefed GetCurrentNode();
void First();
void Last();
void Next();
@@ -1450,54 +1438,37 @@ class MOZ_STACK_CLASS RangeSubtreeIterator
};
nsresult
-RangeSubtreeIterator::Init(nsIDOMRange *aRange)
+RangeSubtreeIterator::Init(nsRange *aRange)
{
mIterState = eDone;
- bool collapsed;
- aRange->GetCollapsed(&collapsed);
- if (collapsed) {
+ if (aRange->Collapsed()) {
return NS_OK;
}
- nsCOMPtr node;
-
// Grab the start point of the range and QI it to
// a CharacterData pointer. If it is CharacterData store
// a pointer to the node.
- nsresult res = aRange->GetStartContainer(getter_AddRefs(node));
+ ErrorResult rv;
+ nsCOMPtr node = aRange->GetStartContainer(rv);
if (!node) return NS_ERROR_FAILURE;
nsCOMPtr startData = do_QueryInterface(node);
- if (startData) {
+ if (startData || (node->IsElement() &&
+ node->AsElement()->GetChildCount() == aRange->GetStartOffset(rv))) {
mStart = node;
- } else {
- int32_t startIndex;
- aRange->GetStartOffset(&startIndex);
- nsCOMPtr iNode = do_QueryInterface(node);
- if (iNode->IsElement() &&
- int32_t(iNode->AsElement()->GetChildCount()) == startIndex) {
- mStart = node;
- }
}
// Grab the end point of the range and QI it to
// a CharacterData pointer. If it is CharacterData store
// a pointer to the node.
- res = aRange->GetEndContainer(getter_AddRefs(node));
+ node = aRange->GetEndContainer(rv);
if (!node) return NS_ERROR_FAILURE;
nsCOMPtr endData = do_QueryInterface(node);
- if (endData) {
+ if (endData || (node->IsElement() && aRange->GetEndOffset(rv) == 0)) {
mEnd = node;
- } else {
- int32_t endIndex;
- aRange->GetEndOffset(&endIndex);
- nsCOMPtr iNode = do_QueryInterface(node);
- if (iNode->IsElement() && endIndex == 0) {
- mEnd = node;
- }
}
if (mStart && mStart == mEnd)
@@ -1515,7 +1486,7 @@ RangeSubtreeIterator::Init(nsIDOMRange *aRange)
mIter = NS_NewContentSubtreeIterator();
- res = mIter->Init(aRange);
+ nsresult res = mIter->Init(aRange);
if (NS_FAILED(res)) return res;
if (mIter->IsDone())
@@ -1536,17 +1507,17 @@ RangeSubtreeIterator::Init(nsIDOMRange *aRange)
return NS_OK;
}
-already_AddRefed
+already_AddRefed
RangeSubtreeIterator::GetCurrentNode()
{
- nsCOMPtr node;
+ nsCOMPtr node;
if (mIterState == eUseStart && mStart) {
node = mStart;
} else if (mIterState == eUseEnd && mEnd) {
node = mEnd;
} else if (mIterState == eUseIterator && mIter) {
- node = do_QueryInterface(mIter->GetCurrentNode());
+ node = mIter->GetCurrentNode();
}
return node.forget();
@@ -1662,17 +1633,12 @@ RangeSubtreeIterator::Prev()
// no content between the 2 end points.
static nsresult
-CollapseRangeAfterDelete(nsIDOMRange *aRange)
+CollapseRangeAfterDelete(nsRange* aRange)
{
NS_ENSURE_ARG_POINTER(aRange);
// Check if range gravity took care of collapsing the range for us!
-
- bool isCollapsed = false;
- nsresult res = aRange->GetCollapsed(&isCollapsed);
- if (NS_FAILED(res)) return res;
-
- if (isCollapsed)
+ if (aRange->Collapsed())
{
// aRange is collapsed so there's nothing for us to do.
//
@@ -1692,17 +1658,14 @@ CollapseRangeAfterDelete(nsIDOMRange *aRange)
// aRange isn't collapsed so figure out the appropriate place to collapse!
// First get both end points and their common ancestor.
- nsCOMPtr commonAncestor;
- res = aRange->GetCommonAncestorContainer(getter_AddRefs(commonAncestor));
- if(NS_FAILED(res)) return res;
-
- nsCOMPtr startContainer, endContainer;
-
- res = aRange->GetStartContainer(getter_AddRefs(startContainer));
- if (NS_FAILED(res)) return res;
+ ErrorResult rv;
+ nsCOMPtr commonAncestor = aRange->GetCommonAncestorContainer(rv);
+ if (rv.Failed()) return rv.ErrorCode();
- res = aRange->GetEndContainer(getter_AddRefs(endContainer));
- if (NS_FAILED(res)) return res;
+ nsCOMPtr startContainer = aRange->GetStartContainer(rv);
+ if (rv.Failed()) return rv.ErrorCode();
+ nsCOMPtr endContainer = aRange->GetEndContainer(rv);
+ if (rv.Failed()) return rv.ErrorCode();
// Collapse to one of the end points if they are already in the
// commonAncestor. This should work ok since this method is called
@@ -1718,13 +1681,11 @@ CollapseRangeAfterDelete(nsIDOMRange *aRange)
// point that is between the 2 subtrees that contain each point,
// under the common ancestor.
- nsCOMPtr nodeToSelect(startContainer), parent;
+ nsCOMPtr nodeToSelect(startContainer);
while (nodeToSelect)
{
- nsresult res = nodeToSelect->GetParentNode(getter_AddRefs(parent));
- if (NS_FAILED(res)) return res;
-
+ nsCOMPtr parent = nodeToSelect->GetParentNode();
if (parent == commonAncestor)
break; // We found the nodeToSelect!
@@ -1734,8 +1695,8 @@ CollapseRangeAfterDelete(nsIDOMRange *aRange)
if (!nodeToSelect)
return NS_ERROR_FAILURE; // This should never happen!
- res = aRange->SelectNode(nodeToSelect);
- if (NS_FAILED(res)) return res;
+ aRange->SelectNode(*nodeToSelect, rv);
+ if (rv.Failed()) return rv.ErrorCode();
return aRange->Collapse(false);
}
@@ -1767,11 +1728,12 @@ static nsresult SplitDataNode(nsIDOMCharacterData* aStartNode,
}
NS_IMETHODIMP
-PrependChild(nsIDOMNode* aParent, nsIDOMNode* aChild)
+PrependChild(nsINode* aParent, nsINode* aChild)
{
- nsCOMPtr first, tmpNode;
- aParent->GetFirstChild(getter_AddRefs(first));
- return aParent->InsertBefore(aChild, first, getter_AddRefs(tmpNode));
+ nsCOMPtr first = aParent->GetFirstChild();
+ ErrorResult rv;
+ aParent->InsertBefore(*aChild, first, rv);
+ return rv.ErrorCode();
}
// Helper function for CutContents, making sure that the current node wasn't
@@ -1780,14 +1742,12 @@ static bool
ValidateCurrentNode(nsRange* aRange, RangeSubtreeIterator& aIter)
{
bool before, after;
- nsCOMPtr domNode = aIter.GetCurrentNode();
- if (!domNode) {
+ nsCOMPtr node = aIter.GetCurrentNode();
+ if (!node) {
// We don't have to worry that the node was removed if it doesn't exist,
// e.g., the iterator is done.
return true;
}
- nsCOMPtr node = do_QueryInterface(domNode);
- MOZ_ASSERT(node);
nsresult res = nsRange::CompareNodeToRange(node, aRange, &before, &after);
@@ -1795,24 +1755,24 @@ ValidateCurrentNode(nsRange* aRange, RangeSubtreeIterator& aIter)
}
nsresult
-nsRange::CutContents(dom::DocumentFragment** aFragment)
-{
+nsRange::CutContents(DocumentFragment** aFragment)
+{
if (aFragment) {
*aFragment = nullptr;
}
nsCOMPtr doc = mStartParent->OwnerDoc();
- nsCOMPtr commonAncestor;
- nsresult rv = GetCommonAncestorContainer(getter_AddRefs(commonAncestor));
- NS_ENSURE_SUCCESS(rv, rv);
+ ErrorResult res;
+ nsCOMPtr commonAncestor = GetCommonAncestorContainer(res);
+ NS_ENSURE_SUCCESS(res.ErrorCode(), res.ErrorCode());
// If aFragment isn't null, create a temporary fragment to hold our return.
- nsRefPtr retval;
+ nsRefPtr retval;
if (aFragment) {
- retval = new dom::DocumentFragment(doc->NodeInfoManager());
+ retval = new DocumentFragment(doc->NodeInfoManager());
}
- nsCOMPtr commonCloneAncestor = retval.get();
+ nsCOMPtr commonCloneAncestor = retval.get();
// Batch possible DOMSubtreeModified events.
mozAutoSubtreeModified subtree(mRoot ? mRoot->OwnerDoc(): nullptr, nullptr);
@@ -1820,25 +1780,23 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
// Save the range end points locally to avoid interference
// of Range gravity during our edits!
- nsCOMPtr startContainer = do_QueryInterface(mStartParent);
+ nsCOMPtr startContainer = mStartParent;
int32_t startOffset = mStartOffset;
- nsCOMPtr endContainer = do_QueryInterface(mEndParent);
+ nsCOMPtr endContainer = mEndParent;
int32_t endOffset = mEndOffset;
if (retval) {
// For extractContents(), abort early if there's a doctype (bug 719533).
// This can happen only if the common ancestor is a document, in which case
// we just need to find its doctype child and check if that's in the range.
- nsCOMPtr commonAncestorDocument(do_QueryInterface(commonAncestor));
+ nsCOMPtr commonAncestorDocument = do_QueryInterface(commonAncestor);
if (commonAncestorDocument) {
- nsCOMPtr doctype;
- rv = commonAncestorDocument->GetDoctype(getter_AddRefs(doctype));
- NS_ENSURE_SUCCESS(rv, rv);
+ nsRefPtr doctype = commonAncestorDocument->GetDoctype();
if (doctype &&
nsContentUtils::ComparePoints(startContainer, startOffset,
- doctype.get(), 0) < 0 &&
- nsContentUtils::ComparePoints(doctype.get(), 0,
+ doctype, 0) < 0 &&
+ nsContentUtils::ComparePoints(doctype, 0,
endContainer, endOffset) < 0) {
return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
}
@@ -1850,7 +1808,7 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
RangeSubtreeIterator iter;
- rv = iter.Init(this);
+ nsresult rv = iter.Init(this);
if (NS_FAILED(rv)) return rv;
if (iter.IsDone())
@@ -1875,8 +1833,8 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
while (!iter.IsDone())
{
- nsCOMPtr nodeToResult;
- nsCOMPtr node(iter.GetCurrentNode());
+ nsCOMPtr nodeToResult;
+ nsCOMPtr node = iter.GetCurrentNode();
// Before we delete anything, advance the iterator to the
// next subtree.
@@ -1915,7 +1873,7 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
rv = charData->CloneNode(false, 1, getter_AddRefs(clone));
NS_ENSURE_SUCCESS(rv, rv);
clone->SetNodeValue(cutValue);
- nodeToResult = clone;
+ nodeToResult = do_QueryInterface(clone);
}
nsMutationGuard guard;
@@ -1942,7 +1900,7 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(!guard.Mutated(1) ||
ValidateCurrentNode(this, iter));
- nodeToResult = cutNode;
+ nodeToResult = do_QueryInterface(cutNode);
}
handled = true;
@@ -1964,26 +1922,24 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(!guard.Mutated(1) ||
ValidateCurrentNode(this, iter));
- nodeToResult = cutNode;
+ nodeToResult = do_QueryInterface(cutNode);
}
handled = true;
- }
+ }
}
if (!handled && (node == endContainer || node == startContainer))
{
- nsCOMPtr iNode = do_QueryInterface(node);
- if (iNode && iNode->IsElement() &&
+ if (node && node->IsElement() &&
((node == endContainer && endOffset == 0) ||
(node == startContainer &&
- int32_t(iNode->AsElement()->GetChildCount()) == startOffset)))
+ int32_t(node->AsElement()->GetChildCount()) == startOffset)))
{
if (retval) {
- nsCOMPtr clone;
- rv = node->CloneNode(false, 1, getter_AddRefs(clone));
- NS_ENSURE_SUCCESS(rv, rv);
- nodeToResult = clone;
+ ErrorResult rv;
+ nodeToResult = node->CloneNode(false, rv);
+ NS_ENSURE_SUCCESS(rv.ErrorCode(), rv.ErrorCode());
}
handled = true;
}
@@ -1997,33 +1953,30 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
}
uint32_t parentCount = 0;
- nsCOMPtr tmpNode;
// Set the result to document fragment if we have 'retval'.
if (retval) {
- nsCOMPtr oldCommonAncestor = commonAncestor;
+ nsCOMPtr oldCommonAncestor = commonAncestor;
if (!iter.IsDone()) {
// Setup the parameters for the next iteration of the loop.
- nsCOMPtr prevNode(iter.GetCurrentNode());
+ nsCOMPtr prevNode = iter.GetCurrentNode();
NS_ENSURE_STATE(prevNode);
// Get node's and prevNode's common parent. Do this before moving
// nodes from original DOM to result fragment.
- nsContentUtils::GetCommonAncestor(node, prevNode,
- getter_AddRefs(commonAncestor));
+ commonAncestor = nsContentUtils::GetCommonAncestor(node, prevNode);
NS_ENSURE_STATE(commonAncestor);
- nsCOMPtr parentCounterNode = node;
+ nsCOMPtr parentCounterNode = node;
while (parentCounterNode && parentCounterNode != commonAncestor)
{
++parentCount;
- tmpNode = parentCounterNode;
- tmpNode->GetParentNode(getter_AddRefs(parentCounterNode));
+ parentCounterNode = parentCounterNode->GetParentNode();
NS_ENSURE_STATE(parentCounterNode);
}
}
// Clone the parent hierarchy between commonAncestor and node.
- nsCOMPtr closestAncestor, farthestAncestor;
+ nsCOMPtr closestAncestor, farthestAncestor;
rv = CloneParentsBetween(oldCommonAncestor, node,
getter_AddRefs(closestAncestor),
getter_AddRefs(farthestAncestor));
@@ -2031,13 +1984,13 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
if (farthestAncestor)
{
- rv = PrependChild(commonCloneAncestor, farthestAncestor);
+ nsCOMPtr n = do_QueryInterface(commonCloneAncestor);
+ rv = PrependChild(n, farthestAncestor);
NS_ENSURE_SUCCESS(rv, rv);
}
nsMutationGuard guard;
- nsCOMPtr parent;
- nodeToResult->GetParentNode(getter_AddRefs(parent));
+ nsCOMPtr parent = nodeToResult->GetParentNode();
rv = closestAncestor ? PrependChild(closestAncestor, nodeToResult)
: PrependChild(commonCloneAncestor, nodeToResult);
NS_ENSURE_SUCCESS(rv, rv);
@@ -2045,7 +1998,7 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
ValidateCurrentNode(this, iter));
} else if (nodeToResult) {
nsMutationGuard guard;
- nsCOMPtr node = do_QueryInterface(nodeToResult);
+ nsCOMPtr node = nodeToResult;
nsINode* parent = node->GetParentNode();
if (parent) {
mozilla::ErrorResult error;
@@ -2058,11 +2011,10 @@ nsRange::CutContents(dom::DocumentFragment** aFragment)
if (!iter.IsDone() && retval) {
// Find the equivalent of commonAncestor in the cloned tree.
- nsCOMPtr newCloneAncestor = nodeToResult;
+ nsCOMPtr newCloneAncestor = nodeToResult;
for (uint32_t i = parentCount; i; --i)
{
- tmpNode = newCloneAncestor;
- tmpNode->GetParentNode(getter_AddRefs(newCloneAncestor));
+ newCloneAncestor = newCloneAncestor->GetParentNode();
NS_ENSURE_STATE(newCloneAncestor);
}
commonCloneAncestor = newCloneAncestor;
@@ -2092,16 +2044,16 @@ NS_IMETHODIMP
nsRange::ExtractContents(nsIDOMDocumentFragment** aReturn)
{
NS_ENSURE_ARG_POINTER(aReturn);
- nsRefPtr fragment;
+ nsRefPtr fragment;
nsresult rv = CutContents(getter_AddRefs(fragment));
fragment.forget(aReturn);
return rv;
}
-already_AddRefed
+already_AddRefed
nsRange::ExtractContents(ErrorResult& rv)
{
- nsRefPtr fragment;
+ nsRefPtr fragment;
rv = CutContents(getter_AddRefs(fragment));
return fragment.forget();
}
@@ -2171,10 +2123,10 @@ nsRange::CompareBoundaryPoints(uint16_t aHow, nsRange& aOtherRange,
}
/* static */ nsresult
-nsRange::CloneParentsBetween(nsIDOMNode *aAncestor,
- nsIDOMNode *aNode,
- nsIDOMNode **aClosestAncestor,
- nsIDOMNode **aFarthestAncestor)
+nsRange::CloneParentsBetween(nsINode *aAncestor,
+ nsINode *aNode,
+ nsINode **aClosestAncestor,
+ nsINode **aFarthestAncestor)
{
NS_ENSURE_ARG_POINTER((aAncestor && aNode && aClosestAncestor && aFarthestAncestor));
@@ -2184,32 +2136,31 @@ nsRange::CloneParentsBetween(nsIDOMNode *aAncestor,
if (aAncestor == aNode)
return NS_OK;
- nsCOMPtr parent, firstParent, lastParent;
-
- nsresult res = aNode->GetParentNode(getter_AddRefs(parent));
+ nsCOMPtr firstParent, lastParent;
+ nsCOMPtr parent = aNode->GetParentNode();
while(parent && parent != aAncestor)
{
- nsCOMPtr clone, tmpNode;
+ ErrorResult rv;
+ nsCOMPtr clone = parent->CloneNode(false, rv);
- res = parent->CloneNode(false, 1, getter_AddRefs(clone));
-
- if (NS_FAILED(res)) return res;
- if (!clone) return NS_ERROR_FAILURE;
+ if (rv.Failed()) {
+ return rv.ErrorCode();
+ }
+ if (!clone) {
+ return NS_ERROR_FAILURE;
+ }
- if (! firstParent)
+ if (! firstParent) {
firstParent = lastParent = clone;
- else
- {
- res = clone->AppendChild(lastParent, getter_AddRefs(tmpNode));
-
- if (NS_FAILED(res)) return res;
+ } else {
+ clone->AppendChild(*lastParent, rv);
+ if (rv.Failed()) return rv.ErrorCode();
lastParent = clone;
}
- tmpNode = parent;
- res = tmpNode->GetParentNode(getter_AddRefs(parent));
+ parent = parent->GetParentNode();
}
*aClosestAncestor = firstParent;
@@ -2229,17 +2180,15 @@ nsRange::CloneContents(nsIDOMDocumentFragment** aReturn)
return rv.ErrorCode();
}
-already_AddRefed
+already_AddRefed
nsRange::CloneContents(ErrorResult& aRv)
{
- nsCOMPtr commonAncestor;
- aRv = GetCommonAncestorContainer(getter_AddRefs(commonAncestor));
+ nsCOMPtr commonAncestor = GetCommonAncestorContainer(aRv);
MOZ_ASSERT(!aRv.Failed(), "GetCommonAncestorContainer() shouldn't fail!");
- nsCOMPtr document =
- do_QueryInterface(mStartParent->OwnerDoc());
- NS_ASSERTION(document, "CloneContents needs a document to continue.");
- if (!document) {
+ nsCOMPtr doc = mStartParent->OwnerDoc();
+ NS_ASSERTION(doc, "CloneContents needs a document to continue.");
+ if (!doc) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
@@ -2248,16 +2197,10 @@ nsRange::CloneContents(ErrorResult& aRv)
// which might be null
- nsCOMPtr doc(do_QueryInterface(document));
+ nsRefPtr clonedFrag =
+ new DocumentFragment(doc->NodeInfoManager());
- nsRefPtr clonedFrag =
- new dom::DocumentFragment(doc->NodeInfoManager());
-
- nsCOMPtr commonCloneAncestor = clonedFrag.get();
- if (!commonCloneAncestor) {
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
+ nsCOMPtr commonCloneAncestor = clonedFrag.get();
// Create and initialize a subtree iterator that will give
// us all the subtrees within the range.
@@ -2289,18 +2232,16 @@ nsRange::CloneContents(ErrorResult& aRv)
while (!iter.IsDone())
{
- nsCOMPtr node(iter.GetCurrentNode());
- nsCOMPtr iNode = do_QueryInterface(node);
- bool deepClone = !iNode->IsElement() ||
- (!(iNode == mEndParent && mEndOffset == 0) &&
- !(iNode == mStartParent &&
+ nsCOMPtr node = iter.GetCurrentNode();
+ bool deepClone = !node->IsElement() ||
+ (!(node == mEndParent && mEndOffset == 0) &&
+ !(node == mStartParent &&
mStartOffset ==
- int32_t(iNode->AsElement()->GetChildCount())));
+ int32_t(node->AsElement()->GetChildCount())));
// Clone the current subtree!
- nsCOMPtr clone;
- aRv = node->CloneNode(deepClone, 1, getter_AddRefs(clone));
+ nsCOMPtr clone = node->CloneNode(deepClone, aRv);
if (aRv.Failed()) {
return nullptr;
}
@@ -2315,7 +2256,7 @@ nsRange::CloneContents(ErrorResult& aRv)
if (charData)
{
- if (iNode == mEndParent)
+ if (node == mEndParent)
{
// We only need the data before mEndOffset, so get rid of any
// data after it.
@@ -2333,9 +2274,9 @@ nsRange::CloneContents(ErrorResult& aRv)
return nullptr;
}
}
- }
+ }
- if (iNode == mStartParent)
+ if (node == mStartParent)
{
// We don't need any data before mStartOffset, so just
// delete it!
@@ -2352,7 +2293,7 @@ nsRange::CloneContents(ErrorResult& aRv)
// Clone the parent hierarchy between commonAncestor and node.
- nsCOMPtr closestAncestor, farthestAncestor;
+ nsCOMPtr closestAncestor, farthestAncestor;
aRv = CloneParentsBetween(commonAncestor, node,
getter_AddRefs(closestAncestor),
@@ -2364,12 +2305,9 @@ nsRange::CloneContents(ErrorResult& aRv)
// Hook the parent hierarchy/context of the subtree into the clone tree.
- nsCOMPtr tmpNode;
-
if (farthestAncestor)
{
- aRv = commonCloneAncestor->AppendChild(farthestAncestor,
- getter_AddRefs(tmpNode));
+ commonCloneAncestor->AppendChild(*farthestAncestor, aRv);
if (aRv.Failed()) {
return nullptr;
@@ -2378,19 +2316,20 @@ nsRange::CloneContents(ErrorResult& aRv)
// Place the cloned subtree into the cloned doc frag tree!
+ nsCOMPtr cloneNode = do_QueryInterface(clone);
if (closestAncestor)
{
// Append the subtree under closestAncestor since it is the
// immediate parent of the subtree.
- aRv = closestAncestor->AppendChild(clone, getter_AddRefs(tmpNode));
+ closestAncestor->AppendChild(*cloneNode, aRv);
}
else
{
- // If we get here, there is no missing parent hierarchy between
+ // If we get here, there is no missing parent hierarchy between
// commonAncestor and node, so just append clone to commonCloneAncestor.
- aRv = commonCloneAncestor->AppendChild(clone, getter_AddRefs(tmpNode));
+ commonCloneAncestor->AppendChild(*cloneNode, aRv);
}
if (aRv.Failed()) {
return nullptr;
@@ -2404,14 +2343,14 @@ nsRange::CloneContents(ErrorResult& aRv)
if (iter.IsDone())
break; // We must be done!
- nsCOMPtr nextNode(iter.GetCurrentNode());
+ nsCOMPtr nextNode = iter.GetCurrentNode();
if (!nextNode) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
// Get node and nextNode's common parent.
- nsContentUtils::GetCommonAncestor(node, nextNode, getter_AddRefs(commonAncestor));
+ commonAncestor = nsContentUtils::GetCommonAncestor(node, nextNode);
if (!commonAncestor) {
aRv.Throw(NS_ERROR_FAILURE);
@@ -2422,8 +2361,7 @@ nsRange::CloneContents(ErrorResult& aRv)
while (node && node != commonAncestor)
{
- tmpNode = node;
- aRv = tmpNode->GetParentNode(getter_AddRefs(node));
+ node = node->GetParentNode();
if (aRv.Failed()) {
return nullptr;
}
@@ -2433,19 +2371,14 @@ nsRange::CloneContents(ErrorResult& aRv)
return nullptr;
}
- tmpNode = clone;
- aRv = tmpNode->GetParentNode(getter_AddRefs(clone));
- if (aRv.Failed()) {
- return nullptr;
- }
-
- if (!clone) {
+ cloneNode = cloneNode->GetParentNode();
+ if (!cloneNode) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
}
- commonCloneAncestor = clone;
+ commonCloneAncestor = cloneNode;
}
return clonedFrag.forget();
@@ -2493,24 +2426,19 @@ nsRange::InsertNode(nsINode& aNode, ErrorResult& aRv)
int32_t tStartOffset = StartOffset();
- nsCOMPtr tStartContainer;
- aRv = this->GetStartContainer(getter_AddRefs(tStartContainer));
+ nsCOMPtr tStartContainer = GetStartContainer(aRv);
if (aRv.Failed()) {
return;
}
// This is the node we'll be inserting before, and its parent
- nsCOMPtr referenceNode;
- nsCOMPtr referenceParentNode = tStartContainer;
+ nsCOMPtr referenceNode;
+ nsCOMPtr referenceParentNode = tStartContainer;
nsCOMPtr startTextNode(do_QueryInterface(tStartContainer));
nsCOMPtr tChildList;
if (startTextNode) {
- aRv = tStartContainer->GetParentNode(getter_AddRefs(referenceParentNode));
- if (aRv.Failed()) {
- return;
- }
-
+ referenceParentNode = tStartContainer->GetParentNode();
if (!referenceParentNode) {
aRv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
return;
@@ -2522,15 +2450,17 @@ nsRange::InsertNode(nsINode& aNode, ErrorResult& aRv)
return;
}
- referenceNode = secondPart;
+ referenceNode = do_QueryInterface(secondPart);
} else {
- aRv = tStartContainer->GetChildNodes(getter_AddRefs(tChildList));
+ aRv = tStartContainer->AsDOMNode()->GetChildNodes(getter_AddRefs(tChildList));
if (aRv.Failed()) {
return;
}
// find the insertion point in the DOM and insert the Node
- aRv = tChildList->Item(tStartOffset, getter_AddRefs(referenceNode));
+ nsCOMPtr q;
+ aRv = tChildList->Item(tStartOffset, getter_AddRefs(q));
+ referenceNode = do_QueryInterface(q);
if (aRv.Failed()) {
return;
}
@@ -2560,13 +2490,8 @@ nsRange::InsertNode(nsINode& aNode, ErrorResult& aRv)
}
// Now actually insert the node
- nsCOMPtr tResultNode;
- nsCOMPtr node = aNode.AsDOMNode();
- if (!node) {
- aRv.Throw(NS_ERROR_DOM_NOT_OBJECT_ERR);
- return;
- }
- aRv = referenceParentNode->InsertBefore(node, referenceNode, getter_AddRefs(tResultNode));
+ nsCOMPtr tResultNode;
+ tResultNode = referenceParentNode->InsertBefore(aNode, referenceNode, aRv);
if (aRv.Failed()) {
return;
}
@@ -2633,9 +2558,7 @@ nsRange::SurroundContents(nsINode& aNewParent, ErrorResult& aRv)
// Extract the contents within the range.
- nsCOMPtr docFrag;
-
- aRv = ExtractContents(getter_AddRefs(docFrag));
+ nsRefPtr docFrag = ExtractContents(aRv);
if (aRv.Failed()) {
return;
@@ -2657,8 +2580,6 @@ nsRange::SurroundContents(nsINode& aNewParent, ErrorResult& aRv)
uint32_t numChildren = children->Length();
- nsCOMPtr tmpNode;
-
while (numChildren)
{
nsCOMPtr child = children->Item(--numChildren);
@@ -2681,7 +2602,7 @@ nsRange::SurroundContents(nsINode& aNewParent, ErrorResult& aRv)
}
// Append the content we extracted under aNewParent.
- aRv = aNewParent.AsDOMNode()->AppendChild(docFrag, getter_AddRefs(tmpNode));
+ aNewParent.AppendChild(*docFrag, aRv);
if (aRv.Failed()) {
return;
}
@@ -2693,10 +2614,10 @@ nsRange::SurroundContents(nsINode& aNewParent, ErrorResult& aRv)
NS_IMETHODIMP
nsRange::ToString(nsAString& aReturn)
-{
+{
// clear the string
aReturn.Truncate();
-
+
// If we're unpositioned, return the empty string
if (!mIsPositioned) {
return NS_OK;
@@ -2705,12 +2626,12 @@ nsRange::ToString(nsAString& aReturn)
#ifdef DEBUG_range
printf("Range dump: -----------------------\n");
#endif /* DEBUG */
-
+
// effeciency hack for simple case
if (mStartParent == mEndParent)
{
nsCOMPtr textNode( do_QueryInterface(mStartParent) );
-
+
if (textNode)
{
#ifdef DEBUG_range
@@ -2725,8 +2646,8 @@ nsRange::ToString(nsAString& aReturn)
return NS_ERROR_UNEXPECTED;
return NS_OK;
}
- }
-
+ }
+
/* complex case: mStartParent != mEndParent, or mStartParent not a text node
revisit - there are potential optimizations here and also tradeoffs.
*/
@@ -2734,9 +2655,9 @@ nsRange::ToString(nsAString& aReturn)
nsCOMPtr iter = NS_NewContentIterator();
nsresult rv = iter->Init(this);
NS_ENSURE_SUCCESS(rv, rv);
-
+
nsString tempString;
-
+
// loop through the content iterator, which returns nodes in the range in
// close tag order, and grab the text from any text node
while (!iter->IsDone())
@@ -2788,7 +2709,7 @@ nsRange::Detach()
return NS_OK;
}
-NS_IMETHODIMP
+NS_IMETHODIMP
nsRange::CreateContextualFragment(const nsAString& aFragment,
nsIDOMDocumentFragment** aReturn)
{
@@ -2799,7 +2720,7 @@ nsRange::CreateContextualFragment(const nsAString& aFragment,
return NS_ERROR_FAILURE;
}
-already_AddRefed
+already_AddRefed
nsRange::CreateContextualFragment(const nsAString& aFragment, ErrorResult& aRv)
{
if (!mIsPositioned) {
@@ -2864,14 +2785,14 @@ static nsresult GetPartialTextRect(nsLayoutUtils::RectCallback* aCallback,
return NS_OK;
}
-static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
+static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
nsRange* aRange,
nsINode* aStartParent, int32_t aStartOffset,
nsINode* aEndParent, int32_t aEndOffset)
{
// Hold strong pointers across the flush
- nsCOMPtr startContainer = do_QueryInterface(aStartParent);
- nsCOMPtr endContainer = do_QueryInterface(aEndParent);
+ nsCOMPtr startContainer = aStartParent;
+ nsCOMPtr endContainer = aEndParent;
// Flush out layout so our frames are up to date.
if (!aStartParent->IsInDoc()) {
@@ -2902,7 +2823,7 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
textFrame->GetChildFrameContainingOffset(aStartOffset, false,
&outOffset, &outFrame);
if (outFrame) {
- nsIFrame* relativeTo =
+ nsIFrame* relativeTo =
nsLayoutUtils::GetContainingBlockForClientRect(outFrame);
nsRect r(outFrame->GetOffsetTo(relativeTo), outFrame->GetSize());
ExtractRectFromOffset(outFrame, relativeTo, aStartOffset, &r, false);
@@ -2915,14 +2836,14 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
}
do {
- nsCOMPtr node(iter.GetCurrentNode());
+ nsCOMPtr node = iter.GetCurrentNode();
iter.Next();
nsCOMPtr content = do_QueryInterface(node);
if (!content)
continue;
if (content->IsNodeOfType(nsINode::eTEXT)) {
if (node == startContainer) {
- int32_t offset = startContainer == endContainer ?
+ int32_t offset = startContainer == endContainer ?
aEndOffset : content->GetText()->GetLength();
GetPartialTextRect(aCollector, content, aStartOffset, offset);
continue;
@@ -2996,8 +2917,8 @@ nsRange::GetUsedFontFaces(nsIDOMFontFaceList** aResult)
NS_ENSURE_TRUE(mStartParent, NS_ERROR_UNEXPECTED);
- nsCOMPtr startContainer = do_QueryInterface(mStartParent);
- nsCOMPtr endContainer = do_QueryInterface(mEndParent);
+ nsCOMPtr startContainer = do_QueryInterface(mStartParent);
+ nsCOMPtr endContainer = do_QueryInterface(mEndParent);
// Flush out layout so our frames are up to date.
nsIDocument* doc = mStartParent->OwnerDoc();
@@ -3015,7 +2936,7 @@ nsRange::GetUsedFontFaces(nsIDOMFontFaceList** aResult)
while (!iter.IsDone()) {
// only collect anything if the range is not collapsed
- nsCOMPtr node(iter.GetCurrentNode());
+ nsCOMPtr node = iter.GetCurrentNode();
iter.Next();
nsCOMPtr content = do_QueryInterface(node);
@@ -3029,7 +2950,7 @@ nsRange::GetUsedFontFaces(nsIDOMFontFaceList** aResult)
if (content->IsNodeOfType(nsINode::eTEXT)) {
if (node == startContainer) {
- int32_t offset = startContainer == endContainer ?
+ int32_t offset = startContainer == endContainer ?
mEndOffset : content->GetText()->GetLength();
nsLayoutUtils::GetFontFacesForText(frame, mStartOffset, offset,
true, fontFaceList);
@@ -3085,7 +3006,7 @@ nsRange::AutoInvalidateSelection::~AutoInvalidateSelection()
}
/* static */ already_AddRefed
-nsRange::Constructor(const dom::GlobalObject& aGlobal, ErrorResult& aRv)
+nsRange::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
{
nsCOMPtr window = do_QueryInterface(aGlobal.Get());
if (!window || !window->GetDoc()) {
diff --git a/content/base/src/nsRange.h b/content/base/src/nsRange.h
index 92ba98861ba2..4fa815293a2e 100644
--- a/content/base/src/nsRange.h
+++ b/content/base/src/nsRange.h
@@ -22,7 +22,6 @@
class nsClientRect;
class nsClientRectList;
-class nsIDOMDocumentFragment;
namespace mozilla {
class ErrorResult;
@@ -89,7 +88,7 @@ class nsRange MOZ_FINAL : public nsIDOMRange,
// nsIDOMRange interface
NS_DECL_NSIDOMRANGE
-
+
nsINode* GetRoot() const
{
return mRoot;
@@ -235,16 +234,16 @@ class nsRange MOZ_FINAL : public nsIDOMRange,
*/
nsresult CutContents(mozilla::dom::DocumentFragment** frag);
- static nsresult CloneParentsBetween(nsIDOMNode *aAncestor,
- nsIDOMNode *aNode,
- nsIDOMNode **aClosestAncestor,
- nsIDOMNode **aFarthestAncestor);
+ static nsresult CloneParentsBetween(nsINode* aAncestor,
+ nsINode* aNode,
+ nsINode** aClosestAncestor,
+ nsINode** aFarthestAncestor);
public:
/******************************************************************************
- * Utility routine to detect if a content node starts before a range and/or
+ * Utility routine to detect if a content node starts before a range and/or
* ends after a range. If neither it is contained inside the range.
- *
+ *
* XXX - callers responsibility to ensure node in same doc as range!
*
*****************************************************************************/
diff --git a/content/base/src/nsTextNode.cpp b/content/base/src/nsTextNode.cpp
index e00c182a869f..1af16a61ad4a 100644
--- a/content/base/src/nsTextNode.cpp
+++ b/content/base/src/nsTextNode.cpp
@@ -26,8 +26,8 @@ using namespace mozilla::dom;
/**
* class used to implement attr() generated content
*/
-class nsAttributeTextNode : public nsTextNode,
- public nsStubMutationObserver
+class nsAttributeTextNode MOZ_FINAL : public nsTextNode,
+ public nsStubMutationObserver
{
public:
NS_DECL_ISUPPORTS_INHERITED
diff --git a/content/base/test/chrome/title_window.xul b/content/base/test/chrome/title_window.xul
index 88bae491baff..da2ee24b67ac 100644
--- a/content/base/test/chrome/title_window.xul
+++ b/content/base/test/chrome/title_window.xul
@@ -38,6 +38,10 @@
testStatic("xhtml3", "Test", "XHTML containing an element");
testStatic("xul1", "Test", "XUL title attribute");
testStatic("svg1", "Test", "SVG ");
+
+ // This one does nothing and won't fire an event
+ document.getElementById("xhtml4").contentDocument.title = "Hello";
+ is(document.getElementById("xhtml4").contentDocument.title, "", "Setting 'title' does nothing with no ");
}
function testDynamics() {
@@ -73,100 +77,116 @@
op(frame.contentDocument);
}
- testDynamic("html1", "Hello", "Setting HTML text contents",
- function(doc){
- var t = doc.getElementById("t"); t.textContent = "Hello";
- });
- testDynamic("html2", "Foo", "Removing HTML ",
- function(doc){
- var t = doc.getElementById("t"); t.parentNode.removeChild(t);
- });
- testDynamic("html3", "Hello", "Appending HTML element to root element",
- function(doc){
- var t = doc.createElement("title"); t.textContent = "Hello"; doc.documentElement.appendChild(t);
- });
-
- testDynamic("xhtml3", "Hello", "Setting 'title' clears existing contents",
- function(doc){
- doc.title = "Hello";
- },
- function(doc, desc) {
- is(doc.documentElement.firstChild.data, "Hello", desc);
- is(doc.documentElement.firstChild.nextSibling, null, desc);
- });
- // This one does nothing and won't fire an event
- document.getElementById("xhtml4").contentDocument.title = "Hello";
- is(document.getElementById("xhtml4").contentDocument.title, "", "Setting 'title' does nothing with no ");
- testDynamic("xhtml5", "Hello", "Setting 'title' works with a ",
- function(doc){
- doc.title = "Hello";
- },
- function(doc, desc) {
- var head = doc.documentElement.firstChild;
- var title = head.firstChild;
- is(title.tagName.toLowerCase(), "title", desc);
- is(title.firstChild.data, "Hello", desc);
- is(title.firstChild.nextSibling, null, desc);
- is(title.nextSibling, null, desc);
- });
- testDynamic("xhtml6", "Hello", "Setting 'title' appends to ",
- function(doc){
- doc.title = "Hello";
- },
- function(doc, desc) {
- var head = doc.documentElement.firstChild;
- is(head.firstChild.tagName.toLowerCase(), "style", desc);
- var title = head.firstChild.nextSibling;
- is(title.tagName.toLowerCase(), "title", desc);
- is(title.firstChild.data, "Hello", desc);
- is(title.firstChild.nextSibling, null, desc);
- is(title.nextSibling, null, desc);
- });
-
- testDynamic("xul1", "Hello", "Setting XUL title attribute",
- function(doc){
- doc.documentElement.setAttribute("title", "Hello");
- });
- testDynamic("xul2", "Hello", "Setting 'title' in XUL",
- function(doc){
- doc.title = "Hello";
- },
- function(doc, desc) {
- is(doc.documentElement.getAttribute("title"), "Hello", desc);
- is(doc.documentElement.firstChild, null, desc);
- });
-
- testDynamic("svg1", "Hello", "Setting SVG text contents",
- function(doc){
- var t = doc.getElementById("t"); t.textContent = "Hello";
- });
- testDynamic("svg2", "", "Removing SVG ",
- function(doc){
- var t = doc.getElementById("t"); t.parentNode.removeChild(t);
- });
-
- function end() {
- for (description in inProgress) {
- ok(!inProgress[description],
- description + ": DOMTitleChange not fired");
- }
- for (description in inProgressDoc) {
- ok(inProgressDoc[description],
- description + ": DOMTitleChange fired on content document");
- }
- for (description in inProgressWin) {
- ok(inProgressWin[description],
- description + ": DOMTitleChange fired on content window");
- }
+ var dynamicTests = [
+ [ "html1", "Hello", "Setting HTML text contents",
+ function(doc){
+ var t = doc.getElementById("t"); t.textContent = "Hello";
+ } ],
+ [ "html2", "Foo", "Removing HTML ",
+ function(doc){
+ var t = doc.getElementById("t"); t.parentNode.removeChild(t);
+ } ],
+ [ "html3", "Hello", "Appending HTML element to root element",
+ function(doc){
+ var t = doc.createElement("title"); t.textContent = "Hello"; doc.documentElement.appendChild(t);
+ } ],
+ [ "xhtml3", "Hello", "Setting 'title' clears existing contents",
+ function(doc){
+ doc.title = "Hello";
+ },
+ function(doc, desc) {
+ is(doc.documentElement.firstChild.data, "Hello", desc);
+ is(doc.documentElement.firstChild.nextSibling, null, desc);
+ } ],
+ [ "xhtml5", "Hello", "Setting 'title' works with a ",
+ function(doc){
+ doc.title = "Hello";
+ },
+ function(doc, desc) {
+ var head = doc.documentElement.firstChild;
+ var title = head.firstChild;
+ is(title.tagName.toLowerCase(), "title", desc);
+ is(title.firstChild.data, "Hello", desc);
+ is(title.firstChild.nextSibling, null, desc);
+ is(title.nextSibling, null, desc);
+ } ],
+ [ "xhtml6", "Hello", "Setting 'title' appends to ",
+ function(doc){
+ doc.title = "Hello";
+ },
+ function(doc, desc) {
+ var head = doc.documentElement.firstChild;
+ is(head.firstChild.tagName.toLowerCase(), "style", desc);
+ var title = head.firstChild.nextSibling;
+ is(title.tagName.toLowerCase(), "title", desc);
+ is(title.firstChild.data, "Hello", desc);
+ is(title.firstChild.nextSibling, null, desc);
+ is(title.nextSibling, null, desc);
+ } ],
+ [ "xul1", "Hello", "Setting XUL title attribute",
+ function(doc){
+ doc.documentElement.setAttribute("title", "Hello");
+ } ],
+ [ "xul2", "Hello", "Setting 'title' in XUL",
+ function(doc){
+ doc.title = "Hello";
+ },
+ function(doc, desc) {
+ is(doc.documentElement.getAttribute("title"), "Hello", desc);
+ is(doc.documentElement.firstChild, null, desc);
+ } ],
+ [ "svg1", "Hello", "Setting SVG text contents",
+ function(doc){
+ var t = doc.getElementById("t"); t.textContent = "Hello";
+ } ],
+ [ "svg2", "", "Removing SVG ",
+ function(doc){
+ var t = doc.getElementById("t"); t.parentNode.removeChild(t);
+ } ] ];
+
+ var titleWindow = window;
+
+ function runIndividualTest(i) {
+ if (i == dynamicTests.length) {
+ // Closing the window will nuke the global properties, since this
+ // function is not really running on this window... or something
+ // like that. Thanks, executeSoon!
+ var tester = SimpleTest;
+ window.close();
+ tester.finish();
+ } else {
+ var parameters = dynamicTests[i];
+ var testElementId = parameters[0];
+ var testExpectedValue = parameters[1];
+ var testDescription = parameters[2];
+ var testOp = parameters[3];
+ var testCheckDOM = parameters[4];
+
+ function checkTest() {
+ ok(!inProgress[testDescription],
+ testDescription + ": DOMTitleChange not fired");
+ ok(inProgressDoc[testDescription],
+ testDescription + ": DOMTitleChange fired on content document");
+ ok(inProgressWin[testDescription],
+ testDescription + ": DOMTitleChange fired on content window");
+ // Run the next test in the context of the parent XUL window.
+ titleWindow.setTimeout(runIndividualTest, 0, i+1);
+ }
+ function spinEventLoopOp(doc) {
+ // Perform the test's operations.
+ testOp(doc);
+ // Spin the associated window's event loop to ensure we
+ // drain any asynchronous changes and fire associated
+ // events.
+ doc.defaultView.setTimeout(checkTest, 0);
+ }
- // Closing the window will nuke the global properties, since this
- // function is not really running on this window... or something
- // like that. Thanks, executeSoon!
- var tester = SimpleTest;
- window.close();
- tester.finish();
+ testDynamic(testElementId, testExpectedValue, testDescription,
+ spinEventLoopOp, testCheckDOM);
+ }
}
- SimpleTest.executeSoon(end);
+
+ window.setTimeout(runIndividualTest, 0, 0);
}
function runTests() {
diff --git a/content/canvas/src/Makefile.in b/content/canvas/src/Makefile.in
index 02222034b320..33dd5329f425 100644
--- a/content/canvas/src/Makefile.in
+++ b/content/canvas/src/Makefile.in
@@ -21,9 +21,6 @@ LOCAL_INCLUDES += \
$(NULL)
endif
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
diff --git a/content/canvas/test/webgl/moz.build b/content/canvas/test/webgl/moz.build
index 895d11993cfb..3d5c1e93c6e7 100644
--- a/content/canvas/test/webgl/moz.build
+++ b/content/canvas/test/webgl/moz.build
@@ -4,3 +4,4 @@
# 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/.
+DIRS += ['non-conf-tests']
diff --git a/content/canvas/test/webgl/non-conf-tests/Makefile.in b/content/canvas/test/webgl/non-conf-tests/Makefile.in
new file mode 100644
index 000000000000..4f97d3bb43ee
--- /dev/null
+++ b/content/canvas/test/webgl/non-conf-tests/Makefile.in
@@ -0,0 +1,18 @@
+#
+# 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/.
+
+DEPTH = @DEPTH@
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+relativesrcdir = @relativesrcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+MOCHITEST_FILES = \
+ test_webgl_conformance.html \
+ $(NULL)
+
+include $(topsrcdir)/config/rules.mk
diff --git a/content/canvas/test/webgl/non-conf-tests/moz.build b/content/canvas/test/webgl/non-conf-tests/moz.build
new file mode 100644
index 000000000000..c271ec3908ce
--- /dev/null
+++ b/content/canvas/test/webgl/non-conf-tests/moz.build
@@ -0,0 +1,5 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html b/content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html
new file mode 100644
index 000000000000..aad40652d938
--- /dev/null
+++ b/content/canvas/test/webgl/non-conf-tests/test_webgl_conformance.html
@@ -0,0 +1,26 @@
+
+WebGL test: 'webgl' context request
+
+
+
+
+
+
+
diff --git a/content/events/src/Makefile.in b/content/events/src/Makefile.in
index 4e075bdb99e9..02d732e8a473 100644
--- a/content/events/src/Makefile.in
+++ b/content/events/src/Makefile.in
@@ -15,9 +15,6 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk
diff --git a/content/events/src/nsEventDispatcher.cpp b/content/events/src/nsEventDispatcher.cpp
index d9f8500ee924..eaa1093017df 100644
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -12,7 +12,7 @@
#include "nsCxPusher.h"
#include "nsError.h"
#include "nsMutationEvent.h"
-#include NEW_H
+#include
#include "nsINode.h"
#include "nsPIDOMWindow.h"
#include "nsFrameLoader.h"
diff --git a/content/html/content/public/HTMLAudioElement.h b/content/html/content/public/HTMLAudioElement.h
index 49fcd23e1c03..5434242be917 100644
--- a/content/html/content/public/HTMLAudioElement.h
+++ b/content/html/content/public/HTMLAudioElement.h
@@ -18,9 +18,9 @@ typedef uint16_t nsMediaReadyState;
namespace mozilla {
namespace dom {
-class HTMLAudioElement : public HTMLMediaElement,
- public nsITimerCallback,
- public nsIDOMHTMLAudioElement
+class HTMLAudioElement MOZ_FINAL : public HTMLMediaElement,
+ public nsITimerCallback,
+ public nsIDOMHTMLAudioElement
{
public:
HTMLAudioElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/public/HTMLVideoElement.h b/content/html/content/public/HTMLVideoElement.h
index a03119f01cc7..95047106d392 100644
--- a/content/html/content/public/HTMLVideoElement.h
+++ b/content/html/content/public/HTMLVideoElement.h
@@ -16,8 +16,8 @@
namespace mozilla {
namespace dom {
-class HTMLVideoElement : public HTMLMediaElement,
- public nsIDOMHTMLVideoElement
+class HTMLVideoElement MOZ_FINAL : public HTMLMediaElement,
+ public nsIDOMHTMLVideoElement
{
public:
HTMLVideoElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLAnchorElement.h b/content/html/content/src/HTMLAnchorElement.h
index cf43928344eb..4ce3f4330f1d 100644
--- a/content/html/content/src/HTMLAnchorElement.h
+++ b/content/html/content/src/HTMLAnchorElement.h
@@ -16,10 +16,10 @@
namespace mozilla {
namespace dom {
-class HTMLAnchorElement : public nsGenericHTMLElement,
- public nsIDOMHTMLAnchorElement,
- public nsILink,
- public Link
+class HTMLAnchorElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLAnchorElement,
+ public nsILink,
+ public Link
{
public:
using Element::GetText;
diff --git a/content/html/content/src/HTMLAreaElement.h b/content/html/content/src/HTMLAreaElement.h
index 4a1b2928e61c..106de38ba1d4 100644
--- a/content/html/content/src/HTMLAreaElement.h
+++ b/content/html/content/src/HTMLAreaElement.h
@@ -20,10 +20,10 @@ class nsIDocument;
namespace mozilla {
namespace dom {
-class HTMLAreaElement : public nsGenericHTMLElement,
- public nsIDOMHTMLAreaElement,
- public nsILink,
- public Link
+class HTMLAreaElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLAreaElement,
+ public nsILink,
+ public Link
{
public:
HTMLAreaElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLBodyElement.h b/content/html/content/src/HTMLBodyElement.h
index b105a053086b..c2d7a3c05565 100644
--- a/content/html/content/src/HTMLBodyElement.h
+++ b/content/html/content/src/HTMLBodyElement.h
@@ -33,8 +33,8 @@ class BodyRule: public nsIStyleRule
HTMLBodyElement* mPart; // not ref-counted, cleared by content
};
-class HTMLBodyElement : public nsGenericHTMLElement,
- public nsIDOMHTMLBodyElement
+class HTMLBodyElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLBodyElement
{
public:
using Element::GetText;
diff --git a/content/html/content/src/HTMLButtonElement.h b/content/html/content/src/HTMLButtonElement.h
index 40757fd82c1f..640deeef7f1e 100644
--- a/content/html/content/src/HTMLButtonElement.h
+++ b/content/html/content/src/HTMLButtonElement.h
@@ -14,9 +14,9 @@
namespace mozilla {
namespace dom {
-class HTMLButtonElement : public nsGenericHTMLFormElement,
- public nsIDOMHTMLButtonElement,
- public nsIConstraintValidation
+class HTMLButtonElement MOZ_FINAL : public nsGenericHTMLFormElement,
+ public nsIDOMHTMLButtonElement,
+ public nsIConstraintValidation
{
public:
using nsIConstraintValidation::GetValidationMessage;
diff --git a/content/html/content/src/HTMLDataListElement.h b/content/html/content/src/HTMLDataListElement.h
index 10d0686dd74e..5d42896a1a17 100644
--- a/content/html/content/src/HTMLDataListElement.h
+++ b/content/html/content/src/HTMLDataListElement.h
@@ -13,8 +13,8 @@
namespace mozilla {
namespace dom {
-class HTMLDataListElement : public nsGenericHTMLElement,
- public nsIDOMHTMLDataListElement
+class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLDataListElement
{
public:
HTMLDataListElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLElement.cpp b/content/html/content/src/HTMLElement.cpp
index 1a9b28c3782e..35b5ecbc3036 100644
--- a/content/html/content/src/HTMLElement.cpp
+++ b/content/html/content/src/HTMLElement.cpp
@@ -10,8 +10,8 @@
namespace mozilla {
namespace dom {
-class HTMLElement : public nsGenericHTMLElement,
- public nsIDOMHTMLElement
+class HTMLElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLElement
{
public:
HTMLElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLFieldSetElement.h b/content/html/content/src/HTMLFieldSetElement.h
index e3e06a7e7e07..c484d4d4e85e 100644
--- a/content/html/content/src/HTMLFieldSetElement.h
+++ b/content/html/content/src/HTMLFieldSetElement.h
@@ -16,9 +16,9 @@
namespace mozilla {
namespace dom {
-class HTMLFieldSetElement : public nsGenericHTMLFormElement,
- public nsIDOMHTMLFieldSetElement,
- public nsIConstraintValidation
+class HTMLFieldSetElement MOZ_FINAL : public nsGenericHTMLFormElement,
+ public nsIDOMHTMLFieldSetElement,
+ public nsIConstraintValidation
{
public:
using nsGenericHTMLFormElement::GetForm;
diff --git a/content/html/content/src/HTMLFontElement.h b/content/html/content/src/HTMLFontElement.h
index ee06456df718..61ed4d92facb 100644
--- a/content/html/content/src/HTMLFontElement.h
+++ b/content/html/content/src/HTMLFontElement.h
@@ -12,8 +12,8 @@
namespace mozilla {
namespace dom {
-class HTMLFontElement : public nsGenericHTMLElement,
- public nsIDOMHTMLFontElement
+class HTMLFontElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLFontElement
{
public:
HTMLFontElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLFormElement.h b/content/html/content/src/HTMLFormElement.h
index b5a04e0f494b..913a89a8d104 100644
--- a/content/html/content/src/HTMLFormElement.h
+++ b/content/html/content/src/HTMLFormElement.h
@@ -35,11 +35,11 @@ namespace dom {
class nsFormControlList;
-class HTMLFormElement : public nsGenericHTMLElement,
- public nsIDOMHTMLFormElement,
- public nsIWebProgressListener,
- public nsIForm,
- public nsIRadioGroupContainer
+class HTMLFormElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLFormElement,
+ public nsIWebProgressListener,
+ public nsIForm,
+ public nsIRadioGroupContainer
{
friend class nsFormControlList;
diff --git a/content/html/content/src/HTMLFrameElement.h b/content/html/content/src/HTMLFrameElement.h
index effd3e0bc8fd..da06b9bf009d 100644
--- a/content/html/content/src/HTMLFrameElement.h
+++ b/content/html/content/src/HTMLFrameElement.h
@@ -16,8 +16,8 @@ class nsIDOMDocument;
namespace mozilla {
namespace dom {
-class HTMLFrameElement : public nsGenericHTMLFrameElement,
- public nsIDOMHTMLFrameElement
+class HTMLFrameElement MOZ_FINAL : public nsGenericHTMLFrameElement,
+ public nsIDOMHTMLFrameElement
{
public:
using nsGenericHTMLFrameElement::SwapFrameLoaders;
diff --git a/content/html/content/src/HTMLFrameSetElement.h b/content/html/content/src/HTMLFrameSetElement.h
index eb9cd2588813..2a82c82e7028 100644
--- a/content/html/content/src/HTMLFrameSetElement.h
+++ b/content/html/content/src/HTMLFrameSetElement.h
@@ -42,8 +42,8 @@ namespace dom {
class BeforeUnloadEventHandlerNonNull;
-class HTMLFrameSetElement : public nsGenericHTMLElement,
- public nsIDOMHTMLFrameSetElement
+class HTMLFrameSetElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLFrameSetElement
{
public:
HTMLFrameSetElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLHRElement.h b/content/html/content/src/HTMLHRElement.h
index 7116bea18c85..7c3a5d0b13fb 100644
--- a/content/html/content/src/HTMLHRElement.h
+++ b/content/html/content/src/HTMLHRElement.h
@@ -16,8 +16,8 @@
namespace mozilla {
namespace dom {
-class HTMLHRElement : public nsGenericHTMLElement,
- public nsIDOMHTMLHRElement
+class HTMLHRElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLHRElement
{
public:
HTMLHRElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLInputElement.h b/content/html/content/src/HTMLInputElement.h
index 632511d57d9d..005a16d08004 100644
--- a/content/html/content/src/HTMLInputElement.h
+++ b/content/html/content/src/HTMLInputElement.h
@@ -77,13 +77,13 @@ class UploadLastDir MOZ_FINAL : public nsIObserver, public nsSupportsWeakReferen
};
};
-class HTMLInputElement : public nsGenericHTMLFormElement,
- public nsImageLoadingContent,
- public nsIDOMHTMLInputElement,
- public nsITextControlElement,
- public nsIPhonetic,
- public nsIDOMNSEditableElement,
- public nsIConstraintValidation
+class HTMLInputElement MOZ_FINAL : public nsGenericHTMLFormElement,
+ public nsImageLoadingContent,
+ public nsIDOMHTMLInputElement,
+ public nsITextControlElement,
+ public nsIPhonetic,
+ public nsIDOMNSEditableElement,
+ public nsIConstraintValidation
{
public:
using nsIConstraintValidation::GetValidationMessage;
diff --git a/content/html/content/src/HTMLLIElement.h b/content/html/content/src/HTMLLIElement.h
index 9f9e557f964f..d26810d9b7f6 100644
--- a/content/html/content/src/HTMLLIElement.h
+++ b/content/html/content/src/HTMLLIElement.h
@@ -14,8 +14,8 @@
namespace mozilla {
namespace dom {
-class HTMLLIElement : public nsGenericHTMLElement,
- public nsIDOMHTMLLIElement
+class HTMLLIElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLLIElement
{
public:
HTMLLIElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLLabelElement.h b/content/html/content/src/HTMLLabelElement.h
index 9230fc202c09..00e6d65eea62 100644
--- a/content/html/content/src/HTMLLabelElement.h
+++ b/content/html/content/src/HTMLLabelElement.h
@@ -16,8 +16,8 @@
namespace mozilla {
namespace dom {
-class HTMLLabelElement : public nsGenericHTMLFormElement,
- public nsIDOMHTMLLabelElement
+class HTMLLabelElement MOZ_FINAL : public nsGenericHTMLFormElement,
+ public nsIDOMHTMLLabelElement
{
public:
HTMLLabelElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLLegendElement.h b/content/html/content/src/HTMLLegendElement.h
index b6556d5084cf..8e88f7bd5940 100644
--- a/content/html/content/src/HTMLLegendElement.h
+++ b/content/html/content/src/HTMLLegendElement.h
@@ -14,8 +14,8 @@
namespace mozilla {
namespace dom {
-class HTMLLegendElement : public nsGenericHTMLElement,
- public nsIDOMHTMLLegendElement
+class HTMLLegendElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLLegendElement
{
public:
HTMLLegendElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLLinkElement.h b/content/html/content/src/HTMLLinkElement.h
index 295a1962d900..c7dc846fbaf2 100644
--- a/content/html/content/src/HTMLLinkElement.h
+++ b/content/html/content/src/HTMLLinkElement.h
@@ -16,11 +16,11 @@
namespace mozilla {
namespace dom {
-class HTMLLinkElement : public nsGenericHTMLElement,
- public nsIDOMHTMLLinkElement,
- public nsILink,
- public nsStyleLinkElement,
- public Link
+class HTMLLinkElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLLinkElement,
+ public nsILink,
+ public nsStyleLinkElement,
+ public Link
{
public:
HTMLLinkElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLMapElement.h b/content/html/content/src/HTMLMapElement.h
index 59baace5419e..5c2c18928731 100644
--- a/content/html/content/src/HTMLMapElement.h
+++ b/content/html/content/src/HTMLMapElement.h
@@ -17,8 +17,8 @@ class nsContentList;
namespace mozilla {
namespace dom {
-class HTMLMapElement : public nsGenericHTMLElement,
- public nsIDOMHTMLMapElement
+class HTMLMapElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLMapElement
{
public:
HTMLMapElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLMenuElement.h b/content/html/content/src/HTMLMenuElement.h
index 83ec71c5ee66..8013a5e3c48f 100644
--- a/content/html/content/src/HTMLMenuElement.h
+++ b/content/html/content/src/HTMLMenuElement.h
@@ -14,9 +14,9 @@
namespace mozilla {
namespace dom {
-class HTMLMenuElement : public nsGenericHTMLElement,
- public nsIDOMHTMLMenuElement,
- public nsIHTMLMenu
+class HTMLMenuElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLMenuElement,
+ public nsIHTMLMenu
{
public:
HTMLMenuElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLMenuItemElement.h b/content/html/content/src/HTMLMenuItemElement.h
index a2613f2e786d..42df846a2632 100644
--- a/content/html/content/src/HTMLMenuItemElement.h
+++ b/content/html/content/src/HTMLMenuItemElement.h
@@ -15,8 +15,8 @@ namespace dom {
class Visitor;
-class HTMLMenuItemElement : public nsGenericHTMLElement,
- public nsIDOMHTMLMenuItemElement
+class HTMLMenuItemElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLMenuItemElement
{
public:
using mozilla::dom::Element::GetText;
diff --git a/content/html/content/src/HTMLMetaElement.h b/content/html/content/src/HTMLMetaElement.h
index 8b0cf2698b17..1411fe54bcc7 100644
--- a/content/html/content/src/HTMLMetaElement.h
+++ b/content/html/content/src/HTMLMetaElement.h
@@ -13,8 +13,8 @@
namespace mozilla {
namespace dom {
-class HTMLMetaElement : public nsGenericHTMLElement,
- public nsIDOMHTMLMetaElement
+class HTMLMetaElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLMetaElement
{
public:
HTMLMetaElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLMeterElement.h b/content/html/content/src/HTMLMeterElement.h
index 0d596378d7a9..2110ad2411b7 100644
--- a/content/html/content/src/HTMLMeterElement.h
+++ b/content/html/content/src/HTMLMeterElement.h
@@ -18,8 +18,8 @@
namespace mozilla {
namespace dom {
-class HTMLMeterElement : public nsGenericHTMLElement,
- public nsIDOMHTMLMeterElement
+class HTMLMeterElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLMeterElement
{
public:
HTMLMeterElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLModElement.h b/content/html/content/src/HTMLModElement.h
index dfde9df9ad10..e17495e37037 100644
--- a/content/html/content/src/HTMLModElement.h
+++ b/content/html/content/src/HTMLModElement.h
@@ -14,8 +14,8 @@
namespace mozilla {
namespace dom {
-class HTMLModElement : public nsGenericHTMLElement,
- public nsIDOMHTMLModElement
+class HTMLModElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLModElement
{
public:
HTMLModElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLOptGroupElement.h b/content/html/content/src/HTMLOptGroupElement.h
index 6bcbba429472..c161f5e5af3a 100644
--- a/content/html/content/src/HTMLOptGroupElement.h
+++ b/content/html/content/src/HTMLOptGroupElement.h
@@ -13,8 +13,8 @@
namespace mozilla {
namespace dom {
-class HTMLOptGroupElement : public nsGenericHTMLElement,
- public nsIDOMHTMLOptGroupElement
+class HTMLOptGroupElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLOptGroupElement
{
public:
HTMLOptGroupElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLOptionElement.h b/content/html/content/src/HTMLOptionElement.h
index a191778683a3..2631abb7e51b 100644
--- a/content/html/content/src/HTMLOptionElement.h
+++ b/content/html/content/src/HTMLOptionElement.h
@@ -18,8 +18,8 @@ namespace dom {
class HTMLSelectElement;
-class HTMLOptionElement : public nsGenericHTMLElement,
- public nsIDOMHTMLOptionElement
+class HTMLOptionElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLOptionElement
{
public:
HTMLOptionElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLOutputElement.h b/content/html/content/src/HTMLOutputElement.h
index 89067a33bdc1..283b4e308894 100644
--- a/content/html/content/src/HTMLOutputElement.h
+++ b/content/html/content/src/HTMLOutputElement.h
@@ -15,10 +15,10 @@
namespace mozilla {
namespace dom {
-class HTMLOutputElement : public nsGenericHTMLFormElement,
- public nsIDOMHTMLOutputElement,
- public nsStubMutationObserver,
- public nsIConstraintValidation
+class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
+ public nsIDOMHTMLOutputElement,
+ public nsStubMutationObserver,
+ public nsIConstraintValidation
{
public:
using nsIConstraintValidation::GetValidationMessage;
diff --git a/content/html/content/src/HTMLParagraphElement.h b/content/html/content/src/HTMLParagraphElement.h
index ec7971d5e9b0..f421c694899f 100644
--- a/content/html/content/src/HTMLParagraphElement.h
+++ b/content/html/content/src/HTMLParagraphElement.h
@@ -15,8 +15,8 @@
namespace mozilla {
namespace dom {
-class HTMLParagraphElement : public nsGenericHTMLElement,
- public nsIDOMHTMLParagraphElement
+class HTMLParagraphElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLParagraphElement
{
public:
HTMLParagraphElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLPreElement.h b/content/html/content/src/HTMLPreElement.h
index c026974fc78a..4eb2a0365230 100644
--- a/content/html/content/src/HTMLPreElement.h
+++ b/content/html/content/src/HTMLPreElement.h
@@ -15,8 +15,8 @@
namespace mozilla {
namespace dom {
-class HTMLPreElement : public nsGenericHTMLElement,
- public nsIDOMHTMLPreElement
+class HTMLPreElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLPreElement
{
public:
HTMLPreElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLProgressElement.h b/content/html/content/src/HTMLProgressElement.h
index 58bda9d57591..0be9491a8d8d 100644
--- a/content/html/content/src/HTMLProgressElement.h
+++ b/content/html/content/src/HTMLProgressElement.h
@@ -17,8 +17,8 @@
namespace mozilla {
namespace dom {
-class HTMLProgressElement : public nsGenericHTMLElement,
- public nsIDOMHTMLProgressElement
+class HTMLProgressElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLProgressElement
{
public:
HTMLProgressElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLSelectElement.h b/content/html/content/src/HTMLSelectElement.h
index c1e66f27b0e6..969d989f5977 100644
--- a/content/html/content/src/HTMLSelectElement.h
+++ b/content/html/content/src/HTMLSelectElement.h
@@ -103,9 +103,9 @@ class MOZ_STACK_CLASS SafeOptionListMutation
/**
* Implementation of <select>
*/
-class HTMLSelectElement : public nsGenericHTMLFormElement,
- public nsIDOMHTMLSelectElement,
- public nsIConstraintValidation
+class HTMLSelectElement MOZ_FINAL : public nsGenericHTMLFormElement,
+ public nsIDOMHTMLSelectElement,
+ public nsIConstraintValidation
{
public:
using nsIConstraintValidation::GetValidationMessage;
diff --git a/content/html/content/src/HTMLSharedElement.h b/content/html/content/src/HTMLSharedElement.h
index 4b91565a1167..c18dbc88cb27 100644
--- a/content/html/content/src/HTMLSharedElement.h
+++ b/content/html/content/src/HTMLSharedElement.h
@@ -22,13 +22,13 @@
namespace mozilla {
namespace dom {
-class HTMLSharedElement : public nsGenericHTMLElement,
- public nsIDOMHTMLParamElement,
- public nsIDOMHTMLBaseElement,
- public nsIDOMHTMLDirectoryElement,
- public nsIDOMHTMLQuoteElement,
- public nsIDOMHTMLHeadElement,
- public nsIDOMHTMLHtmlElement
+class HTMLSharedElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLParamElement,
+ public nsIDOMHTMLBaseElement,
+ public nsIDOMHTMLDirectoryElement,
+ public nsIDOMHTMLQuoteElement,
+ public nsIDOMHTMLHeadElement,
+ public nsIDOMHTMLHtmlElement
{
public:
HTMLSharedElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLSharedListElement.h b/content/html/content/src/HTMLSharedListElement.h
index 4a618ac99b98..28b87dea013a 100644
--- a/content/html/content/src/HTMLSharedListElement.h
+++ b/content/html/content/src/HTMLSharedListElement.h
@@ -16,10 +16,10 @@
namespace mozilla {
namespace dom {
-class HTMLSharedListElement : public nsGenericHTMLElement,
- public nsIDOMHTMLOListElement,
- public nsIDOMHTMLDListElement,
- public nsIDOMHTMLUListElement
+class HTMLSharedListElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLOListElement,
+ public nsIDOMHTMLDListElement,
+ public nsIDOMHTMLUListElement
{
public:
HTMLSharedListElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLSharedObjectElement.h b/content/html/content/src/HTMLSharedObjectElement.h
index 2ee49799c9d1..07fc69b267e0 100644
--- a/content/html/content/src/HTMLSharedObjectElement.h
+++ b/content/html/content/src/HTMLSharedObjectElement.h
@@ -18,10 +18,10 @@
namespace mozilla {
namespace dom {
-class HTMLSharedObjectElement : public nsGenericHTMLElement
- , public nsObjectLoadingContent
- , public nsIDOMHTMLAppletElement
- , public nsIDOMHTMLEmbedElement
+class HTMLSharedObjectElement MOZ_FINAL : public nsGenericHTMLElement
+ , public nsObjectLoadingContent
+ , public nsIDOMHTMLAppletElement
+ , public nsIDOMHTMLEmbedElement
{
public:
HTMLSharedObjectElement(already_AddRefed aNodeInfo,
diff --git a/content/html/content/src/HTMLSourceElement.h b/content/html/content/src/HTMLSourceElement.h
index 0514a0b26a0c..eb7e1ec6b176 100644
--- a/content/html/content/src/HTMLSourceElement.h
+++ b/content/html/content/src/HTMLSourceElement.h
@@ -15,8 +15,8 @@
namespace mozilla {
namespace dom {
-class HTMLSourceElement : public nsGenericHTMLElement,
- public nsIDOMHTMLSourceElement
+class HTMLSourceElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLSourceElement
{
public:
HTMLSourceElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLSpanElement.h b/content/html/content/src/HTMLSpanElement.h
index 29b0146bbeab..c72489413eeb 100644
--- a/content/html/content/src/HTMLSpanElement.h
+++ b/content/html/content/src/HTMLSpanElement.h
@@ -17,8 +17,8 @@
namespace mozilla {
namespace dom {
-class HTMLSpanElement : public nsGenericHTMLElement,
- public nsIDOMHTMLElement
+class HTMLSpanElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLElement
{
public:
HTMLSpanElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLTableCaptionElement.h b/content/html/content/src/HTMLTableCaptionElement.h
index 12f3d2d2236f..d2d8e5ef2123 100644
--- a/content/html/content/src/HTMLTableCaptionElement.h
+++ b/content/html/content/src/HTMLTableCaptionElement.h
@@ -12,8 +12,8 @@
namespace mozilla {
namespace dom {
-class HTMLTableCaptionElement : public nsGenericHTMLElement,
- public nsIDOMHTMLTableCaptionElement
+class HTMLTableCaptionElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLTableCaptionElement
{
public:
HTMLTableCaptionElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLTableCellElement.h b/content/html/content/src/HTMLTableCellElement.h
index 3b7d00f346d5..c1503911edbb 100644
--- a/content/html/content/src/HTMLTableCellElement.h
+++ b/content/html/content/src/HTMLTableCellElement.h
@@ -16,8 +16,8 @@ namespace dom {
class HTMLTableElement;
-class HTMLTableCellElement : public nsGenericHTMLElement,
- public nsIDOMHTMLTableCellElement
+class HTMLTableCellElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLTableCellElement
{
public:
HTMLTableCellElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLTableColElement.h b/content/html/content/src/HTMLTableColElement.h
index 41f2dbfcbc4d..401050610198 100644
--- a/content/html/content/src/HTMLTableColElement.h
+++ b/content/html/content/src/HTMLTableColElement.h
@@ -12,8 +12,8 @@
namespace mozilla {
namespace dom {
-class HTMLTableColElement : public nsGenericHTMLElement,
- public nsIDOMHTMLTableColElement
+class HTMLTableColElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLTableColElement
{
public:
HTMLTableColElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLTableElement.h b/content/html/content/src/HTMLTableElement.h
index 0ec90d127de4..0f158fe3c064 100644
--- a/content/html/content/src/HTMLTableElement.h
+++ b/content/html/content/src/HTMLTableElement.h
@@ -18,8 +18,8 @@ namespace dom {
class TableRowsCollection;
-class HTMLTableElement : public nsGenericHTMLElement,
- public nsIDOMHTMLTableElement
+class HTMLTableElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLTableElement
{
public:
HTMLTableElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLTableRowElement.h b/content/html/content/src/HTMLTableRowElement.h
index 19155c96b752..edbb0149fd71 100644
--- a/content/html/content/src/HTMLTableRowElement.h
+++ b/content/html/content/src/HTMLTableRowElement.h
@@ -16,8 +16,8 @@ class nsContentList;
namespace mozilla {
namespace dom {
-class HTMLTableRowElement : public nsGenericHTMLElement,
- public nsIDOMHTMLTableRowElement
+class HTMLTableRowElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLTableRowElement
{
public:
HTMLTableRowElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLTableSectionElement.h b/content/html/content/src/HTMLTableSectionElement.h
index 1234a0205b38..015730407f0d 100644
--- a/content/html/content/src/HTMLTableSectionElement.h
+++ b/content/html/content/src/HTMLTableSectionElement.h
@@ -13,8 +13,8 @@
namespace mozilla {
namespace dom {
-class HTMLTableSectionElement : public nsGenericHTMLElement,
- public nsIDOMHTMLTableSectionElement
+class HTMLTableSectionElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLTableSectionElement
{
public:
HTMLTableSectionElement(already_AddRefed aNodeInfo)
diff --git a/content/html/content/src/HTMLTemplateElement.h b/content/html/content/src/HTMLTemplateElement.h
index 307e7659af1b..eb2ceabac634 100644
--- a/content/html/content/src/HTMLTemplateElement.h
+++ b/content/html/content/src/HTMLTemplateElement.h
@@ -14,8 +14,8 @@
namespace mozilla {
namespace dom {
-class HTMLTemplateElement : public nsGenericHTMLElement,
- public nsIDOMHTMLElement
+class HTMLTemplateElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLElement
{
public:
HTMLTemplateElement(already_AddRefed aNodeInfo);
diff --git a/content/html/content/src/HTMLTitleElement.h b/content/html/content/src/HTMLTitleElement.h
index 7c6d9838e0ab..a23c68b3e754 100644
--- a/content/html/content/src/HTMLTitleElement.h
+++ b/content/html/content/src/HTMLTitleElement.h
@@ -16,9 +16,9 @@ class ErrorResult;
namespace dom {
-class HTMLTitleElement : public nsGenericHTMLElement,
- public nsIDOMHTMLTitleElement,
- public nsStubMutationObserver
+class HTMLTitleElement MOZ_FINAL : public nsGenericHTMLElement,
+ public nsIDOMHTMLTitleElement,
+ public nsStubMutationObserver
{
public:
using Element::GetText;
diff --git a/content/html/content/src/Makefile.in b/content/html/content/src/Makefile.in
index 91d7f9439889..2e22d6f51dd8 100644
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -15,9 +15,6 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
diff --git a/content/html/document/src/ImageDocument.h b/content/html/document/src/ImageDocument.h
index 0696f8483c37..d431b29a4ff9 100644
--- a/content/html/document/src/ImageDocument.h
+++ b/content/html/document/src/ImageDocument.h
@@ -14,10 +14,10 @@
namespace mozilla {
namespace dom {
-class ImageDocument : public MediaDocument,
- public nsIImageDocument,
- public imgINotificationObserver,
- public nsIDOMEventListener
+class ImageDocument MOZ_FINAL : public MediaDocument,
+ public nsIImageDocument,
+ public imgINotificationObserver,
+ public nsIDOMEventListener
{
public:
ImageDocument();
diff --git a/content/html/document/src/Makefile.in b/content/html/document/src/Makefile.in
index cec6a751a268..0c0768dee666 100644
--- a/content/html/document/src/Makefile.in
+++ b/content/html/document/src/Makefile.in
@@ -14,9 +14,6 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \
diff --git a/content/html/document/src/PluginDocument.cpp b/content/html/document/src/PluginDocument.cpp
index 1940f5a2c37f..3e06c4e442fd 100644
--- a/content/html/document/src/PluginDocument.cpp
+++ b/content/html/document/src/PluginDocument.cpp
@@ -22,8 +22,8 @@
namespace mozilla {
namespace dom {
-class PluginDocument : public MediaDocument
- , public nsIPluginDocument
+class PluginDocument MOZ_FINAL : public MediaDocument
+ , public nsIPluginDocument
{
public:
PluginDocument();
diff --git a/content/html/document/src/VideoDocument.cpp b/content/html/document/src/VideoDocument.cpp
index 4817c79582a5..fd92e84ba8e9 100644
--- a/content/html/document/src/VideoDocument.cpp
+++ b/content/html/document/src/VideoDocument.cpp
@@ -15,7 +15,7 @@
namespace mozilla {
namespace dom {
-class VideoDocument : public MediaDocument
+class VideoDocument MOZ_FINAL : public MediaDocument
{
public:
virtual nsresult StartDocumentLoad(const char* aCommand,
diff --git a/content/mathml/content/src/Makefile.in b/content/mathml/content/src/Makefile.in
index ae9b5f5e31c0..4af2e3e4b809 100644
--- a/content/mathml/content/src/Makefile.in
+++ b/content/mathml/content/src/Makefile.in
@@ -17,10 +17,6 @@ FAIL_ON_WARNINGS = 1
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
-# we don't want the shared lib, but we want to force the creation of a static
-# lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/mathml/content/src/nsMathMLElement.h b/content/mathml/content/src/nsMathMLElement.h
index 2caf62203b2d..6285ecd49c10 100644
--- a/content/mathml/content/src/nsMathMLElement.h
+++ b/content/mathml/content/src/nsMathMLElement.h
@@ -19,10 +19,10 @@ typedef nsMappedAttributeElement nsMathMLElementBase;
/*
* The base class for MathML elements.
*/
-class nsMathMLElement : public nsMathMLElementBase,
- public nsIDOMElement,
- public nsILink,
- public mozilla::dom::Link
+class nsMathMLElement MOZ_FINAL : public nsMathMLElementBase,
+ public nsIDOMElement,
+ public nsILink,
+ public mozilla::dom::Link
{
public:
nsMathMLElement(already_AddRefed aNodeInfo);
diff --git a/content/media/Makefile.in b/content/media/Makefile.in
index 07b81d4fabd8..25f47121d516 100644
--- a/content/media/Makefile.in
+++ b/content/media/Makefile.in
@@ -14,8 +14,6 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS := 1
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk
diff --git a/content/media/dash/Makefile.in b/content/media/dash/Makefile.in
index a62647dde079..40bccbe10b2e 100644
--- a/content/media/dash/Makefile.in
+++ b/content/media/dash/Makefile.in
@@ -17,8 +17,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY := 1
-FORCE_STATIC_LIB := 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES := \
diff --git a/content/media/encoder/Makefile.in b/content/media/encoder/Makefile.in
index 698bdde67813..c4e33711a8ee 100644
--- a/content/media/encoder/Makefile.in
+++ b/content/media/encoder/Makefile.in
@@ -13,6 +13,4 @@ LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS := 1
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
diff --git a/content/media/gstreamer/Makefile.in b/content/media/gstreamer/Makefile.in
index db8f4ca30e5e..86cc606de10d 100644
--- a/content/media/gstreamer/Makefile.in
+++ b/content/media/gstreamer/Makefile.in
@@ -12,8 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
CFLAGS += $(GSTREAMER_CFLAGS)
diff --git a/content/media/ogg/Makefile.in b/content/media/ogg/Makefile.in
index 8f3e75fb1fdf..86df1d7589af 100644
--- a/content/media/ogg/Makefile.in
+++ b/content/media/ogg/Makefile.in
@@ -13,6 +13,4 @@ LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS := 1
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
diff --git a/content/media/ogg/OggReader.cpp b/content/media/ogg/OggReader.cpp
index 4874f2c0617a..8b0cae4af292 100644
--- a/content/media/ogg/OggReader.cpp
+++ b/content/media/ogg/OggReader.cpp
@@ -298,7 +298,7 @@ nsresult OggReader::ReadMetadata(VideoInfo* aInfo,
if (mVorbisState && ReadHeaders(mVorbisState)) {
mInfo.mHasAudio = true;
mInfo.mAudioRate = mVorbisState->mInfo.rate;
- mInfo.mAudioChannels = mVorbisState->mInfo.channels;
+ mInfo.mAudioChannels = mVorbisState->mInfo.channels > 2 ? 2 : mVorbisState->mInfo.channels;
// Copy Vorbis info data for time computations on other threads.
memcpy(&mVorbisInfo, &mVorbisState->mInfo, sizeof(mVorbisInfo));
mVorbisInfo.codec_setup = NULL;
@@ -404,6 +404,15 @@ nsresult OggReader::DecodeVorbis(ogg_packet* aPacket) {
}
}
+ // More than 2 decoded channels must be downmixed to stereo.
+ if (channels > 2) {
+ if (channels > 8) {
+ // No channel mapping for more than 8 channels.
+ return NS_ERROR_FAILURE;
+ }
+ DownmixToStereo(buffer, channels, frames);
+ }
+
int64_t duration = mVorbisState->Time((int64_t)frames);
int64_t startTime = mVorbisState->Time(endFrame - frames);
mAudioQueue.Push(new AudioData(mPageOffset,
@@ -520,57 +529,7 @@ nsresult OggReader::DecodeOpus(ogg_packet* aPacket) {
// so we can't downmix more than that.
if (channels > 8)
return NS_ERROR_FAILURE;
-
- uint32_t out_channels;
- out_channels = 2;
- // dBuffer stores the downmixed sample data.
- nsAutoArrayPtr dBuffer(new AudioDataValue[frames * out_channels]);
-#ifdef MOZ_SAMPLE_TYPE_FLOAT32
- // Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8.
- static const float dmatrix[6][8][2]= {
- /*3*/{ {0.5858f,0}, {0.4142f,0.4142f}, {0,0.5858f}},
- /*4*/{ {0.4226f,0}, {0,0.4226f}, {0.366f,0.2114f}, {0.2114f,0.366f}},
- /*5*/{ {0.651f,0}, {0.46f,0.46f}, {0,0.651f}, {0.5636f,0.3254f}, {0.3254f,0.5636f}},
- /*6*/{ {0.529f,0}, {0.3741f,0.3741f}, {0,0.529f}, {0.4582f,0.2645f}, {0.2645f,0.4582f}, {0.3741f,0.3741f}},
- /*7*/{ {0.4553f,0}, {0.322f,0.322f}, {0,0.4553f}, {0.3943f,0.2277f}, {0.2277f,0.3943f}, {0.2788f,0.2788f}, {0.322f,0.322f}},
- /*8*/{ {0.3886f,0}, {0.2748f,0.2748f}, {0,0.3886f}, {0.3366f,0.1943f}, {0.1943f,0.3366f}, {0.3366f,0.1943f}, {0.1943f,0.3366f}, {0.2748f,0.2748f}},
- };
- for (int32_t i = 0; i < frames; i++) {
- float sampL = 0.0;
- float sampR = 0.0;
- for (uint32_t j = 0; j < channels; j++) {
- sampL+=buffer[i*channels+j]*dmatrix[channels-3][j][0];
- sampR+=buffer[i*channels+j]*dmatrix[channels-3][j][1];
- }
- dBuffer[i*out_channels]=sampL;
- dBuffer[i*out_channels+1]=sampR;
- }
-#else
- // Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8.
- // Coefficients in Q14.
- static const int16_t dmatrix[6][8][2]= {
- /*3*/{{9598, 0},{6786,6786},{0, 9598}},
- /*4*/{{6925, 0},{0, 6925},{5997,3462},{3462,5997}},
- /*5*/{{10663,0},{7540,7540},{0, 10663},{9234,5331},{5331,9234}},
- /*6*/{{8668, 0},{6129,6129},{0, 8668},{7507,4335},{4335,7507},{6129,6129}},
- /*7*/{{7459, 0},{5275,5275},{0, 7459},{6460,3731},{3731,6460},{4568,4568},{5275,5275}},
- /*8*/{{6368, 0},{4502,4502},{0, 6368},{5514,3184},{3184,5514},{5514,3184},{3184,5514},{4502,4502}}
- };
- for (int32_t i = 0; i < frames; i++) {
- int32_t sampL = 0;
- int32_t sampR = 0;
- for (uint32_t j = 0; j < channels; j++) {
- sampL+=buffer[i*channels+j]*dmatrix[channels-3][j][0];
- sampR+=buffer[i*channels+j]*dmatrix[channels-3][j][1];
- }
- sampL = (sampL + 8192)>>14;
- dBuffer[i*out_channels] = static_cast(MOZ_CLIP_TO_15(sampL));
- sampR = (sampR + 8192)>>14;
- dBuffer[i*out_channels+1] = static_cast(MOZ_CLIP_TO_15(sampR));
- }
-#endif
- channels = out_channels;
- buffer = dBuffer;
+ DownmixToStereo(buffer, channels, frames);
}
LOG(PR_LOG_DEBUG, ("Opus decoder pushing %d frames", frames));
@@ -589,6 +548,61 @@ nsresult OggReader::DecodeOpus(ogg_packet* aPacket) {
}
#endif /* MOZ_OPUS */
+void OggReader::DownmixToStereo(nsAutoArrayPtr& buffer,
+ uint32_t& channels, int32_t frames)
+{
+ uint32_t out_channels;
+ out_channels = 2;
+ // dBuffer stores the downmixed samples.
+ nsAutoArrayPtr dBuffer(new AudioDataValue[frames * out_channels]);
+#ifdef MOZ_SAMPLE_TYPE_FLOAT32
+ // Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8.
+ static const float dmatrix[6][8][2]= {
+ /*3*/{{0.5858f,0},{0.4142f,0.4142f},{0, 0.5858f}},
+ /*4*/{{0.4226f,0},{0, 0.4226f},{0.366f,0.2114f},{0.2114f,0.366f}},
+ /*5*/{{0.6510f,0},{0.4600f,0.4600f},{0, 0.6510f},{0.5636f,0.3254f},{0.3254f,0.5636f}},
+ /*6*/{{0.5290f,0},{0.3741f,0.3741f},{0, 0.5290f},{0.4582f,0.2645f},{0.2645f,0.4582f},{0.3741f,0.3741f}},
+ /*7*/{{0.4553f,0},{0.3220f,0.3220f},{0, 0.4553f},{0.3943f,0.2277f},{0.2277f,0.3943f},{0.2788f,0.2788f},{0.3220f,0.3220f}},
+ /*8*/{{0.3886f,0},{0.2748f,0.2748f},{0, 0.3886f},{0.3366f,0.1943f},{0.1943f,0.3366f},{0.3366f,0.1943f},{0.1943f,0.3366f},{0.2748f,0.2748f}},
+ };
+ for (int32_t i = 0; i < frames; i++) {
+ float sampL = 0.0;
+ float sampR = 0.0;
+ for (uint32_t j = 0; j < channels; j++) {
+ sampL+=buffer[i*channels+j]*dmatrix[channels-3][j][0];
+ sampR+=buffer[i*channels+j]*dmatrix[channels-3][j][1];
+ }
+ dBuffer[i*out_channels]=sampL;
+ dBuffer[i*out_channels+1]=sampR;
+ }
+#else
+ // Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8.
+ // Coefficients in Q14.
+ static const int16_t dmatrix[6][8][2]= {
+ /*3*/{{9598, 0},{6786,6786},{0, 9598}},
+ /*4*/{{6925, 0},{0, 6925},{5997,3462},{3462,5997}},
+ /*5*/{{10663,0},{7540,7540},{0, 10663},{9234,5331},{5331,9234}},
+ /*6*/{{8668, 0},{6129,6129},{0, 8668},{7507,4335},{4335,7507},{6129,6129}},
+ /*7*/{{7459, 0},{5275,5275},{0, 7459},{6460,3731},{3731,6460},{4568,4568},{5275,5275}},
+ /*8*/{{6368, 0},{4502,4502},{0, 6368},{5514,3184},{3184,5514},{5514,3184},{3184,5514},{4502,4502}}
+ };
+ for (int32_t i = 0; i < frames; i++) {
+ int32_t sampL = 0;
+ int32_t sampR = 0;
+ for (uint32_t j = 0; j < channels; j++) {
+ sampL+=buffer[i*channels+j]*dmatrix[channels-3][j][0];
+ sampR+=buffer[i*channels+j]*dmatrix[channels-3][j][1];
+ }
+ sampL = (sampL + 8192)>>14;
+ dBuffer[i*out_channels] = static_cast(MOZ_CLIP_TO_15(sampL));
+ sampR = (sampR + 8192)>>14;
+ dBuffer[i*out_channels+1] = static_cast(MOZ_CLIP_TO_15(sampR));
+ }
+#endif
+ channels = out_channels;
+ buffer = dBuffer;
+}
+
bool OggReader::DecodeAudioData()
{
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
diff --git a/content/media/ogg/OggReader.h b/content/media/ogg/OggReader.h
index 76171c824189..c7c953ff8f0b 100644
--- a/content/media/ogg/OggReader.h
+++ b/content/media/ogg/OggReader.h
@@ -220,6 +220,13 @@ class OggReader : public MediaDecoderReader
// audio queue.
nsresult DecodeOpus(ogg_packet* aPacket);
+ // Downmix multichannel Audio samples to Stereo.
+ // It is used from Vorbis and Opus decoders.
+ // Input are the buffer contains multichannel data,
+ // the number of channels and the number of frames.
+ void DownmixToStereo(nsAutoArrayPtr& buffer,
+ uint32_t& channel, int32_t frames);
+
// Decodes a packet of Theora data, and inserts its frame into the
// video queue. May return NS_ERROR_OUT_OF_MEMORY. Caller must have obtained
// the reader's monitor. aTimeThreshold is the current playback position
diff --git a/content/media/omx/Makefile.in b/content/media/omx/Makefile.in
index 9717543d3445..791e89f17f63 100644
--- a/content/media/omx/Makefile.in
+++ b/content/media/omx/Makefile.in
@@ -12,8 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkconomx_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
diff --git a/content/media/plugins/Makefile.in b/content/media/plugins/Makefile.in
index 67c77c2988b9..105ec7f29a5d 100644
--- a/content/media/plugins/Makefile.in
+++ b/content/media/plugins/Makefile.in
@@ -11,8 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/media/raw/Makefile.in b/content/media/raw/Makefile.in
index 8a2b174074f2..57d9b3875560 100644
--- a/content/media/raw/Makefile.in
+++ b/content/media/raw/Makefile.in
@@ -13,8 +13,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS := 1
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/media/test/test_framebuffer.html b/content/media/test/test_framebuffer.html
index 915aada2d8fb..b6df9546c861 100644
--- a/content/media/test/test_framebuffer.html
+++ b/content/media/test/test_framebuffer.html
@@ -19,9 +19,9 @@
+
+
+
+
diff --git a/content/svg/content/src/crashtests/880544-2.svg b/content/svg/content/src/crashtests/880544-2.svg
new file mode 100644
index 000000000000..7570c7cbfeb0
--- /dev/null
+++ b/content/svg/content/src/crashtests/880544-2.svg
@@ -0,0 +1,15 @@
+
+
+
+ foo
+
+
diff --git a/content/svg/content/src/crashtests/880544-3.svg b/content/svg/content/src/crashtests/880544-3.svg
new file mode 100644
index 000000000000..5791b8ec6255
--- /dev/null
+++ b/content/svg/content/src/crashtests/880544-3.svg
@@ -0,0 +1,15 @@
+
+
+
+ foo
+
+
diff --git a/content/svg/content/src/crashtests/880544-4.svg b/content/svg/content/src/crashtests/880544-4.svg
new file mode 100644
index 000000000000..7bdb80f478a1
--- /dev/null
+++ b/content/svg/content/src/crashtests/880544-4.svg
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/content/svg/content/src/crashtests/880544-5.svg b/content/svg/content/src/crashtests/880544-5.svg
new file mode 100644
index 000000000000..ef7f468f8a28
--- /dev/null
+++ b/content/svg/content/src/crashtests/880544-5.svg
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/content/svg/content/src/crashtests/crashtests.list b/content/svg/content/src/crashtests/crashtests.list
index 18aee3a2a155..bbf1918e556d 100644
--- a/content/svg/content/src/crashtests/crashtests.list
+++ b/content/svg/content/src/crashtests/crashtests.list
@@ -66,3 +66,8 @@ load 831561.html
load 837450-1.svg
load 842463-1.html
load 864509.svg
+load 880544-1.svg
+load 880544-2.svg
+load 880544-3.svg
+load 880544-4.svg
+load 880544-5.svg
diff --git a/content/svg/content/src/nsSVGAngle.cpp b/content/svg/content/src/nsSVGAngle.cpp
index 29b5b5b4ac7e..621011fab864 100644
--- a/content/svg/content/src/nsSVGAngle.cpp
+++ b/content/svg/content/src/nsSVGAngle.cpp
@@ -379,6 +379,8 @@ nsSVGAngle::SMILOrient::ValueFromString(const nsAString& aStr,
nsSMILValue val(&SVGOrientSMILType::sSingleton);
if (aStr.EqualsLiteral("auto")) {
val.mU.mOrient.mOrientType = SVG_MARKER_ORIENT_AUTO;
+ } else if (aStr.EqualsLiteral("auto-start-reverse")) {
+ val.mU.mOrient.mOrientType = SVG_MARKER_ORIENT_AUTO_START_REVERSE;
} else {
float value;
uint16_t unitType;
@@ -426,7 +428,8 @@ nsSVGAngle::SMILOrient::SetAnimValue(const nsSMILValue& aValue)
if (aValue.mType == &SVGOrientSMILType::sSingleton) {
mOrientType->SetAnimValue(aValue.mU.mOrient.mOrientType);
- if (aValue.mU.mOrient.mOrientType == SVG_MARKER_ORIENT_AUTO) {
+ if (aValue.mU.mOrient.mOrientType == SVG_MARKER_ORIENT_AUTO ||
+ aValue.mU.mOrient.mOrientType == SVG_MARKER_ORIENT_AUTO_START_REVERSE) {
mAngle->SetAnimValue(0.0f, SVG_ANGLETYPE_UNSPECIFIED, mSVGElement);
} else {
mAngle->SetAnimValue(aValue.mU.mOrient.mAngle, aValue.mU.mOrient.mUnit, mSVGElement);
diff --git a/content/svg/content/src/nsSVGPathGeometryElement.h b/content/svg/content/src/nsSVGPathGeometryElement.h
index 88dd19100f7e..2773e6ebb757 100644
--- a/content/svg/content/src/nsSVGPathGeometryElement.h
+++ b/content/svg/content/src/nsSVGPathGeometryElement.h
@@ -12,9 +12,18 @@ struct gfxMatrix;
template class nsTArray;
struct nsSVGMark {
+ enum Type {
+ eStart,
+ eMid,
+ eEnd,
+
+ eTypeCount
+ };
+
float x, y, angle;
- nsSVGMark(float aX, float aY, float aAngle) :
- x(aX), y(aY), angle(aAngle) {}
+ Type type;
+ nsSVGMark(float aX, float aY, float aAngle, Type aType) :
+ x(aX), y(aY), angle(aAngle), type(aType) {}
};
class gfxContext;
diff --git a/content/svg/content/src/nsSVGPolyElement.cpp b/content/svg/content/src/nsSVGPolyElement.cpp
index 7692ebec69c9..fa43533d8b03 100644
--- a/content/svg/content/src/nsSVGPolyElement.cpp
+++ b/content/svg/content/src/nsSVGPolyElement.cpp
@@ -78,26 +78,32 @@ nsSVGPolyElement::GetMarkPoints(nsTArray *aMarks)
if (!points.Length())
return;
- float px = 0.0, py = 0.0, prevAngle = 0.0;
+ float px = points[0].mX, py = points[0].mY, prevAngle = 0.0;
- for (uint32_t i = 0; i < points.Length(); ++i) {
+ aMarks->AppendElement(nsSVGMark(px, py, 0, nsSVGMark::eStart));
+
+ for (uint32_t i = 1; i < points.Length(); ++i) {
float x = points[i].mX;
float y = points[i].mY;
float angle = atan2(y-py, x-px);
- if (i == 1)
- aMarks->ElementAt(aMarks->Length() - 1).angle = angle;
- else if (i > 1)
- aMarks->ElementAt(aMarks->Length() - 1).angle =
+
+ // Vertex marker.
+ if (i == 1) {
+ aMarks->ElementAt(0).angle = angle;
+ } else {
+ aMarks->ElementAt(aMarks->Length() - 2).angle =
SVGContentUtils::AngleBisect(prevAngle, angle);
+ }
- aMarks->AppendElement(nsSVGMark(x, y, 0));
+ aMarks->AppendElement(nsSVGMark(x, y, 0, nsSVGMark::eMid));
prevAngle = angle;
px = x;
py = y;
}
- aMarks->ElementAt(aMarks->Length() - 1).angle = prevAngle;
+ aMarks->LastElement().angle = prevAngle;
+ aMarks->LastElement().type = nsSVGMark::eEnd;
}
void
diff --git a/content/svg/content/test/test_dataTypes.html b/content/svg/content/test/test_dataTypes.html
index 73a69866ccf9..b40b7e45bf2c 100644
--- a/content/svg/content/test/test_dataTypes.html
+++ b/content/svg/content/test/test_dataTypes.html
@@ -169,6 +169,13 @@
marker.setAttribute("orient", "auto");
is(marker.getAttribute("orient"), "auto", "checking 'auto' string preserved");
+ is(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO, "type baseVal");
+ is(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO, "type animVal");
+
+ marker.setAttribute("orient", "auto-start-reverse");
+ is(marker.getAttribute("orient"), "auto-start-reverse", "checking 'auto-start-reverse' string preserved");
+ is(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN, "type baseVal");
+ is(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN, "type animVal");
marker.setAttribute("orient", "");
ok(marker.getAttribute("orient") === "", "empty angle attribute");
@@ -296,7 +303,11 @@
SimpleTest.finish();
}
-window.addEventListener("load", runTests, false);
+function runTestsWithPref() {
+ SpecialPowers.pushPrefEnv({ 'set': [['svg.marker-improvements.enabled', true]] }, runTests);
+}
+
+window.addEventListener("load", runTestsWithPref, false);
diff --git a/content/svg/document/src/Makefile.in b/content/svg/document/src/Makefile.in
index e6e3af8a80fd..3394da3e5a8c 100644
--- a/content/svg/document/src/Makefile.in
+++ b/content/svg/document/src/Makefile.in
@@ -13,9 +13,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/svg/document/src/SVGDocument.h b/content/svg/document/src/SVGDocument.h
index 72c8652be048..798da7fa9afc 100644
--- a/content/svg/document/src/SVGDocument.h
+++ b/content/svg/document/src/SVGDocument.h
@@ -14,7 +14,7 @@ class nsSVGElement;
namespace mozilla {
namespace dom {
-class SVGDocument : public XMLDocument
+class SVGDocument MOZ_FINAL : public XMLDocument
{
public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
diff --git a/content/xbl/src/Makefile.in b/content/xbl/src/Makefile.in
index 590e8a05537a..a636edfd6101 100644
--- a/content/xbl/src/Makefile.in
+++ b/content/xbl/src/Makefile.in
@@ -17,9 +17,6 @@ FAIL_ON_WARNINGS = 1
include $(topsrcdir)/config/config.mk
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
diff --git a/content/xml/content/src/CDATASection.h b/content/xml/content/src/CDATASection.h
index 7f5b22c02efb..6caabd0591ee 100644
--- a/content/xml/content/src/CDATASection.h
+++ b/content/xml/content/src/CDATASection.h
@@ -13,8 +13,8 @@
namespace mozilla {
namespace dom {
-class CDATASection : public Text,
- public nsIDOMCDATASection
+class CDATASection MOZ_FINAL : public Text,
+ public nsIDOMCDATASection
{
private:
void Init()
diff --git a/content/xml/content/src/Makefile.in b/content/xml/content/src/Makefile.in
index 3d666d408e22..644faeb48096 100644
--- a/content/xml/content/src/Makefile.in
+++ b/content/xml/content/src/Makefile.in
@@ -14,9 +14,6 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/xml/content/src/XMLStylesheetProcessingInstruction.h b/content/xml/content/src/XMLStylesheetProcessingInstruction.h
index 42c675c7b9ba..e65f9227162d 100644
--- a/content/xml/content/src/XMLStylesheetProcessingInstruction.h
+++ b/content/xml/content/src/XMLStylesheetProcessingInstruction.h
@@ -13,8 +13,9 @@
namespace mozilla {
namespace dom {
-class XMLStylesheetProcessingInstruction : public ProcessingInstruction,
- public nsStyleLinkElement
+class XMLStylesheetProcessingInstruction MOZ_FINAL
+: public ProcessingInstruction
+, public nsStyleLinkElement
{
public:
XMLStylesheetProcessingInstruction(already_AddRefed aNodeInfo,
diff --git a/content/xml/document/src/Makefile.in b/content/xml/document/src/Makefile.in
index e3df3b4b4eac..b3bbdd2bc085 100644
--- a/content/xml/document/src/Makefile.in
+++ b/content/xml/document/src/Makefile.in
@@ -14,9 +14,6 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
diff --git a/content/xslt/src/base/Makefile.in b/content/xslt/src/base/Makefile.in
index 4dd5624f7cb5..70ca9d5dd330 100644
--- a/content/xslt/src/base/Makefile.in
+++ b/content/xslt/src/base/Makefile.in
@@ -12,10 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/xslt/src/xml/Makefile.in b/content/xslt/src/xml/Makefile.in
index c47593c7b6ed..590169fc38c2 100644
--- a/content/xslt/src/xml/Makefile.in
+++ b/content/xslt/src/xml/Makefile.in
@@ -12,10 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/xslt/src/xpath/Makefile.in b/content/xslt/src/xpath/Makefile.in
index 5bce765a2d38..9c3cd97af495 100644
--- a/content/xslt/src/xpath/Makefile.in
+++ b/content/xslt/src/xpath/Makefile.in
@@ -12,10 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
INCLUDES += \
diff --git a/content/xslt/src/xslt/Makefile.in b/content/xslt/src/xslt/Makefile.in
index 531a1fc8a01e..1f2221c8ed4e 100644
--- a/content/xslt/src/xslt/Makefile.in
+++ b/content/xslt/src/xslt/Makefile.in
@@ -17,10 +17,6 @@ LOCAL_INCLUDES += \
-I$(topsrcdir)/dom/base \
$(NULL)
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
EXTRA_COMPONENTS = \
txEXSLTRegExFunctions.js \
txEXSLTRegExFunctions.manifest \
diff --git a/content/xul/content/src/Makefile.in b/content/xul/content/src/Makefile.in
index de815cef87e2..d2ddab7f9f9f 100644
--- a/content/xul/content/src/Makefile.in
+++ b/content/xul/content/src/Makefile.in
@@ -16,10 +16,6 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
endif
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h
index 8898b29322f0..789e603cc01e 100644
--- a/content/xul/content/src/nsXULElement.h
+++ b/content/xul/content/src/nsXULElement.h
@@ -350,8 +350,8 @@ ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 3);
class nsScriptEventHandlerOwnerTearoff;
-class nsXULElement : public nsStyledElement,
- public nsIDOMXULElement
+class nsXULElement MOZ_FINAL : public nsStyledElement,
+ public nsIDOMXULElement
{
public:
nsXULElement(already_AddRefed aNodeInfo);
diff --git a/content/xul/document/src/Makefile.in b/content/xul/document/src/Makefile.in
index 761994957d0e..227abf5788e1 100644
--- a/content/xul/document/src/Makefile.in
+++ b/content/xul/document/src/Makefile.in
@@ -13,10 +13,6 @@ include $(DEPTH)/config/autoconf.mk
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = -I$(srcdir)/../../../base/src \
diff --git a/content/xul/document/src/XULDocument.h b/content/xul/document/src/XULDocument.h
index f3648a08c8c7..e9c066757428 100644
--- a/content/xul/document/src/XULDocument.h
+++ b/content/xul/document/src/XULDocument.h
@@ -84,11 +84,11 @@ class nsRefMapEntry : public nsStringHashKey
namespace mozilla {
namespace dom {
-class XULDocument : public XMLDocument,
- public nsIXULDocument,
- public nsIDOMXULDocument,
- public nsIStreamLoaderObserver,
- public nsICSSLoaderObserver
+class XULDocument MOZ_FINAL : public XMLDocument,
+ public nsIXULDocument,
+ public nsIDOMXULDocument,
+ public nsIStreamLoaderObserver,
+ public nsICSSLoaderObserver
{
public:
XULDocument();
diff --git a/content/xul/templates/src/Makefile.in b/content/xul/templates/src/Makefile.in
index 0aa700892816..6cd559f6200e 100644
--- a/content/xul/templates/src/Makefile.in
+++ b/content/xul/templates/src/Makefile.in
@@ -13,9 +13,6 @@ include $(DEPTH)/config/autoconf.mk
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = -I$(srcdir)/../../../base/src \
diff --git a/docshell/base/Makefile.in b/docshell/base/Makefile.in
index a957271c20bb..62897d9c94ea 100644
--- a/docshell/base/Makefile.in
+++ b/docshell/base/Makefile.in
@@ -19,10 +19,6 @@ ifdef MOZ_TOOLKIT_SEARCH
DEFINES += -DMOZ_TOOLKIT_SEARCH
endif
-# we don't want the shared lib, but we want to force the creation of a
-# static lib.
-FORCE_STATIC_LIB = 1
-
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk
diff --git a/docshell/shistory/src/Makefile.in b/docshell/shistory/src/Makefile.in
index 2d2064519019..7fecb85a394d 100644
--- a/docshell/shistory/src/Makefile.in
+++ b/docshell/shistory/src/Makefile.in
@@ -11,7 +11,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MSVC_ENABLE_PGO := 1
-FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
diff --git a/dom/activities/src/Makefile.in b/dom/activities/src/Makefile.in
index 01407683640b..c648cc0abdd8 100644
--- a/dom/activities/src/Makefile.in
+++ b/dom/activities/src/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = dom_activities_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/alarm/Makefile.in b/dom/alarm/Makefile.in
index 021ab1f1cf01..8f11898d37b1 100644
--- a/dom/alarm/Makefile.in
+++ b/dom/alarm/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = domalarm_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/audiochannel/Makefile.in b/dom/audiochannel/Makefile.in
index 6c0f3452d23a..b60fbd5e9af9 100644
--- a/dom/audiochannel/Makefile.in
+++ b/dom/audiochannel/Makefile.in
@@ -21,7 +21,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = domaudiochannel_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
FAIL_ON_WARNINGS := 1
diff --git a/dom/base/DOMRequestHelper.jsm b/dom/base/DOMRequestHelper.jsm
index b1101af80343..69ad623c5df8 100644
--- a/dom/base/DOMRequestHelper.jsm
+++ b/dom/base/DOMRequestHelper.jsm
@@ -82,6 +82,12 @@ DOMRequestIpcHelperMessageListener.prototype = {
},
destroy: function() {
+ // DOMRequestIpcHelper.destroy() calls back into this function.
+ if (this._destroyed) {
+ return;
+ }
+ this._destroyed = true;
+
Services.obs.removeObserver(this, "inner-window-destroyed");
this._messages.forEach(function(msgName) {
diff --git a/dom/base/Makefile.in b/dom/base/Makefile.in
index 45b010324d00..398cc8671eb6 100644
--- a/dom/base/Makefile.in
+++ b/dom/base/Makefile.in
@@ -12,7 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = jsdombase_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
diff --git a/dom/battery/Makefile.in b/dom/battery/Makefile.in
index b93ed50009c9..5eb26d85fc4e 100644
--- a/dom/battery/Makefile.in
+++ b/dom/battery/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = dom_battery_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp
index f9a251cf3bdd..8d32901a653f 100644
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -1350,7 +1350,7 @@ GetXrayExpandoChain(JSObject* obj)
JS::Value v;
if (IsDOMClass(clasp) || IsDOMIfaceAndProtoClass(clasp)) {
v = js::GetReservedSlot(obj, DOM_XRAY_EXPANDO_SLOT);
- } else if (js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) {
+ } else if (js::IsProxyClass(clasp)) {
MOZ_ASSERT(js::GetProxyHandler(obj)->family() == ProxyFamily());
v = js::GetProxyExtra(obj, JSPROXYSLOT_XRAY_EXPANDO);
} else {
@@ -1367,7 +1367,7 @@ SetXrayExpandoChain(JSObject* obj, JSObject* chain)
js::Class* clasp = js::GetObjectClass(obj);
if (IsDOMClass(clasp) || IsDOMIfaceAndProtoClass(clasp)) {
js::SetReservedSlot(obj, DOM_XRAY_EXPANDO_SLOT, v);
- } else if (js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) {
+ } else if (js::IsProxyClass(clasp)) {
MOZ_ASSERT(js::GetProxyHandler(obj)->family() == ProxyFamily());
js::SetProxyExtra(obj, JSPROXYSLOT_XRAY_EXPANDO, v);
} else {
diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h
index 33b06c59abec..e0a21134072c 100644
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -128,8 +128,8 @@ IsDOMIfaceAndProtoClass(const js::Class* clasp)
return IsDOMIfaceAndProtoClass(Jsvalify(clasp));
}
-MOZ_STATIC_ASSERT(DOM_OBJECT_SLOT == js::JSSLOT_PROXY_PRIVATE,
- "JSSLOT_PROXY_PRIVATE doesn't match DOM_OBJECT_SLOT. "
+MOZ_STATIC_ASSERT(DOM_OBJECT_SLOT == js::PROXY_PRIVATE_SLOT,
+ "js::PROXY_PRIVATE_SLOT doesn't match DOM_OBJECT_SLOT. "
"Expect bad things");
template
inline T*
@@ -150,7 +150,7 @@ GetDOMClass(JSObject* obj)
return &DOMJSClass::FromJSClass(clasp)->mClass;
}
- if (js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) {
+ if (js::IsProxyClass(clasp)) {
js::BaseProxyHandler* handler = js::GetProxyHandler(obj);
if (handler->family() == ProxyFamily()) {
return &static_cast(handler)->mClass;
diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf
index 132cda6af2d5..dcb8488af4c9 100644
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -406,10 +406,6 @@ DOMInterfaces = {
'nativeType': 'nsDOMFocusEvent',
},
-'Future': {
- 'implicitJSContext': [ 'constructor' ]
-},
-
'GainNode': {
'resultNotAddRefed': [ 'gain' ],
},
@@ -813,6 +809,10 @@ DOMInterfaces = {
'headerFile': 'nsGeolocation.h'
},
+'Promise': {
+ 'implicitJSContext': [ 'constructor' ]
+},
+
'PropertyNodeList': {
'headerFile': 'HTMLPropertiesCollection.h',
'resultNotAddRefed': [ 'item' ]
@@ -933,8 +933,7 @@ DOMInterfaces = {
'SVGLengthList': {
'nativeType': 'mozilla::DOMSVGLengthList',
- 'headerFile': 'DOMSVGLengthList.h',
- 'resultNotAddRefed': [ 'getItem' ]
+ 'headerFile': 'DOMSVGLengthList.h'
},
'SVGLinearGradientElement': {
@@ -947,8 +946,7 @@ DOMInterfaces = {
'SVGNumberList': {
'nativeType': 'mozilla::DOMSVGNumberList',
- 'headerFile': 'DOMSVGNumberList.h',
- 'resultNotAddRefed': [ 'getItem' ]
+ 'headerFile': 'DOMSVGNumberList.h'
},
'SVGPathSeg': {
@@ -1054,8 +1052,7 @@ DOMInterfaces = {
'SVGPathSegList': {
'nativeType': 'mozilla::DOMSVGPathSegList',
- 'headerFile': 'DOMSVGPathSegList.h',
- 'resultNotAddRefed': [ 'getItem' ]
+ 'headerFile': 'DOMSVGPathSegList.h'
},
'SVGPoint': {
@@ -1065,8 +1062,7 @@ DOMInterfaces = {
'SVGPointList': {
'nativeType': 'mozilla::DOMSVGPointList',
- 'headerFile': 'DOMSVGPointList.h',
- 'resultNotAddRefed': [ 'getItem' ]
+ 'headerFile': 'DOMSVGPointList.h'
},
'SVGPreserveAspectRatio': {
@@ -1097,8 +1093,7 @@ DOMInterfaces = {
'SVGTransformList': {
'nativeType': 'mozilla::DOMSVGTransformList',
- 'headerFile': 'DOMSVGTransformList.h',
- 'resultNotAddRefed': [ 'getItem' ]
+ 'headerFile': 'DOMSVGTransformList.h'
},
'SVGStringList': {
diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp
index 9988398c9ed9..5c356f338b74 100644
--- a/dom/bindings/DOMJSProxyHandler.cpp
+++ b/dom/bindings/DOMJSProxyHandler.cpp
@@ -63,7 +63,7 @@ struct SetDOMProxyInformation
{
SetDOMProxyInformation() {
js::SetDOMProxyInformation((void*) &HandlerFamily,
- js::JSSLOT_PROXY_EXTRA + JSPROXYSLOT_EXPANDO, DOMProxyShadows);
+ js::PROXY_EXTRA_SLOT + JSPROXYSLOT_EXPANDO, DOMProxyShadows);
}
};
diff --git a/dom/bindings/DOMJSProxyHandler.h b/dom/bindings/DOMJSProxyHandler.h
index 8d52ee468d89..c329a1cb090c 100644
--- a/dom/bindings/DOMJSProxyHandler.h
+++ b/dom/bindings/DOMJSProxyHandler.h
@@ -15,7 +15,7 @@
#include "xpcpublic.h"
#include "nsStringGlue.h"
-#define DOM_PROXY_OBJECT_SLOT js::JSSLOT_PROXY_PRIVATE
+#define DOM_PROXY_OBJECT_SLOT js::PROXY_PRIVATE_SLOT
namespace mozilla {
namespace dom {
diff --git a/dom/bindings/Makefile.in b/dom/bindings/Makefile.in
index f4a52313866f..1edd2a5d7548 100644
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -10,7 +10,6 @@ VPATH = @srcdir@
LIBRARY_NAME = dombindings_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
FAIL_ON_WARNINGS := 1
diff --git a/dom/bindings/test/Makefile.in b/dom/bindings/test/Makefile.in
index 2aacb59de809..1578f70ed8d0 100644
--- a/dom/bindings/test/Makefile.in
+++ b/dom/bindings/test/Makefile.in
@@ -10,7 +10,6 @@ relativesrcdir = @relativesrcdir@
LIBRARY_NAME = dombindings_test_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
# Do NOT export this library. We don't actually want our test code
# being added to libxul or anything.
diff --git a/dom/bluetooth/Makefile.in b/dom/bluetooth/Makefile.in
index 3d9645d44bb2..dd16996fea6d 100644
--- a/dom/bluetooth/Makefile.in
+++ b/dom/bluetooth/Makefile.in
@@ -27,7 +27,6 @@ ifneq (,$(MOZ_B2G_BT))
LIBRARY_NAME = dombluetooth_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
VPATH += \
diff --git a/dom/browser-element/Makefile.in b/dom/browser-element/Makefile.in
index 3c60ddfd8499..de8b43ae10cb 100644
--- a/dom/browser-element/Makefile.in
+++ b/dom/browser-element/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = dom_browserelement_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/camera/Makefile.in b/dom/camera/Makefile.in
index b48832cc5359..85644a299838 100644
--- a/dom/camera/Makefile.in
+++ b/dom/camera/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = domcamera_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/cellbroadcast/src/Makefile.in b/dom/cellbroadcast/src/Makefile.in
index e63dece92a67..658a2a1fef5a 100644
--- a/dom/cellbroadcast/src/Makefile.in
+++ b/dom/cellbroadcast/src/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = dom_cellbroadcast_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/devicestorage/Makefile.in b/dom/devicestorage/Makefile.in
index 8b9d6d345fd7..d2f76809a309 100644
--- a/dom/devicestorage/Makefile.in
+++ b/dom/devicestorage/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = domdevicestorage_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/encoding/Makefile.in b/dom/encoding/Makefile.in
index b9c542d8618d..8d624d68d205 100644
--- a/dom/encoding/Makefile.in
+++ b/dom/encoding/Makefile.in
@@ -12,7 +12,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = domencoding_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
LOCAL_INCLUDES = \
-I$(topsrcdir)/intl/locale/src \
diff --git a/dom/file/Makefile.in b/dom/file/Makefile.in
index e67d175fa93b..2e7f112a29b7 100644
--- a/dom/file/Makefile.in
+++ b/dom/file/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = domfile_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/fm/Makefile.in b/dom/fm/Makefile.in
index c7f1c00b84e0..99fe83fbcd01 100644
--- a/dom/fm/Makefile.in
+++ b/dom/fm/Makefile.in
@@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = domfm_s
LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
include $(topsrcdir)/dom/dom-config.mk
diff --git a/dom/future/FutureCallback.cpp b/dom/future/FutureCallback.cpp
deleted file mode 100644
index 2fd81f5efb56..000000000000
--- a/dom/future/FutureCallback.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=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/. */
-
-#include "FutureCallback.h"
-#include "mozilla/dom/Future.h"
-#include "mozilla/dom/FutureResolver.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FutureCallback)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FutureCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FutureCallback)
- NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FutureCallback)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FutureCallback)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-FutureCallback::FutureCallback()
-{
- MOZ_COUNT_CTOR(FutureCallback);
-}
-
-FutureCallback::~FutureCallback()
-{
- MOZ_COUNT_DTOR(FutureCallback);
-}
-
-static void
-EnterCompartment(Maybe& aAc, JSContext* aCx,
- const Optional >& aValue)
-{
- // FIXME Bug 878849
- if (aValue.WasPassed() && aValue.Value().isObject()) {
- JS::Rooted rooted(aCx, &aValue.Value().toObject());
- aAc.construct(aCx, rooted);
- }
-}
-
-// ResolveFutureCallback
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED_1(ResolveFutureCallback,
- FutureCallback,
- mResolver)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ResolveFutureCallback)
-NS_INTERFACE_MAP_END_INHERITING(FutureCallback)
-
-NS_IMPL_ADDREF_INHERITED(ResolveFutureCallback, FutureCallback)
-NS_IMPL_RELEASE_INHERITED(ResolveFutureCallback, FutureCallback)
-
-ResolveFutureCallback::ResolveFutureCallback(FutureResolver* aResolver)
- : mResolver(aResolver)
-{
- MOZ_ASSERT(aResolver);
- MOZ_COUNT_CTOR(ResolveFutureCallback);
-}
-
-ResolveFutureCallback::~ResolveFutureCallback()
-{
- MOZ_COUNT_DTOR(ResolveFutureCallback);
-}
-
-void
-ResolveFutureCallback::Call(const Optional >& aValue)
-{
- // Run resolver's algorithm with value and the synchronous flag set.
- AutoJSContext cx;
- Maybe ac;
- EnterCompartment(ac, cx, aValue);
-
- mResolver->ResolveInternal(cx, aValue, FutureResolver::SyncTask);
-}
-
-// RejectFutureCallback
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED_1(RejectFutureCallback,
- FutureCallback,
- mResolver)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(RejectFutureCallback)
-NS_INTERFACE_MAP_END_INHERITING(FutureCallback)
-
-NS_IMPL_ADDREF_INHERITED(RejectFutureCallback, FutureCallback)
-NS_IMPL_RELEASE_INHERITED(RejectFutureCallback, FutureCallback)
-
-RejectFutureCallback::RejectFutureCallback(FutureResolver* aResolver)
- : mResolver(aResolver)
-{
- MOZ_ASSERT(aResolver);
- MOZ_COUNT_CTOR(RejectFutureCallback);
-}
-
-RejectFutureCallback::~RejectFutureCallback()
-{
- MOZ_COUNT_DTOR(RejectFutureCallback);
-}
-
-void
-RejectFutureCallback::Call(const Optional >& aValue)
-{
- // Run resolver's algorithm with value and the synchronous flag set.
- AutoJSContext cx;
- Maybe ac;
- EnterCompartment(ac, cx, aValue);
-
- mResolver->RejectInternal(cx, aValue, FutureResolver::SyncTask);
-}
-
-// WrapperFutureCallback
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED_2(WrapperFutureCallback,
- FutureCallback,
- mNextResolver, mCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(WrapperFutureCallback)
-NS_INTERFACE_MAP_END_INHERITING(FutureCallback)
-
-NS_IMPL_ADDREF_INHERITED(WrapperFutureCallback, FutureCallback)
-NS_IMPL_RELEASE_INHERITED(WrapperFutureCallback, FutureCallback)
-
-WrapperFutureCallback::WrapperFutureCallback(FutureResolver* aNextResolver,
- AnyCallback* aCallback)
- : mNextResolver(aNextResolver)
- , mCallback(aCallback)
-{
- MOZ_ASSERT(aNextResolver);
- MOZ_COUNT_CTOR(WrapperFutureCallback);
-}
-
-WrapperFutureCallback::~WrapperFutureCallback()
-{
- MOZ_COUNT_DTOR(WrapperFutureCallback);
-}
-
-void
-WrapperFutureCallback::Call(const Optional >& aValue)
-{
- AutoJSContext cx;
- Maybe ac;
- EnterCompartment(ac, cx, aValue);
-
- ErrorResult rv;
-
- // If invoking callback threw an exception, run resolver's reject with the
- // thrown exception as argument and the synchronous flag set.
- Optional > value(cx,
- mCallback->Call(mNextResolver->GetParentObject(), aValue, rv,
- CallbackObject::eRethrowExceptions));
-
- rv.WouldReportJSException();
-
- if (rv.Failed() && rv.IsJSException()) {
- Optional > value(cx);
- rv.StealJSException(cx, &value.Value());
-
- Maybe ac2;
- EnterCompartment(ac2, cx, value);
- mNextResolver->RejectInternal(cx, value, FutureResolver::SyncTask);
- return;
- }
-
- // Otherwise, run resolver's resolve with value and the synchronous flag
- // set.
- Maybe ac2;
- EnterCompartment(ac2, cx, value);
- mNextResolver->ResolveInternal(cx, value, FutureResolver::SyncTask);
-}
-
-// SimpleWrapperFutureCallback
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED_2(SimpleWrapperFutureCallback,
- FutureCallback,
- mFuture, mCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(SimpleWrapperFutureCallback)
-NS_INTERFACE_MAP_END_INHERITING(FutureCallback)
-
-NS_IMPL_ADDREF_INHERITED(SimpleWrapperFutureCallback, FutureCallback)
-NS_IMPL_RELEASE_INHERITED(SimpleWrapperFutureCallback, FutureCallback)
-
-SimpleWrapperFutureCallback::SimpleWrapperFutureCallback(Future* aFuture,
- AnyCallback* aCallback)
- : mFuture(aFuture)
- , mCallback(aCallback)
-{
- MOZ_ASSERT(aFuture);
- MOZ_COUNT_CTOR(SimpleWrapperFutureCallback);
-}
-
-SimpleWrapperFutureCallback::~SimpleWrapperFutureCallback()
-{
- MOZ_COUNT_DTOR(SimpleWrapperFutureCallback);
-}
-
-void
-SimpleWrapperFutureCallback::Call(const Optional >& aValue)
-{
- ErrorResult rv;
- mCallback->Call(mFuture, aValue, rv);
-}
-
-/* static */ FutureCallback*
-FutureCallback::Factory(FutureResolver* aNextResolver,
- AnyCallback* aCallback, Task aTask)
-{
- MOZ_ASSERT(aNextResolver);
-
- // If we have a callback and a next resolver, we have to exec the callback and
- // then propagate the return value to the next resolver->resolve().
- if (aCallback) {
- return new WrapperFutureCallback(aNextResolver, aCallback);
- }
-
- if (aTask == Resolve) {
- return new ResolveFutureCallback(aNextResolver);
- }
-
- if (aTask == Reject) {
- return new RejectFutureCallback(aNextResolver);
- }
-
- MOZ_ASSERT(false, "This should not happen");
- return nullptr;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/future/FutureCallback.h b/dom/future/FutureCallback.h
deleted file mode 100644
index cd823ae64ad5..000000000000
--- a/dom/future/FutureCallback.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=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 mozilla_dom_FutureCallback_h
-#define mozilla_dom_FutureCallback_h
-
-#include "mozilla/dom/Future.h"
-#include "nsCycleCollectionParticipant.h"
-
-namespace mozilla {
-namespace dom {
-
-class FutureResolver;
-
-// This is the base class for any FutureCallback.
-// It's a logical step in the future chain of callbacks.
-class FutureCallback : public nsISupports
-{
-public:
- NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_CLASS(FutureCallback)
-
- FutureCallback();
- virtual ~FutureCallback();
-
- virtual void Call(const Optional >& aValue) = 0;
-
- enum Task {
- Resolve,
- Reject
- };
-
- // This factory returns a FutureCallback object with refcount of 0.
- static FutureCallback*
- Factory(FutureResolver* aNextResolver, AnyCallback* aCallback,
- Task aTask);
-};
-
-// WrapperFutureCallback execs a JS Callback with a value, and then the return
-// value is sent to the aNextResolver->resolve() or to aNextResolver->Reject()
-// if the JS Callback throws.
-class WrapperFutureCallback MOZ_FINAL : public FutureCallback
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(WrapperFutureCallback,
- FutureCallback)
-
- void Call(const Optional >& aValue) MOZ_OVERRIDE;
-
- WrapperFutureCallback(FutureResolver* aNextResolver,
- AnyCallback* aCallback);
- ~WrapperFutureCallback();
-
-private:
- nsRefPtr mNextResolver;
- nsRefPtr mCallback;
-};
-
-// SimpleWrapperFutureCallback execs a JS Callback with a value.
-class SimpleWrapperFutureCallback MOZ_FINAL : public FutureCallback
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SimpleWrapperFutureCallback,
- FutureCallback)
-
- void Call(const Optional >& aValue) MOZ_OVERRIDE;
-
- SimpleWrapperFutureCallback(Future* aFuture,
- AnyCallback* aCallback);
- ~SimpleWrapperFutureCallback();
-
-private:
- nsRefPtr mFuture;
- nsRefPtr mCallback;
-};
-
-// ResolveFutureCallback calls aResolver->Resolve() with the value received by
-// Call().
-class ResolveFutureCallback MOZ_FINAL : public FutureCallback
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ResolveFutureCallback,
- FutureCallback)
-
- void Call(const Optional >& aValue) MOZ_OVERRIDE;
-
- ResolveFutureCallback(FutureResolver* aResolver);
- ~ResolveFutureCallback();
-
-private:
- nsRefPtr mResolver;
-};
-
-// RejectFutureCallback calls aResolver->Reject() with the value received by
-// Call().
-class RejectFutureCallback MOZ_FINAL : public FutureCallback
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RejectFutureCallback,
- FutureCallback)
-
- void Call(const Optional >& aValue) MOZ_OVERRIDE;
-
- RejectFutureCallback(FutureResolver* aResolver);
- ~RejectFutureCallback();
-
-private:
- nsRefPtr mResolver;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FutureCallback_h
diff --git a/dom/future/FutureResolver.cpp b/dom/future/FutureResolver.cpp
deleted file mode 100644
index 64e79a67b91c..000000000000
--- a/dom/future/FutureResolver.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=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/. */
-
-#include "mozilla/dom/FutureResolver.h"
-#include "mozilla/dom/FutureBinding.h"
-#include "mozilla/dom/Future.h"
-#include "FutureCallback.h"
-
-namespace mozilla {
-namespace dom {
-
-// FutureResolverTask
-
-// This class processes the future's callbacks with future's result.
-class FutureResolverTask MOZ_FINAL : public nsRunnable
-{
-public:
- FutureResolverTask(FutureResolver* aResolver,
- const JS::Handle aValue,
- Future::FutureState aState)
- : mResolver(aResolver)
- , mValue(aValue)
- , mState(aState)
- {
- MOZ_ASSERT(aResolver);
- MOZ_ASSERT(mState != Future::Pending);
- MOZ_COUNT_CTOR(FutureResolverTask);
-
- JSContext* cx = nsContentUtils::GetSafeJSContext();
- JS_AddNamedValueRootRT(JS_GetRuntime(cx), &mValue,
- "FutureResolverTask.mValue");
- }
-
- ~FutureResolverTask()
- {
- MOZ_COUNT_DTOR(FutureResolverTask);
-
- JSContext* cx = nsContentUtils::GetSafeJSContext();
- JS_RemoveValueRootRT(JS_GetRuntime(cx), &mValue);
- }
-
- NS_IMETHOD Run()
- {
- mResolver->RunTask(JS::Handle::fromMarkedLocation(&mValue),
- mState, FutureResolver::SyncTask);
- return NS_OK;
- }
-
-private:
- nsRefPtr mResolver;
- JS::Value mValue;
- Future::FutureState mState;
-};
-
-// FutureResolver
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(FutureResolver, mFuture)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FutureResolver)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FutureResolver)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FutureResolver)
- NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
- NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-FutureResolver::FutureResolver(Future* aFuture)
- : mFuture(aFuture)
- , mResolvePending(false)
-{
- SetIsDOMBinding();
-}
-
-JSObject*
-FutureResolver::WrapObject(JSContext* aCx, JS::Handle aScope)
-{
- return FutureResolverBinding::Wrap(aCx, aScope, this);
-}
-
-void
-FutureResolver::Resolve(JSContext* aCx,
- const Optional >& aValue,
- FutureTaskSync aAsynchronous)
-{
- if (mResolvePending) {
- return;
- }
-
- ResolveInternal(aCx, aValue, aAsynchronous);
-}
-
-void
-FutureResolver::ResolveInternal(JSContext* aCx,
- const Optional >& aValue,
- FutureTaskSync aAsynchronous)
-{
- mResolvePending = true;
-
- // TODO: Bug 879245 - Then-able objects
- if (aValue.WasPassed() && aValue.Value().isObject()) {
- JS::Rooted valueObj(aCx, &aValue.Value().toObject());
- Future* nextFuture;
- nsresult rv = UnwrapObject(aCx, valueObj, nextFuture);
-
- if (NS_SUCCEEDED(rv)) {
- nsRefPtr resolveCb = new ResolveFutureCallback(this);
- nsRefPtr rejectCb = new RejectFutureCallback(this);
- nextFuture->AppendCallbacks(resolveCb, rejectCb);
- return;
- }
- }
-
- // If the synchronous flag is set, process future's resolve callbacks with
- // value. Otherwise, the synchronous flag is unset, queue a task to process
- // future's resolve callbacks with value. Otherwise, the synchronous flag is
- // unset, queue a task to process future's resolve callbacks with value.
- RunTask(aValue.WasPassed() ? aValue.Value() : JS::UndefinedHandleValue,
- Future::Resolved, aAsynchronous);
-}
-
-void
-FutureResolver::Reject(JSContext* aCx,
- const Optional >& aValue,
- FutureTaskSync aAsynchronous)
-{
- if (mResolvePending) {
- return;
- }
-
- RejectInternal(aCx, aValue, aAsynchronous);
-}
-
-void
-FutureResolver::RejectInternal(JSContext* aCx,
- const Optional >& aValue,
- FutureTaskSync aAsynchronous)
-{
- mResolvePending = true;
-
- // If the synchronous flag is set, process future's reject callbacks with
- // value. Otherwise, the synchronous flag is unset, queue a task to process
- // future's reject callbacks with value.
- RunTask(aValue.WasPassed() ? aValue.Value() : JS::UndefinedHandleValue,
- Future::Rejected, aAsynchronous);
-}
-
-void
-FutureResolver::RunTask(JS::Handle