diff --git a/Makefile.in b/Makefile.in
index 078ac34edf90..66da95c0b1de 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -218,7 +218,6 @@ MAKE_SYM_STORE_ARGS += --install-manifest=$(DEPTH)/_build_manifests/install/dist
SYM_STORE_SOURCE_DIRS := $(topsrcdir)
-ifndef JS_STANDALONE
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
ifdef MOZ_SYMBOLS_EXTRA_BUILDID
@@ -261,7 +260,6 @@ ifdef SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE
else
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
endif
-endif
# MOZ_SOURCE_STAMP is defined in package-name.mk with a deferred assignment.
# exporting it makes make run its $(shell) command for each invoked submake,
diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml
index 2e8eb1772986..7a985f808c23 100644
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml
index 6d3a777a6b53..3f498c2b7547 100644
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 843ffd458fe1..d6ac976e0c1d 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 7d85b5ab452a..552af1c445a7 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index cfc151effcac..bbdeb62b2376 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml
index 0657c914e349..5813adda4b64 100644
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 843ffd458fe1..d6ac976e0c1d 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml
index 80e55b7582e7..4aa3349c02f1 100644
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 0eed58ed1ce6..d49718b799b3 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
{
"git": {
- "git_revision": "9f665863ea9c3dd9585905ef002e8fa06713d820",
+ "git_revision": "ce8365a8d3867bc0661a1627aaa2cda51d1f7c05",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
- "revision": "9f635ea7f4ca6be790a3912220fbcd5da25cbefa",
+ "revision": "3bdee71faf41c858d77aeb084e5ca6cccaef349b",
"repo_path": "integration/gaia-central"
}
diff --git a/b2g/config/nexus-4-kk/sources.xml b/b2g/config/nexus-4-kk/sources.xml
index 3dd540405439..8b3747bf22de 100644
--- a/b2g/config/nexus-4-kk/sources.xml
+++ b/b2g/config/nexus-4-kk/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index ac7dcd683da5..71b618c6ad6b 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml
index 509c736bdb9d..1ee03fdfef61 100644
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/gaia/Makefile.in b/b2g/gaia/Makefile.in
index 2ba440f46c8a..99925c930aed 100644
--- a/b2g/gaia/Makefile.in
+++ b/b2g/gaia/Makefile.in
@@ -19,4 +19,4 @@ include $(topsrcdir)/config/rules.mk
libs::
+$(MAKE) -j1 -C $(GAIADIR) clean
+$(GAIA_OPTIONS) $(MAKE) -j1 -C $(GAIADIR) profile
- (cd $(GAIADIR)/profile && tar $(TAR_CREATE_FLAGS) - .) | (cd $(abspath $(DIST))/bin/$(GAIA_PATH) && tar -xf -)
+ (cd $(GAIADIR)/profile && tar $(TAR_CREATE_FLAGS) - .) | (cd $(ABS_DIST)/bin/$(GAIA_PATH) && tar -xf -)
diff --git a/b2g/locales/Makefile.in b/b2g/locales/Makefile.in
index dd8df0382805..577ee30875b9 100644
--- a/b2g/locales/Makefile.in
+++ b/b2g/locales/Makefile.in
@@ -19,8 +19,8 @@ PWD := $(CURDIR)
# pulls. You may override them if you provide your own files. You _must_
# override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
# work in that case.
-ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
-WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
+ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
+WIN32_INSTALLER_IN ?= $(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
RETRIEVE_WINDOWS_INSTALLER = 1
MOZ_LANGPACK_EID=langpack-$(AB_CD)@b2g.mozilla.org
@@ -31,9 +31,9 @@ L10N_PREF_JS_EXPORTS_FLAGS = $(PREF_PPFLAGS) --silence-missing-directive-warning
PP_TARGETS += L10N_PREF_JS_EXPORTS
ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
-MOZ_PKG_MAC_DSSTORE=$(_ABS_DIST)/branding/dsstore
-MOZ_PKG_MAC_BACKGROUND=$(_ABS_DIST)/branding/background.png
-MOZ_PKG_MAC_ICON=$(_ABS_DIST)/branding/disk.icns
+MOZ_PKG_MAC_DSSTORE=$(ABS_DIST)/branding/dsstore
+MOZ_PKG_MAC_BACKGROUND=$(ABS_DIST)/branding/background.png
+MOZ_PKG_MAC_ICON=$(ABS_DIST)/branding/disk.icns
MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
endif
@@ -41,8 +41,8 @@ ifeq (WINNT,$(OS_ARCH))
UNINSTALLER_PACKAGE_HOOK = $(RM) -r $(STAGEDIST)/uninstall; \
$(NSINSTALL) -D $(STAGEDIST)/uninstall; \
cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall; \
- $(RM) $(_ABS_DIST)/l10n-stage/setup.exe; \
- cp ../installer/windows/l10ngen/setup.exe $(_ABS_DIST)/l10n-stage; \
+ $(RM) $(ABS_DIST)/l10n-stage/setup.exe; \
+ cp ../installer/windows/l10ngen/setup.exe $(ABS_DIST)/l10n-stage; \
$(NULL)
endif
@@ -57,7 +57,7 @@ $(DIST)/branding:
libs::
@if test -f '$(LOCALE_SRCDIR)/existing-profile-defaults.js'; then \
- $(PYTHON) -m mozbuild.action.preprocessor $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) \
+ $(PYTHON) -m mozbuild.action.preprocessor $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) \
$(LOCALE_SRCDIR)/existing-profile-defaults.js -o $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
fi
@@ -75,7 +75,7 @@ chrome-%:
@$(MAKE) chrome AB_CD=$*
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
-repackage-win32-installer: WIN32_INSTALLER_OUT=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
+repackage-win32-installer: WIN32_INSTALLER_OUT=$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
repackage-win32-installer: $(call ESCAPE_SPACE,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES) libs-$(AB_CD)
@echo 'Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT).'
$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
diff --git a/browser/base/content/test/general/browser_audioTabIcon.js b/browser/base/content/test/general/browser_audioTabIcon.js
index 707e5a5b3c23..0eb55aa58dc8 100644
--- a/browser/base/content/test/general/browser_audioTabIcon.js
+++ b/browser/base/content/test/general/browser_audioTabIcon.js
@@ -181,22 +181,56 @@ function* test_playing_icon_on_tab(tab, browser, isPinned) {
yield test_muting_using_menu(tab, true);
}
-function* test_swapped_browser(oldTab, newBrowser, isPlaying) {
+function* test_swapped_browser_while_playing(oldTab, newBrowser) {
ok(oldTab.hasAttribute("muted"), "Expected the correct muted attribute on the old tab");
- is(oldTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the old tab");
+ ok(oldTab.hasAttribute("soundplaying"), "Expected the correct soundplaying attribute on the old tab");
let newTab = gBrowser.getTabForBrowser(newBrowser);
let AttrChangePromise = BrowserTestUtils.waitForEvent(newTab, "TabAttrModified", false, event => {
- return (event.detail.changed.indexOf("soundplaying") >= 0 || !isPlaying) &&
+ return event.detail.changed.indexOf("soundplaying") >= 0 &&
event.detail.changed.indexOf("muted") >= 0;
});
+
+ gBrowser.swapBrowsersAndCloseOther(newTab, oldTab);
+ yield AttrChangePromise;
+
+ ok(newTab.hasAttribute("muted"), "Expected the correct muted attribute on the new tab");
+ ok(newTab.hasAttribute("soundplaying"), "Expected the correct soundplaying attribute on the new tab");
+
+ let receivedSoundPlaying = 0;
+ // We need to receive two TabAttrModified events with 'soundplaying'
+ // because swapBrowsersAndCloseOther involves nsDocument::OnPageHide and
+ // nsDocument::OnPageShow. Each methods lead to TabAttrModified event.
+ yield BrowserTestUtils.waitForEvent(newTab, "TabAttrModified", false, event => {
+ if (event.detail.changed.indexOf("soundplaying") >= 0) {
+ return (++receivedSoundPlaying == 2);
+ }
+ });
+
+ ok(newTab.hasAttribute("muted"), "Expected the correct muted attribute on the new tab");
+ ok(newTab.hasAttribute("soundplaying"), "Expected the correct soundplaying attribute on the new tab");
+
+ let icon = document.getAnonymousElementByAttribute(newTab, "anonid",
+ "soundplaying-icon");
+ yield test_tooltip(icon, "Unmute tab", true);
+}
+
+function* test_swapped_browser_while_not_playing(oldTab, newBrowser) {
+ ok(oldTab.hasAttribute("muted"), "Expected the correct muted attribute on the old tab");
+ ok(!oldTab.hasAttribute("soundplaying"), "Expected the correct soundplaying attribute on the old tab");
+
+ let newTab = gBrowser.getTabForBrowser(newBrowser);
+ let AttrChangePromise = BrowserTestUtils.waitForEvent(newTab, "TabAttrModified", false, event => {
+ return event.detail.changed.indexOf("muted") >= 0;
+ });
+
let AudioPlaybackPromise = new Promise(resolve => {
let observer = (subject, topic, data) => {
- ok(true, "Should see an audio-playback notification");
+ ok(false, "Should not see an audio-playback notification");
};
- Services.obs.addObserver(observer, "audio-playback", false);
+ Services.obs.addObserver(observer, "audiochannel-activity-normal", false);
setTimeout(() => {
- Services.obs.removeObserver(observer, "audio-playback");
+ Services.obs.removeObserver(observer, "audiochannel-activity-normal");
resolve();
}, 100);
});
@@ -205,13 +239,13 @@ function* test_swapped_browser(oldTab, newBrowser, isPlaying) {
yield AttrChangePromise;
ok(newTab.hasAttribute("muted"), "Expected the correct muted attribute on the new tab");
- is(newTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the new tab");
+ ok(!newTab.hasAttribute("soundplaying"), "Expected the correct soundplaying attribute on the new tab");
// Wait to see if an audio-playback event is dispatched.
yield AudioPlaybackPromise;
ok(newTab.hasAttribute("muted"), "Expected the correct muted attribute on the new tab");
- is(newTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the new tab");
+ ok(!newTab.hasAttribute("soundplaying"), "Expected the correct soundplaying attribute on the new tab");
let icon = document.getAnonymousElementByAttribute(newTab, "anonid",
"soundplaying-icon");
@@ -230,7 +264,7 @@ function* test_browser_swapping(tab, browser) {
gBrowser,
url: "about:blank",
}, function*(newBrowser) {
- yield test_swapped_browser(tab, newBrowser, true)
+ yield test_swapped_browser_while_playing(tab, newBrowser)
// Now, test swapping with a muted but not playing tab.
// Note that the tab remains muted, so we only need to pause playback.
@@ -240,7 +274,7 @@ function* test_browser_swapping(tab, browser) {
yield BrowserTestUtils.withNewTab({
gBrowser,
url: "about:blank",
- }, newBrowser => test_swapped_browser(tab, newBrowser, false));
+ }, newBrowser => test_swapped_browser_while_not_playing(tab, newBrowser));
});
}
diff --git a/browser/base/content/test/general/browser_bug575561.js b/browser/base/content/test/general/browser_bug575561.js
index 7f85dd822d2e..cd8615a5681f 100644
--- a/browser/base/content/test/general/browser_bug575561.js
+++ b/browser/base/content/test/general/browser_bug575561.js
@@ -1,3 +1,5 @@
+requestLongerTimeout(2);
+
const TEST_URL = "http://example.com/browser/browser/base/content/test/general/app_bug575561.html";
add_task(function*() {
diff --git a/browser/base/content/test/general/browser_bug676619.js b/browser/base/content/test/general/browser_bug676619.js
index 9dd00912232f..ef8f2b10af49 100644
--- a/browser/base/content/test/general/browser_bug676619.js
+++ b/browser/base/content/test/general/browser_bug676619.js
@@ -1,5 +1,5 @@
function test () {
- requestLongerTimeout(2);
+ requestLongerTimeout(3);
waitForExplicitFinish();
var isHTTPS = false;
diff --git a/browser/base/content/test/general/browser_devices_get_user_media.js b/browser/base/content/test/general/browser_devices_get_user_media.js
index 5452dc7f5eb9..287592b8436e 100644
--- a/browser/base/content/test/general/browser_devices_get_user_media.js
+++ b/browser/base/content/test/general/browser_devices_get_user_media.js
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+requestLongerTimeout(2);
+
const kObservedTopics = [
"getUserMedia:response:allow",
"getUserMedia:revoke",
diff --git a/browser/base/content/test/general/browser_e10s_switchbrowser.js b/browser/base/content/test/general/browser_e10s_switchbrowser.js
index 5a32efce88bf..e6134f749fe8 100644
--- a/browser/base/content/test/general/browser_e10s_switchbrowser.js
+++ b/browser/base/content/test/general/browser_e10s_switchbrowser.js
@@ -1,3 +1,5 @@
+requestLongerTimeout(2);
+
const DUMMY_PATH = "browser/browser/base/content/test/general/dummy_page.html";
const gExpectedHistory = {
diff --git a/browser/base/content/test/general/browser_sanitize-timespans.js b/browser/base/content/test/general/browser_sanitize-timespans.js
index 77a734b21cf8..8abe82187881 100644
--- a/browser/base/content/test/general/browser_sanitize-timespans.js
+++ b/browser/base/content/test/general/browser_sanitize-timespans.js
@@ -1,6 +1,8 @@
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
+requestLongerTimeout(2);
+
// Bug 453440 - Test the timespan-based logic of the sanitizer code
var now_mSec = Date.now();
var now_uSec = now_mSec * 1000;
diff --git a/browser/base/content/test/general/browser_tab_drag_drop_perwindow.js b/browser/base/content/test/general/browser_tab_drag_drop_perwindow.js
index 145e003141a5..ce7f683081f2 100644
--- a/browser/base/content/test/general/browser_tab_drag_drop_perwindow.js
+++ b/browser/base/content/test/general/browser_tab_drag_drop_perwindow.js
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+requestLongerTimeout(2);
+
const CHROMEUTILS_URL = "chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js";
var ChromeUtils = {};
diff --git a/browser/base/content/test/newtab/browser_newtab_block.js b/browser/base/content/test/newtab/browser_newtab_block.js
index 1a958b794b30..5e464d87bec0 100644
--- a/browser/base/content/test/newtab/browser_newtab_block.js
+++ b/browser/base/content/test/newtab/browser_newtab_block.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/*
* These tests make sure that blocking/removing sites from the grid works
* as expected. Pinned tabs should not be moved. Gaps will be re-filled
diff --git a/browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js b/browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js
index 745ba939f263..4b712a6aca8b 100644
--- a/browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js
+++ b/browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
const PREF_NEWTAB_COLUMNS = "browser.newtabpage.columns";
/*
diff --git a/browser/base/content/test/newtab/browser_newtab_enhanced.js b/browser/base/content/test/newtab/browser_newtab_enhanced.js
index a5ddd2838109..323ae18d512a 100644
--- a/browser/base/content/test/newtab/browser_newtab_enhanced.js
+++ b/browser/base/content/test/newtab/browser_newtab_enhanced.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
const PRELOAD_PREF = "browser.newtab.preload";
var suggestedLink = {
diff --git a/browser/components/customizableui/test/browser_880164_customization_context_menus.js b/browser/components/customizableui/test/browser_880164_customization_context_menus.js
index 86becf29fc4b..ad7aa1ebfcdc 100644
--- a/browser/components/customizableui/test/browser_880164_customization_context_menus.js
+++ b/browser/components/customizableui/test/browser_880164_customization_context_menus.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
const isOSX = (Services.appinfo.OS === "Darwin");
// Right-click on the home button should
diff --git a/browser/components/customizableui/test/browser_938980_navbar_collapsed.js b/browser/components/customizableui/test/browser_938980_navbar_collapsed.js
index 51ff0ca68992..b9eeaea1b1e6 100644
--- a/browser/components/customizableui/test/browser_938980_navbar_collapsed.js
+++ b/browser/components/customizableui/test/browser_938980_navbar_collapsed.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
var bookmarksToolbar = document.getElementById("PersonalToolbar");
var navbar = document.getElementById("nav-bar");
var tabsToolbar = document.getElementById("TabsToolbar");
diff --git a/browser/components/customizableui/test/browser_970511_undo_restore_default.js b/browser/components/customizableui/test/browser_970511_undo_restore_default.js
index 599dfdf72085..33530ea34dd9 100644
--- a/browser/components/customizableui/test/browser_970511_undo_restore_default.js
+++ b/browser/components/customizableui/test/browser_970511_undo_restore_default.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Restoring default should show an "undo" option which undoes the restoring operation.
add_task(function() {
let homeButtonId = "home-button";
diff --git a/browser/components/customizableui/test/browser_975719_customtoolbars_behaviour.js b/browser/components/customizableui/test/browser_975719_customtoolbars_behaviour.js
index 95964e9e6984..0bba6fee3363 100644
--- a/browser/components/customizableui/test/browser_975719_customtoolbars_behaviour.js
+++ b/browser/components/customizableui/test/browser_975719_customtoolbars_behaviour.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
const kXULWidgetId = "a-test-button"; // we'll create a button with this ID.
add_task(function setup() {
diff --git a/browser/components/customizableui/test/browser_bootstrapped_custom_toolbar.js b/browser/components/customizableui/test/browser_bootstrapped_custom_toolbar.js
index af4316b13439..2c5f0c79cc29 100644
--- a/browser/components/customizableui/test/browser_bootstrapped_custom_toolbar.js
+++ b/browser/components/customizableui/test/browser_bootstrapped_custom_toolbar.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
const kTestBarID = "testBar";
const kWidgetID = "characterencoding-button";
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js
index 5c354b606d72..2682ad819a1f 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js
@@ -2,6 +2,8 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
+requestLongerTimeout(2);
+
function* testHasPermission(params) {
let contentSetup = params.contentSetup || (() => Promise.resolve());
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js b/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
index ce05577ffd0b..4a58b0fc467f 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
@@ -2,6 +2,8 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
+requestLongerTimeout(2);
+
add_task(function* () {
let win1 = yield BrowserTestUtils.openNewBrowserWindow();
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_query.js b/browser/components/extensions/test/browser/browser_ext_tabs_query.js
index 32ee3afb283a..1c719a8adeae 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_query.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_query.js
@@ -2,6 +2,8 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
+requestLongerTimeout(2);
+
add_task(function* () {
let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:robots");
let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:config");
diff --git a/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js b/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
index 9fe661d33d5b..89313d7366fe 100644
--- a/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
+++ b/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
@@ -1,9 +1,11 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
function test() {
waitForExplicitFinish();
- requestLongerTimeout(2);
+ requestLongerTimeout(3);
testRunner.runTests();
}
diff --git a/browser/components/preferences/in-content/tests/browser_privacypane_4.js b/browser/components/preferences/in-content/tests/browser_privacypane_4.js
index ad22217a177d..0b3d57fc250d 100644
--- a/browser/components/preferences/in-content/tests/browser_privacypane_4.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_4.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
function test() {
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
getService(Ci.mozIJSSubScriptLoader);
diff --git a/browser/components/sessionstore/test/browser_522545.js b/browser/components/sessionstore/test/browser_522545.js
index 73395d579dbe..1c64bd7e82f2 100644
--- a/browser/components/sessionstore/test/browser_522545.js
+++ b/browser/components/sessionstore/test/browser_522545.js
@@ -6,7 +6,7 @@ function test() {
/** Test for Bug 522545 **/
waitForExplicitFinish();
- requestLongerTimeout(3);
+ requestLongerTimeout(4);
// This tests the following use case:
// User opens a new tab which gets focus. The user types something into the
diff --git a/browser/components/sessionstore/test/browser_586068-apptabs.js b/browser/components/sessionstore/test/browser_586068-apptabs.js
index 46a0b7754dbd..f8727c04f8fe 100644
--- a/browser/components/sessionstore/test/browser_586068-apptabs.js
+++ b/browser/components/sessionstore/test/browser_586068-apptabs.js
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+requestLongerTimeout(2);
+
const PREF_RESTORE_ON_DEMAND = "browser.sessionstore.restore_on_demand";
add_task(function* test() {
diff --git a/browser/components/sessionstore/test/browser_600545.js b/browser/components/sessionstore/test/browser_600545.js
index 51dbb60279f6..6852357c2ca5 100644
--- a/browser/components/sessionstore/test/browser_600545.js
+++ b/browser/components/sessionstore/test/browser_600545.js
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+requestLongerTimeout(2);
+
var stateBackup = JSON.parse(ss.getBrowserState());
function test() {
diff --git a/browser/components/sessionstore/test/browser_crashedTabs.js b/browser/components/sessionstore/test/browser_crashedTabs.js
index e073d7ef3610..3e1a6ec466b9 100644
--- a/browser/components/sessionstore/test/browser_crashedTabs.js
+++ b/browser/components/sessionstore/test/browser_crashedTabs.js
@@ -3,6 +3,8 @@
"use strict";
+requestLongerTimeout(2);
+
const PAGE_1 = "data:text/html,
A%20regular,%20everyday,%20normal%20page.";
const PAGE_2 = "data:text/html,Another%20regular,%20everyday,%20normal%20page.";
diff --git a/browser/components/sessionstore/test/browser_formdata_cc.js b/browser/components/sessionstore/test/browser_formdata_cc.js
index ef908f43dda6..6e27ca970e72 100644
--- a/browser/components/sessionstore/test/browser_formdata_cc.js
+++ b/browser/components/sessionstore/test/browser_formdata_cc.js
@@ -3,7 +3,7 @@
const URL = "http://mochi.test:8888/browser/browser/components/" +
"sessionstore/test/browser_formdata_sample.html";
-requestLongerTimeout(2);
+requestLongerTimeout(3);
/**
* This test ensures that credit card numbers in form data will not be
diff --git a/browser/components/sessionstore/test/browser_sessionHistory.js b/browser/components/sessionstore/test/browser_sessionHistory.js
index 120f918b3f72..f4523e06a245 100644
--- a/browser/components/sessionstore/test/browser_sessionHistory.js
+++ b/browser/components/sessionstore/test/browser_sessionHistory.js
@@ -3,6 +3,8 @@
"use strict";
+requestLongerTimeout(2);
+
/**
* Ensure that starting a load invalidates shistory.
*/
diff --git a/browser/experiments/Makefile.in b/browser/experiments/Makefile.in
index 831d9ef209f7..5558582a6805 100644
--- a/browser/experiments/Makefile.in
+++ b/browser/experiments/Makefile.in
@@ -6,7 +6,7 @@ include $(topsrcdir)/config/rules.mk
# This is so hacky. Waiting on bug 988938.
addondir = $(srcdir)/test/addons
-testdir = $(abspath $(DEPTH)/_tests/xpcshell/browser/experiments/test/xpcshell)
+testdir = $(topobjdir)/_tests/xpcshell/browser/experiments/test/xpcshell
misc:: $(call mkdir_deps,$(testdir))
$(EXIT_ON_ERROR) \
diff --git a/browser/extensions/loop/jar.mn b/browser/extensions/loop/jar.mn
index 3df2c1c6933d..d90360d6e174 100644
--- a/browser/extensions/loop/jar.mn
+++ b/browser/extensions/loop/jar.mn
@@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-[.] chrome.jar:
+[features/loop@mozilla.org] chrome.jar:
% content loop %content/ contentaccessible=yes
% skin loop classic/1.0 %skin/linux/ os=Linux
% skin loop classic/1.0 %skin/osx/ os=Darwin
diff --git a/browser/extensions/loop/moz.build b/browser/extensions/loop/moz.build
index 98a3ce2fd125..c747a75e965c 100644
--- a/browser/extensions/loop/moz.build
+++ b/browser/extensions/loop/moz.build
@@ -4,13 +4,11 @@
# 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/.
-FINAL_TARGET = 'dist/bin/browser/features/loop@mozilla.org'
-
-FINAL_TARGET_FILES += [
+FINAL_TARGET_FILES.features['loop@mozilla.org'] += [
'bootstrap.js'
]
-FINAL_TARGET_PP_FILES += [
+FINAL_TARGET_PP_FILES.features['loop@mozilla.org'] += [
'install.rdf.in'
]
diff --git a/browser/extensions/pdfjs/test/browser_pdfjs_navigation.js b/browser/extensions/pdfjs/test/browser_pdfjs_navigation.js
index 3a822366857c..ace52c050f04 100644
--- a/browser/extensions/pdfjs/test/browser_pdfjs_navigation.js
+++ b/browser/extensions/pdfjs/test/browser_pdfjs_navigation.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
Components.utils.import("resource://gre/modules/Promise.jsm", this);
const RELATIVE_DIR = "browser/extensions/pdfjs/test/";
diff --git a/browser/extensions/pdfjs/test/browser_pdfjs_zoom.js b/browser/extensions/pdfjs/test/browser_pdfjs_zoom.js
index c06cf39c009a..acc35a98aa6a 100644
--- a/browser/extensions/pdfjs/test/browser_pdfjs_zoom.js
+++ b/browser/extensions/pdfjs/test/browser_pdfjs_zoom.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
Components.utils.import("resource://gre/modules/Promise.jsm", this);
const RELATIVE_DIR = "browser/extensions/pdfjs/test/";
diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
index dec094c25c73..5e6a90d1b3d0 100644
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -35,8 +35,8 @@ PWD := $(CURDIR)
# pulls. You may override them if you provide your own files. You _must_
# override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
# work in that case.
-ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
-WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
+ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
+WIN32_INSTALLER_IN ?= $(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
RETRIEVE_WINDOWS_INSTALLER = 1
MOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox.mozilla.org
@@ -47,9 +47,9 @@ L10N_PREF_JS_EXPORTS_FLAGS = $(PREF_PPFLAGS) --silence-missing-directive-warning
PP_TARGETS += L10N_PREF_JS_EXPORTS
ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
-MOZ_PKG_MAC_DSSTORE=$(_ABS_DIST)/branding/dsstore
-MOZ_PKG_MAC_BACKGROUND=$(_ABS_DIST)/branding/background.png
-MOZ_PKG_MAC_ICON=$(_ABS_DIST)/branding/disk.icns
+MOZ_PKG_MAC_DSSTORE=$(ABS_DIST)/branding/dsstore
+MOZ_PKG_MAC_BACKGROUND=$(ABS_DIST)/branding/background.png
+MOZ_PKG_MAC_ICON=$(ABS_DIST)/branding/disk.icns
MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
endif
@@ -57,14 +57,14 @@ ifeq (WINNT,$(OS_ARCH))
UNINSTALLER_PACKAGE_HOOK = $(RM) -r $(STAGEDIST)/uninstall; \
$(NSINSTALL) -D $(STAGEDIST)/uninstall; \
cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall; \
- $(RM) $(_ABS_DIST)/l10n-stage/setup.exe; \
- cp ../installer/windows/l10ngen/setup.exe $(_ABS_DIST)/l10n-stage; \
+ $(RM) $(ABS_DIST)/l10n-stage/setup.exe; \
+ cp ../installer/windows/l10ngen/setup.exe $(ABS_DIST)/l10n-stage; \
$(NULL)
-STUB_HOOK = $(NSINSTALL) -D '$(_ABS_DIST)/$(PKG_INST_PATH)'; \
- $(RM) '$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
- cp ../installer/windows/l10ngen/stub.exe '$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
- chmod 0755 '$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
+STUB_HOOK = $(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)'; \
+ $(RM) '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
+ cp ../installer/windows/l10ngen/stub.exe '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
+ chmod 0755 '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
$(NULL)
endif
@@ -140,7 +140,7 @@ endif
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
-repackage-win32-installer: WIN32_INSTALLER_OUT=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
+repackage-win32-installer: WIN32_INSTALLER_OUT=$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
repackage-win32-installer: $(call ESCAPE_WILDCARD,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES) libs-$(AB_CD)
@echo 'Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT).'
$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
diff --git a/browser/locales/generic/install.rdf b/browser/locales/generic/install.rdf
deleted file mode 100644
index 8b5520db719d..000000000000
--- a/browser/locales/generic/install.rdf
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-#ifdef MOZ_LANGPACK_CONTRIBUTORS
- @MOZ_LANGPACK_CONTRIBUTORS@
-#endif
-
-
-
- {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
- @MOZ_APP_VERSION@
- @MOZ_APP_MAXVERSION@
-
-
-
-
diff --git a/build/Makefile.in b/build/Makefile.in
index 2d82093b882b..b0261635f0e7 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -33,7 +33,7 @@ endif
# NOTE: Keep .gdbinit in the topsrcdir for people who run gdb from the topsrcdir.
# needs to be absolute to be distinct from $(topsrcdir)/.gdbinit
GDBINIT_OBJDIR_FILES = $(topsrcdir)/.gdbinit
-GDBINIT_OBJDIR_DEST = $(abspath $(DEPTH))
+GDBINIT_OBJDIR_DEST = $(topobjdir)
INSTALL_TARGETS += GDBINIT_OBJDIR
# Put a .lldbinit in the bin directory and the objdir, to be picked up
@@ -52,7 +52,7 @@ INSTALL_TARGETS += LLDBINIT_FINAL_TARGET
# Put the .ycm_extra_conf.py file at the root of the objdir. It is used by
# the vim plugin YouCompleteMe.
YCM_FILES := $(topsrcdir)/.ycm_extra_conf.py
-YCM_DEST := $(abspath $(DEPTH))
+YCM_DEST := $(topobjdir)
YCM_TARGET := export
INSTALL_TARGETS += YCM
diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4
index 56d6af4b2c76..fd4bf42d184f 100644
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -128,13 +128,13 @@ fi
AC_SUBST(MOZ_NO_DEBUG_RTL)
-MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -DTRACING"
+MOZ_DEBUG_ENABLE_DEFS="DEBUG TRACING"
MOZ_ARG_WITH_STRING(debug-label,
[ --with-debug-label=LABELS
Define DEBUG_ for each comma-separated
value given.],
[ for option in `echo $withval | sed 's/,/ /g'`; do
- MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
+ MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS DEBUG_${option}"
done])
if test -n "$MOZ_DEBUG"; then
@@ -153,10 +153,10 @@ if test -n "$MOZ_DEBUG"; then
MOZ_DEBUG_DEFINES="$MOZ_DEBUG_ENABLE_DEFS"
else
- MOZ_DEBUG_DEFINES="-DNDEBUG -DTRIMMED"
+ MOZ_DEBUG_DEFINES="NDEBUG TRIMMED"
fi
-AC_SUBST(MOZ_DEBUG_DEFINES)
+AC_SUBST_LIST(MOZ_DEBUG_DEFINES)
dnl ========================================================
dnl = Enable generation of debug symbols
diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
index 473f7074d3ba..71dc1a3894a1 100644
--- a/build/pgo/profileserver.py
+++ b/build/pgo/profileserver.py
@@ -63,6 +63,14 @@ if __name__ == '__main__':
if os.path.exists(vc12dir):
env["PATH"] = vc12dir + ";" + env["PATH"]
+ # Run Firefox a first time to initialize its profile
+ runner = FirefoxRunner(profile=profile,
+ binary=build.get_binary_path(where="staged-package"),
+ cmdargs=['javascript:Quitter.quit()'],
+ env=env)
+ runner.start()
+ runner.wait()
+
jarlog = os.getenv("JARLOG_FILE")
if jarlog:
env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
diff --git a/config/baseconfig.mk b/config/baseconfig.mk
index 86920aadedf8..76e1f76705de 100644
--- a/config/baseconfig.mk
+++ b/config/baseconfig.mk
@@ -11,6 +11,7 @@ DIST = dist
else
DIST = $(DEPTH)/dist
endif
+ABS_DIST = $(topobjdir)/dist
# We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
# manually use it before config.mk inclusion
diff --git a/config/config.mk b/config/config.mk
index d0de93df2b06..c56c754c12cb 100644
--- a/config/config.mk
+++ b/config/config.mk
@@ -159,8 +159,6 @@ _DEBUG_ASFLAGS :=
_DEBUG_CFLAGS :=
_DEBUG_LDFLAGS :=
-_DEBUG_CFLAGS += $(MOZ_DEBUG_DEFINES)
-
ifneq (,$(MOZ_DEBUG)$(MOZ_DEBUG_SYMBOLS))
ifeq ($(AS),yasm)
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
@@ -289,9 +287,9 @@ CCC = $(CXX)
INCLUDES = \
-I$(srcdir) \
- -I. \
+ -I$(CURDIR) \
$(LOCAL_INCLUDES) \
- -I$(DIST)/include \
+ -I$(ABS_DIST)/include \
$(NULL)
ifndef IS_GYP_DIR
@@ -329,6 +327,8 @@ LDFLAGS += $(MOZ_OPTIMIZE_LDFLAGS)
RUSTFLAGS += $(MOZ_OPTIMIZE_RUSTFLAGS)
endif # MOZ_OPTIMIZE
+HOST_CFLAGS += $(_DEPEND_CFLAGS)
+HOST_CXXFLAGS += $(_DEPEND_CFLAGS)
ifdef CROSS_COMPILE
HOST_CFLAGS += $(HOST_OPTIMIZE_FLAGS)
else
@@ -409,8 +409,8 @@ OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
endif
endif
-COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS)
-COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS)
+COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(_DEPEND_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS)
+COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(_DEPEND_CFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS)
COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS)
COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS)
ASFLAGS += $(MOZBUILD_ASFLAGS)
diff --git a/config/external/nspr/Makefile.in b/config/external/nspr/Makefile.in
index c4349f35b6ea..753c91046e64 100644
--- a/config/external/nspr/Makefile.in
+++ b/config/external/nspr/Makefile.in
@@ -8,7 +8,6 @@ include $(topsrcdir)/config/rules.mk
ifdef MOZ_BUILD_NSPR
# Copy NSPR to the SDK
-ABS_DIST = $(abspath $(DIST))
ifdef MOZ_FOLD_LIBS
# Trick the nspr build system into not building shared libraries.
diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in
index 713c66a3384c..9ad7e2db362b 100644
--- a/config/external/nss/Makefile.in
+++ b/config/external/nss/Makefile.in
@@ -85,15 +85,6 @@ NSS_EXTRA_DLLS += freebl_64int_3
NSS_EXTRA_DLLS += freebl_64fpu_3
endif
-ABS_DIST := $(abspath $(DIST))
-ifeq ($(HOST_OS_ARCH),WINNT)
-ifdef CYGDRIVE_MOUNT
-ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
-endif
-ifneq (,$(filter mingw%,$(host_os)))
-ABS_DIST := $(shell cd $(DIST) && pwd -W)
-endif
-endif
# For all variables such as DLLFLAGS, that may contain $(DIST)
DIST := $(ABS_DIST)
NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
@@ -344,31 +335,6 @@ ifdef MOZ_FOLD_LIBS
# Add all static libraries for nss, smime, ssl and nssutil
STATIC_LIBS += $(addprefix $(DEPTH)/security/,$(NSS_STATIC_LIBS))
-nss_def_file := $(srcdir)/nss.def
-
-ifeq (WINNT,$(OS_TARGET))
-# Create a .def file based on the various .def files for nss, smime, ssl and
-# nssutil.
-nss3.def: $(nss_def_file) $(DEPTH)/db/sqlite3/src/sqlite-processed.def $(NSS_EXTRA_SYMBOLS_FILE)
- echo LIBRARY nss3$(DLL_SUFFIX) > $@.tmp
- echo EXPORTS >> $@.tmp
- grep -v -h -e ^LIBRARY -e ^EXPORTS -e ^\; $^ >> $@.tmp
- mv $@.tmp $@
-else
-ifdef GCC_USE_GNU_LD
-sqlite_def_file := $(topsrcdir)/db/sqlite3/src/sqlite.def
-nspr_def_file := $(srcdir)/nspr-dummy.def
-
-nss3.def: $(nss_def_file) $(sqlite_def_file) $(nspr_def_file) $(NSS_EXTRA_SYMBOLS_FILE)
- @$(call py_action,convert_def_file, \
- $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) -o $@ $^)
-
-GARBAGE += \
- nss3.def \
- $(NULL)
-endif # GCC_USE_GNU_LD
-endif # WINNT
-
IMPORT_LIB_FILES = $(IMPORT_LIBRARY)
IMPORT_LIB_DEST ?= $(DIST)/lib
IMPORT_LIB_TARGET = target
diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build
index 572cebf74a30..10a12ea592ee 100644
--- a/config/external/nss/moz.build
+++ b/config/external/nss/moz.build
@@ -31,11 +31,7 @@ elif CONFIG['MOZ_FOLD_LIBS']:
OS_LIBS += CONFIG['REALTIME_LIBS']
- if CONFIG['OS_TARGET'] == 'WINNT':
- DEFFILE = 'nss3.def'
-
- if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['GCC_USE_GNU_LD']:
- LD_VERSION_SCRIPT = 'nss3.def'
+ SYMBOLS_FILE = 'nss.symbols'
else:
Library('nss')
USE_LIBS += [
diff --git a/config/external/nss/nspr-dummy.def b/config/external/nss/nspr-dummy.def
deleted file mode 100644
index b14fcf82c84f..000000000000
--- a/config/external/nss/nspr-dummy.def
+++ /dev/null
@@ -1,15 +0,0 @@
-; 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 is a fake .def file, to be used for generating linker scripts
-; for our folded libnss when MOZ_FOLD_LIBS. NSPR, unlike NSS, exports
-; symbols with symbol visibility (Unix) or __declspec (Windows). When
-; using a linker script, however, we need to explicitly specify that
-; NSPR's symbols should be globally visible. Otherwise, NSPR's exported
-; symbols would match the |local: *| rule and be hidden.
-LIBRARY libnsprdummy
-EXPORTS
-PR_* ; Actual .def files don't allow wildcards, of course.
-_PR_*
-PL_*
diff --git a/config/external/nss/nss.def b/config/external/nss/nss.symbols
similarity index 89%
rename from config/external/nss/nss.def
rename to config/external/nss/nss.symbols
index 2e631536ce3b..e6c5e7bbf92b 100644
--- a/config/external/nss/nss.def
+++ b/config/external/nss/nss.symbols
@@ -1,11 +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/.
-;
-; This is a fake .def file, to be used for generating linker scripts
-; for our folded libnss when MOZ_FOLD_LIBS.
-LIBRARY nss3
-EXPORTS
+# 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 XP_WIN
+# NSPR, unlike NSS, exports symbols with symbol visibility (Unix) or __declspec
+# (Windows). When using a linker script, however, we need to explicitly
+# specify that NSPR's symbols should be globally visible. Otherwise, NSPR's
+# exported symbols would be hidden.
+# .def files on Windows don't allow wildcards, of course, which is why this is
+# excluded on Windows, but it doesn't matter because the symbols are already
+# exported in NSPR (Windows peculiarity).
+PR_*
+PL_*
+#endif
+#include ../../../db/sqlite3/src/sqlite.symbols
ATOB_AsciiToData
ATOB_AsciiToData_Util
ATOB_ConvertAsciiToItem
@@ -21,8 +29,8 @@ __CERT_AddTempCertToPerm
CERT_AsciiToName
CERT_CacheOCSPResponseFromSideChannel
CERT_CertChainFromCert
-CERT_CertificateRequestTemplate DATA
-CERT_CertificateTemplate DATA
+CERT_CertificateRequestTemplate @DATA@
+CERT_CertificateTemplate @DATA@
CERT_CertListFromCert
CERT_ChangeCertTrust
CERT_CheckCertUsage
@@ -38,7 +46,7 @@ CERT_CreateCertificate
CERT_CreateCertificateRequest
CERT_CreateSubjectCertList
CERT_CreateValidity
-CERT_CrlTemplate DATA
+CERT_CrlTemplate @DATA@
CERT_DecodeAltNameExtension
CERT_DecodeAuthInfoAccessExtension
CERT_DecodeAuthKeyID
@@ -128,7 +136,7 @@ CERT_IsCACert
CERT_IsUserCert
CERT_MakeCANickname
CERT_MergeExtensions
-CERT_NameTemplate DATA
+CERT_NameTemplate @DATA@
CERT_NameToAscii
CERT_NewCertList
CERT_NewTempCertificate
@@ -138,15 +146,15 @@ CERT_PKIXVerifyCert
CERT_RemoveCertListNode
CERT_RFC1485_EscapeAndQuote
CERT_SaveSMimeProfile
-CERT_SequenceOfCertExtensionTemplate DATA
+CERT_SequenceOfCertExtensionTemplate @DATA@
CERT_SetOCSPFailureMode
CERT_SetOCSPTimeout
-CERT_SignedCrlTemplate DATA
-CERT_SignedDataTemplate DATA
+CERT_SignedCrlTemplate @DATA@
+CERT_SignedDataTemplate @DATA@
CERT_StartCertExtensions
CERT_StartCertificateRequestAttributes
-CERT_SubjectPublicKeyInfoTemplate DATA
-CERT_TimeChoiceTemplate DATA
+CERT_SubjectPublicKeyInfoTemplate @DATA@
+CERT_TimeChoiceTemplate @DATA@
CERT_VerifyCertificate
CERT_VerifySignedDataWithPublicKeyInfo
DER_AsciiToTime_Util
@@ -462,7 +470,7 @@ PORT_UCS2_UTF8Conversion_Util
PORT_ZAlloc
PORT_ZAlloc_Util
PORT_ZFree_Util
-SEC_AnyTemplate_Util DATA
+SEC_AnyTemplate_Util @DATA@
SEC_ASN1Decode
SEC_ASN1DecodeInteger
SEC_ASN1DecodeItem
@@ -473,20 +481,20 @@ SEC_ASN1EncodeItem
SEC_ASN1EncodeItem_Util
SEC_ASN1EncodeUnsignedInteger_Util
SEC_ASN1Encode_Util
-SEC_BitStringTemplate DATA
-SEC_BitStringTemplate_Util DATA
-SEC_BMPStringTemplate DATA
-SEC_BooleanTemplate_Util DATA
+SEC_BitStringTemplate @DATA@
+SEC_BitStringTemplate_Util @DATA@
+SEC_BMPStringTemplate @DATA@
+SEC_BooleanTemplate_Util @DATA@
SEC_CertNicknameConflict
SEC_DeletePermCertificate
SEC_DerSignData
SEC_DestroyCrl
-SEC_GeneralizedTimeTemplate_Util DATA
+SEC_GeneralizedTimeTemplate_Util @DATA@
SEC_GetSignatureAlgorithmOidTag
-SEC_IA5StringTemplate DATA
-SEC_IA5StringTemplate_Util DATA
-SEC_IntegerTemplate DATA
-SEC_IntegerTemplate_Util DATA
+SEC_IA5StringTemplate @DATA@
+SEC_IA5StringTemplate_Util @DATA@
+SEC_IntegerTemplate @DATA@
+SEC_IntegerTemplate_Util @DATA@
SECITEM_AllocArray
SECITEM_AllocItem
SECITEM_AllocItem_Util
@@ -524,7 +532,7 @@ SECKEY_ExtractPublicKey
SECKEY_GetPublicKeyType
SECKEY_ImportDERPublicKey
SECKEY_PublicKeyStrength
-SECKEY_RSAPSSParamsTemplate DATA
+SECKEY_RSAPSSParamsTemplate @DATA@
SECKEY_SignatureLen
SECMIME_DecryptionAllowed
SECMOD_AddNewModule
@@ -555,14 +563,14 @@ SECMOD_ReleaseReadLock
SECMOD_UnloadUserModule
SECMOD_UpdateModule
SECMOD_WaitForAnyTokenEvent
-SEC_NullTemplate_Util DATA
-SEC_ObjectIDTemplate_Util DATA
-SEC_OctetStringTemplate DATA
-SEC_OctetStringTemplate_Util DATA
+SEC_NullTemplate_Util @DATA@
+SEC_ObjectIDTemplate_Util @DATA@
+SEC_OctetStringTemplate @DATA@
+SEC_OctetStringTemplate_Util @DATA@
SECOID_AddEntry
SECOID_AddEntry_Util
-SECOID_AlgorithmIDTemplate DATA
-SECOID_AlgorithmIDTemplate_Util DATA
+SECOID_AlgorithmIDTemplate @DATA@
+SECOID_AlgorithmIDTemplate_Util @DATA@
SECOID_CopyAlgorithmID_Util
SECOID_DestroyAlgorithmID
SECOID_DestroyAlgorithmID_Util
@@ -618,10 +626,10 @@ SEC_QuickDERDecodeItem
SEC_QuickDERDecodeItem_Util
SEC_RegisterDefaultHttpClient
SEC_SignData
-SEC_SignedCertificateTemplate DATA
+SEC_SignedCertificateTemplate @DATA@
SEC_StringToOID
-SEC_UTF8StringTemplate DATA
-SEC_UTF8StringTemplate_Util DATA
+SEC_UTF8StringTemplate @DATA@
+SEC_UTF8StringTemplate_Util @DATA@
SGN_Begin
SGN_CreateDigestInfo_Util
SGN_DecodeDigestInfo
@@ -650,9 +658,9 @@ SSL_GetNumImplementedCiphers
SSL_GetSRTPCipher
SSL_HandshakeCallback
SSL_HandshakeNegotiatedExtension
-SSL_ImplementedCiphers DATA
+SSL_ImplementedCiphers @DATA@
SSL_ImportFD
-SSL_NumImplementedCiphers DATA
+SSL_NumImplementedCiphers @DATA@
SSL_OptionSet
SSL_OptionSetDefault
SSL_PeerCertificate
@@ -684,3 +692,6 @@ VFY_VerifyDataWithAlgorithmID
VFY_VerifyDigestDirect
_SGN_VerifyPKCS1DigestInfo
__PK11_SetCertificateNickname
+#ifdef NSS_EXTRA_SYMBOLS_FILE
+#include @NSS_EXTRA_SYMBOLS_FILE@
+#endif
diff --git a/config/external/sqlite/Makefile.in b/config/external/sqlite/Makefile.in
index 02dde0576dbf..55fa73618954 100644
--- a/config/external/sqlite/Makefile.in
+++ b/config/external/sqlite/Makefile.in
@@ -3,26 +3,3 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
LIB_IS_C_ONLY = 1
-
-include $(topsrcdir)/config/config.mk
-
-ifeq ($(OS_ARCH),WINNT)
-# This needs to stay there for now
-DEFFILE = $(DEPTH)/db/sqlite3/src/sqlite-processed.def
-
-else
-ifndef MOZ_FOLD_LIBS
-ifdef GCC_USE_GNU_LD
-
-GARBAGE += \
- $(LD_VERSION_SCRIPT) \
- $(NULL)
-
-# Convert to the format we need for ld.
-$(LD_VERSION_SCRIPT): $(topsrcdir)/db/sqlite3/src/sqlite.def
- @$(call py_action,convert_def_file, \
- $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) -o $@ $^)
-
-endif
-endif
-endif
diff --git a/config/external/sqlite/moz.build b/config/external/sqlite/moz.build
index b6f500727f4d..97aeba158146 100644
--- a/config/external/sqlite/moz.build
+++ b/config/external/sqlite/moz.build
@@ -19,5 +19,4 @@ else:
SharedLibrary('sqlite')
SHARED_LIBRARY_NAME = 'mozsqlite3'
- if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['GCC_USE_GNU_LD']:
- LD_VERSION_SCRIPT = 'sqlite-processed.def'
+ SYMBOLS_FILE = '/db/sqlite3/src/sqlite.symbols'
diff --git a/config/faster/rules.mk b/config/faster/rules.mk
index 17f5494b6f98..29d64d5e6835 100644
--- a/config/faster/rules.mk
+++ b/config/faster/rules.mk
@@ -107,7 +107,6 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/build
-DAB_CD=en-US \
-DMOZ_APP_BUILDID=$(shell cat $(TOPOBJDIR)/config/buildid) \
$(ACDEFINES) \
- $(MOZ_DEBUG_DEFINES) \
install_$(subst /,_,$*)
# ============================================================================
diff --git a/config/makefiles/debugmake.mk b/config/makefiles/debugmake.mk
index c72a78c1bfda..619f1c7cea61 100644
--- a/config/makefiles/debugmake.mk
+++ b/config/makefiles/debugmake.mk
@@ -57,6 +57,7 @@ ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $
endif
$(LOOP_OVER_DIRS)
+showbuild showhost: _DEPEND_CFLAGS=
showbuild:
$(call print_vars,\
MOZ_BUILD_ROOT \
diff --git a/config/rules.mk b/config/rules.mk
index 499c7431f9e5..b7000be3d969 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -60,7 +60,7 @@ ifdef COMPILE_ENVIRONMENT
# through TestHarness.h, by modifying the list of includes and the libs against
# which stuff links.
SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS)
-INCLUDES += -I$(DIST)/include/testing
+INCLUDES += -I$(ABS_DIST)/include/testing
ifndef MOZ_PROFILE_GENERATE
CPP_UNIT_TESTS_FILES = $(CPP_UNIT_TESTS)
@@ -462,6 +462,19 @@ EXTRA_DEPS += $(LD_VERSION_SCRIPT)
endif
endif
+ifdef SYMBOLS_FILE
+ifdef GCC_USE_GNU_LD
+EXTRA_DSO_LDOPTS += -Wl,--version-script,$(SYMBOLS_FILE)
+else
+ifeq ($(OS_TARGET),Darwin)
+EXTRA_DSO_LDOPTS += -Wl,-exported_symbols_list,$(SYMBOLS_FILE)
+endif
+ifeq ($(OS_TARGET),WINNT)
+EXTRA_DSO_LDOPTS += -DEF:$(call normalizepath,$(SYMBOLS_FILE))
+endif
+endif
+EXTRA_DEPS += $(SYMBOLS_FILE)
+endif
#
# GNU doesn't have path length limitation
#
@@ -1204,7 +1217,7 @@ endif
libs realchrome:: $(FINAL_TARGET)/chrome
$(call py_action,jar_maker,\
$(QUIET) -d $(FINAL_TARGET) \
- $(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) \
+ $(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST))
endif
@@ -1446,7 +1459,9 @@ PP_TARGETS_ALL_RESULTS := $(sort $(foreach tier,$(PP_TARGETS_TIERS),$(PP_TARGETS
$(PP_TARGETS_ALL_RESULTS):
$(if $(filter-out $(notdir $@),$(notdir $(<:.in=))),$(error Looks like $@ has an unexpected dependency on $< which breaks PP_TARGETS))
$(RM) '$@'
- $(call py_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) '$<' -o '$@')
+ $(call py_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) '$<' -o '$@')
+
+$(filter %.css,$(PP_TARGETS_ALL_RESULTS)): PP_TARGET_FLAGS+=--marker %
# The depfile is based on the filename, and we don't want conflicts. So check
# there's only one occurrence of any given filename in PP_TARGETS_ALL_RESULTS.
diff --git a/configure.in b/configure.in
index 76a2fbbc1b36..5f197470b7bb 100644
--- a/configure.in
+++ b/configure.in
@@ -1515,7 +1515,7 @@ if test "$GNU_CC"; then
esac
fi
- _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
+ _DEFINES_CFLAGS='-include $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
_USE_CPP_INCLUDE_FLAG=1
ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
@@ -1619,7 +1619,7 @@ if test "$GNU_CXX"; then
esac
fi
- _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
+ _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(topobjdir)/mozilla-config.h'
_USE_CPP_INCLUDE_FLAG=1
# Recent clang and gcc support C++11 deleted functions without warnings if
@@ -2227,8 +2227,8 @@ ia64*-hpux*)
WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
_USE_CPP_INCLUDE_FLAG=1
- _DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
- _DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
+ _DEFINES_CFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
+ _DEFINES_CXXFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
CFLAGS="$CFLAGS -W3 -Gy"
CXXFLAGS="$CXXFLAGS -W3 -Gy"
if test "$CPU_ARCH" = "x86" -a -z "$CLANG_CL"; then
@@ -8785,22 +8785,19 @@ CXXFLAGS=`echo \
COMPILE_CFLAGS=`echo \
$_DEFINES_CFLAGS \
- $_DEPEND_CFLAGS \
$COMPILE_CFLAGS`
COMPILE_CXXFLAGS=`echo \
$_DEFINES_CXXFLAGS \
- $_DEPEND_CFLAGS \
$COMPILE_CXXFLAGS`
HOST_CFLAGS=`echo \
- $HOST_CFLAGS \
- $_DEPEND_CFLAGS`
+ $HOST_CFLAGS`
HOST_CXXFLAGS=`echo \
- $HOST_CXXFLAGS \
- $_DEPEND_CFLAGS`
+ $HOST_CXXFLAGS`
+AC_SUBST(_DEPEND_CFLAGS)
AC_SUBST(MOZ_NATIVE_JPEG)
AC_SUBST(MOZ_NATIVE_PNG)
AC_SUBST(MOZ_NATIVE_BZ2)
diff --git a/db/sqlite3/src/Makefile.in b/db/sqlite3/src/Makefile.in
deleted file mode 100644
index 338fc0c2a813..000000000000
--- a/db/sqlite3/src/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# 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 $(topsrcdir)/config/config.mk
-
-ifeq ($(OS_ARCH),WINNT)
-DEFFILE = $(CURDIR)/sqlite-processed.def
-
-GARBAGE += \
- $(DEFFILE) \
- $(NULL)
-
-# We have to preprocess our def file because we need different symbols in debug
-# builds exposed that are not built in non-debug builds.
-$(DEFFILE): sqlite.def
- @$(call py_action,preprocessor,$(DEFINES) $(MOZ_DEBUG_DEFINES) \
- $(srcdir)/sqlite.def -o $(DEFFILE))
-endif
diff --git a/db/sqlite3/src/sqlite.def b/db/sqlite3/src/sqlite.def
deleted file mode 100644
index 56d8001f532f..000000000000
--- a/db/sqlite3/src/sqlite.def
+++ /dev/null
@@ -1,162 +0,0 @@
-; 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/.
-
-LIBRARY mozsqlite3.dll
-
-EXPORTS
- sqlite3_aggregate_context
- sqlite3_aggregate_count
- sqlite3_auto_extension
- sqlite3_bind_blob
- sqlite3_bind_double
- sqlite3_bind_int
- sqlite3_bind_int64
- sqlite3_bind_null
- sqlite3_bind_parameter_count
- sqlite3_bind_parameter_index
- sqlite3_bind_parameter_name
- sqlite3_bind_text
- sqlite3_bind_text16
- sqlite3_bind_value
- sqlite3_busy_handler
- sqlite3_busy_timeout
- sqlite3_changes
- sqlite3_clear_bindings
- sqlite3_close
- sqlite3_collation_needed
- sqlite3_collation_needed16
- sqlite3_column_blob
- sqlite3_column_bytes
- sqlite3_column_bytes16
- sqlite3_column_count
- sqlite3_column_decltype
- sqlite3_column_decltype16
- sqlite3_column_double
- sqlite3_column_int
- sqlite3_column_int64
- sqlite3_column_name
- sqlite3_column_name16
- sqlite3_column_text
- sqlite3_column_text16
- sqlite3_column_type
- sqlite3_column_value
- sqlite3_commit_hook
- sqlite3_complete
- sqlite3_complete16
- sqlite3_config
- sqlite3_create_collation
- sqlite3_create_collation16
- sqlite3_create_function
- sqlite3_create_function16
- sqlite3_create_module
- sqlite3_data_count
- sqlite3_db_filename
- sqlite3_db_handle
- sqlite3_db_mutex
- sqlite3_db_status
- sqlite3_declare_vtab
- sqlite3_enable_load_extension
- sqlite3_enable_shared_cache
- sqlite3_errcode
- sqlite3_errmsg
- sqlite3_errmsg16
- sqlite3_exec
- sqlite3_expired
- sqlite3_extended_result_codes
- sqlite3_file_control
- sqlite3_finalize
- sqlite3_free
- sqlite3_free_table
- sqlite3_get_autocommit
- sqlite3_get_auxdata
- sqlite3_get_table
- sqlite3_global_recover
- sqlite3_initialize
- sqlite3_interrupt
- sqlite3_last_insert_rowid
- sqlite3_libversion
- sqlite3_libversion_number
- sqlite3_load_extension
- sqlite3_malloc
- sqlite3_memory_alarm
- sqlite3_memory_highwater
- sqlite3_memory_used
- sqlite3_mutex_alloc
- sqlite3_mutex_enter
- sqlite3_mutex_free
- sqlite3_mutex_leave
- sqlite3_mutex_try
- sqlite3_mprintf
- sqlite3_next_stmt
- sqlite3_open
- sqlite3_open_v2
- sqlite3_open16
- sqlite3_overload_function
- sqlite3_prepare
- sqlite3_prepare16
- sqlite3_prepare16_v2
- sqlite3_prepare_v2
- sqlite3_profile
- sqlite3_progress_handler
- sqlite3_realloc
- sqlite3_release_memory
- sqlite3_reset
- sqlite3_reset_auto_extension
- sqlite3_result_blob
- sqlite3_result_double
- sqlite3_result_error
- sqlite3_result_error16
- sqlite3_result_error_code
- sqlite3_result_error_nomem
- sqlite3_result_int
- sqlite3_result_int64
- sqlite3_result_null
- sqlite3_result_text
- sqlite3_result_text16
- sqlite3_result_text16be
- sqlite3_result_text16le
- sqlite3_result_value
- sqlite3_rollback_hook
- sqlite3_set_authorizer
- sqlite3_set_auxdata
- sqlite3_shutdown
- sqlite3_sleep
- sqlite3_snprintf
- sqlite3_sql
- sqlite3_status
- sqlite3_step
- sqlite3_stmt_readonly
- sqlite3_stmt_status
-#ifdef XP_UNIX
- sqlite3_temp_directory
-#endif
- sqlite3_thread_cleanup
- sqlite3_total_changes
- sqlite3_trace
- sqlite3_transfer_bindings
- sqlite3_unlock_notify
- sqlite3_update_hook
- sqlite3_uri_parameter
- sqlite3_user_data
- sqlite3_value_blob
- sqlite3_value_bytes
- sqlite3_value_bytes16
- sqlite3_value_double
- sqlite3_value_int
- sqlite3_value_int64
- sqlite3_value_numeric_type
- sqlite3_value_text
- sqlite3_value_text16
- sqlite3_value_text16be
- sqlite3_value_text16le
- sqlite3_value_type
- sqlite3_version
- sqlite3_vfs_find
- sqlite3_vfs_unregister
- sqlite3_vfs_register
- sqlite3_vmprintf
-#ifdef DEBUG
- sqlite3_mutex_held
- sqlite3_mutex_notheld
-#endif
diff --git a/db/sqlite3/src/sqlite.symbols b/db/sqlite3/src/sqlite.symbols
new file mode 100644
index 000000000000..edd000a97c8c
--- /dev/null
+++ b/db/sqlite3/src/sqlite.symbols
@@ -0,0 +1,159 @@
+# 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/.
+
+sqlite3_aggregate_context
+sqlite3_aggregate_count
+sqlite3_auto_extension
+sqlite3_bind_blob
+sqlite3_bind_double
+sqlite3_bind_int
+sqlite3_bind_int64
+sqlite3_bind_null
+sqlite3_bind_parameter_count
+sqlite3_bind_parameter_index
+sqlite3_bind_parameter_name
+sqlite3_bind_text
+sqlite3_bind_text16
+sqlite3_bind_value
+sqlite3_busy_handler
+sqlite3_busy_timeout
+sqlite3_changes
+sqlite3_clear_bindings
+sqlite3_close
+sqlite3_collation_needed
+sqlite3_collation_needed16
+sqlite3_column_blob
+sqlite3_column_bytes
+sqlite3_column_bytes16
+sqlite3_column_count
+sqlite3_column_decltype
+sqlite3_column_decltype16
+sqlite3_column_double
+sqlite3_column_int
+sqlite3_column_int64
+sqlite3_column_name
+sqlite3_column_name16
+sqlite3_column_text
+sqlite3_column_text16
+sqlite3_column_type
+sqlite3_column_value
+sqlite3_commit_hook
+sqlite3_complete
+sqlite3_complete16
+sqlite3_config
+sqlite3_create_collation
+sqlite3_create_collation16
+sqlite3_create_function
+sqlite3_create_function16
+sqlite3_create_module
+sqlite3_data_count
+sqlite3_db_filename
+sqlite3_db_handle
+sqlite3_db_mutex
+sqlite3_db_status
+sqlite3_declare_vtab
+sqlite3_enable_load_extension
+sqlite3_enable_shared_cache
+sqlite3_errcode
+sqlite3_errmsg
+sqlite3_errmsg16
+sqlite3_exec
+sqlite3_expired
+sqlite3_extended_result_codes
+sqlite3_file_control
+sqlite3_finalize
+sqlite3_free
+sqlite3_free_table
+sqlite3_get_autocommit
+sqlite3_get_auxdata
+sqlite3_get_table
+sqlite3_global_recover
+sqlite3_initialize
+sqlite3_interrupt
+sqlite3_last_insert_rowid
+sqlite3_libversion
+sqlite3_libversion_number
+sqlite3_load_extension
+sqlite3_malloc
+sqlite3_memory_alarm
+sqlite3_memory_highwater
+sqlite3_memory_used
+sqlite3_mutex_alloc
+sqlite3_mutex_enter
+sqlite3_mutex_free
+sqlite3_mutex_leave
+sqlite3_mutex_try
+sqlite3_mprintf
+sqlite3_next_stmt
+sqlite3_open
+sqlite3_open_v2
+sqlite3_open16
+sqlite3_overload_function
+sqlite3_prepare
+sqlite3_prepare16
+sqlite3_prepare16_v2
+sqlite3_prepare_v2
+sqlite3_profile
+sqlite3_progress_handler
+sqlite3_realloc
+sqlite3_release_memory
+sqlite3_reset
+sqlite3_reset_auto_extension
+sqlite3_result_blob
+sqlite3_result_double
+sqlite3_result_error
+sqlite3_result_error16
+sqlite3_result_error_code
+sqlite3_result_error_nomem
+sqlite3_result_int
+sqlite3_result_int64
+sqlite3_result_null
+sqlite3_result_text
+sqlite3_result_text16
+sqlite3_result_text16be
+sqlite3_result_text16le
+sqlite3_result_value
+sqlite3_rollback_hook
+sqlite3_set_authorizer
+sqlite3_set_auxdata
+sqlite3_shutdown
+sqlite3_sleep
+sqlite3_snprintf
+sqlite3_sql
+sqlite3_status
+sqlite3_step
+sqlite3_stmt_readonly
+sqlite3_stmt_status
+#ifdef XP_UNIX
+sqlite3_temp_directory
+#endif
+sqlite3_thread_cleanup
+sqlite3_total_changes
+sqlite3_trace
+sqlite3_transfer_bindings
+sqlite3_unlock_notify
+sqlite3_update_hook
+sqlite3_uri_parameter
+sqlite3_user_data
+sqlite3_value_blob
+sqlite3_value_bytes
+sqlite3_value_bytes16
+sqlite3_value_double
+sqlite3_value_int
+sqlite3_value_int64
+sqlite3_value_numeric_type
+sqlite3_value_text
+sqlite3_value_text16
+sqlite3_value_text16be
+sqlite3_value_text16le
+sqlite3_value_type
+sqlite3_version
+sqlite3_vfs_find
+sqlite3_vfs_unregister
+sqlite3_vfs_register
+sqlite3_vmprintf
+#ifdef DEBUG
+sqlite3_mutex_held
+sqlite3_mutex_notheld
+#endif
diff --git a/devtools/client/animationinspector/test/browser_animation_empty_on_invalid_nodes.js b/devtools/client/animationinspector/test/browser_animation_empty_on_invalid_nodes.js
index 3bd3925815e5..ea3d18662849 100644
--- a/devtools/client/animationinspector/test/browser_animation_empty_on_invalid_nodes.js
+++ b/devtools/client/animationinspector/test/browser_animation_empty_on_invalid_nodes.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the panel shows no animation data for invalid or not animated nodes
add_task(function*() {
diff --git a/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js b/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js
index 674903bdfa3c..70e48ce37b85 100644
--- a/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js
+++ b/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the update of the animation panel participate in the
// inspector-updated event. This means that the test verifies that the
// inspector-updated event is emitted *after* the animation panel is ready.
diff --git a/devtools/client/animationinspector/test/browser_animation_playerFronts_are_refreshed.js b/devtools/client/animationinspector/test/browser_animation_playerFronts_are_refreshed.js
index cf9b8f79e529..9031418ae78c 100644
--- a/devtools/client/animationinspector/test/browser_animation_playerFronts_are_refreshed.js
+++ b/devtools/client/animationinspector/test/browser_animation_playerFronts_are_refreshed.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the AnimationPlayerFront objects lifecycle is managed by the
// AnimationController.
diff --git a/devtools/client/animationinspector/test/browser_animation_playerWidgets_target_nodes.js b/devtools/client/animationinspector/test/browser_animation_playerWidgets_target_nodes.js
index 9a3b803f646e..b4b102e9463c 100644
--- a/devtools/client/animationinspector/test/browser_animation_playerWidgets_target_nodes.js
+++ b/devtools/client/animationinspector/test/browser_animation_playerWidgets_target_nodes.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that player widgets display information about target nodes
add_task(function*() {
diff --git a/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js b/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
index f0f934c7b721..3c20fd52e137 100644
--- a/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the panel content refreshes when new animations are added.
add_task(function*() {
@@ -42,4 +44,4 @@ function* changeElementAndWait(options, panel, inspector) {
yield promise.all([
onInspectorUpdated, onPanelUpdated, waitForAllAnimationTargets(panel)]);
-}
\ No newline at end of file
+}
diff --git a/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js b/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js
index 4582f4044c11..3c45a19a1099 100644
--- a/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the panel content refreshes when animations are removed.
add_task(function*() {
diff --git a/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js b/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js
index 6ef11468b0a7..fe078ac542c3 100644
--- a/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the panel only refreshes when it is visible in the sidebar.
add_task(function*() {
diff --git a/devtools/client/animationinspector/test/browser_animation_running_on_compositor.js b/devtools/client/animationinspector/test/browser_animation_running_on_compositor.js
index 6b84f800c765..41bcd4dec98e 100644
--- a/devtools/client/animationinspector/test/browser_animation_running_on_compositor.js
+++ b/devtools/client/animationinspector/test/browser_animation_running_on_compositor.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that when animations displayed in the timeline are running on the
// compositor, they get a special icon and information in the tooltip.
diff --git a/devtools/client/animationinspector/test/browser_animation_same_nb_of_playerWidgets_and_playerFronts.js b/devtools/client/animationinspector/test/browser_animation_same_nb_of_playerWidgets_and_playerFronts.js
index b47e39773d7f..c1a30ca3212f 100644
--- a/devtools/client/animationinspector/test/browser_animation_same_nb_of_playerWidgets_and_playerFronts.js
+++ b/devtools/client/animationinspector/test/browser_animation_same_nb_of_playerWidgets_and_playerFronts.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that when playerFronts are updated, the same number of playerWidgets
// are created in the panel.
diff --git a/devtools/client/animationinspector/test/browser_animation_shows_player_on_valid_node.js b/devtools/client/animationinspector/test/browser_animation_shows_player_on_valid_node.js
index 5a6b25507cb9..17fb85de458a 100644
--- a/devtools/client/animationinspector/test/browser_animation_shows_player_on_valid_node.js
+++ b/devtools/client/animationinspector/test/browser_animation_shows_player_on_valid_node.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the panel shows an animation player when an animated node is
// selected.
diff --git a/devtools/client/animationinspector/test/browser_animation_target_highlight_select.js b/devtools/client/animationinspector/test/browser_animation_target_highlight_select.js
index c537f534572e..cd03e6832234 100644
--- a/devtools/client/animationinspector/test/browser_animation_target_highlight_select.js
+++ b/devtools/client/animationinspector/test/browser_animation_target_highlight_select.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the DOM element targets displayed in animation player widgets can
// be used to highlight elements in the DOM and select them in the inspector.
diff --git a/devtools/client/animationinspector/test/browser_animation_target_highlighter_lock.js b/devtools/client/animationinspector/test/browser_animation_target_highlighter_lock.js
index ab64ba6f54f9..9c82797b2bb1 100644
--- a/devtools/client/animationinspector/test/browser_animation_target_highlighter_lock.js
+++ b/devtools/client/animationinspector/test/browser_animation_target_highlighter_lock.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the DOM element targets displayed in animation player widgets can
// be used to highlight elements in the DOM and select them in the inspector.
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_currentTime.js b/devtools/client/animationinspector/test/browser_animation_timeline_currentTime.js
index e0b7dd5c5376..2335d31ce9a7 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_currentTime.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_currentTime.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline toolbar displays the current time, and that it
// changes when animations are playing, gets back to 0 when animations are
// rewound, and stops when animations are paused.
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_header.js b/devtools/client/animationinspector/test/browser_animation_timeline_header.js
index 7f7c12b0f499..8945bec8a8b2 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_header.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_header.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline shows correct time graduations in the header.
const {findOptimalTimeInterval} = require("devtools/client/animationinspector/utils");
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js b/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
index 2cdcd9ba2338..51d91043f6cd 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline toolbar contains a pause button and that this pause
// button can be clicked. Check that when it is, the current animations
// displayed in the timeline get their playstates changed accordingly, and check
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_rate_selector.js b/devtools/client/animationinspector/test/browser_animation_timeline_rate_selector.js
index 56341742fe1f..ba0c0ec9e137 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_rate_selector.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_rate_selector.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline toolbar contains a playback rate selector UI and that
// it can be used to change the playback rate of animations in the timeline.
// Also check that it displays the rate of the current animations in case they
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_rewind_button.js b/devtools/client/animationinspector/test/browser_animation_timeline_rewind_button.js
index 7e42e1b1688f..bc80b411887e 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_rewind_button.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_rewind_button.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline toolbar contains a rewind button and that it can be
// clicked. Check that when it is, the current animations displayed in the
// timeline get their playstates changed to paused, and their currentTimes
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_exists.js b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_exists.js
index e63f953a3af3..bf4bd61c87d0 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_exists.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_exists.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline does have a scrubber element.
add_task(function*() {
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_movable.js b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_movable.js
index 54fc349130d2..c6dcff83111e 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_movable.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_movable.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the scrubber in the timeline can be moved by clicking & dragging
// in the header area.
// Also check that doing so changes the timeline's play/pause button to paused
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_moves.js b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_moves.js
index c66fee6eed27..63f32d03006d 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_moves.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_scrubber_moves.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the scrubber in the timeline moves when animations are playing.
// The animations in the test page last for a very long time, so the test just
// measures the position of the scrubber once, then waits for some time to pass
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_shows_delay.js b/devtools/client/animationinspector/test/browser_animation_timeline_shows_delay.js
index b15c68499001..42c245083a8e 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_delay.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_delay.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that animation delay is visualized in the timeline when the animation
// is delayed.
// Also check that negative delays do not overflow the UI, and are shown like
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_shows_iterations.js b/devtools/client/animationinspector/test/browser_animation_timeline_shows_iterations.js
index 3752254a64f8..dbd4d73e751d 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_iterations.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_iterations.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline is displays as many iteration elements as there are
// iterations in an animation.
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js b/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
index 6259a5eb83eb..e2924eb37b74 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline displays animations' duration, delay and iteration
// counts in tooltips.
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_ui.js b/devtools/client/animationinspector/test/browser_animation_timeline_ui.js
index dc62524d7ff3..bb0e826e122d 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_ui.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_ui.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Check that the timeline contains the right elements.
add_task(function*() {
diff --git a/devtools/client/animationinspector/test/browser_animation_toggle_button_resets_on_navigate.js b/devtools/client/animationinspector/test/browser_animation_toggle_button_resets_on_navigate.js
index d57460043533..d66730095f96 100644
--- a/devtools/client/animationinspector/test/browser_animation_toggle_button_resets_on_navigate.js
+++ b/devtools/client/animationinspector/test/browser_animation_toggle_button_resets_on_navigate.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that a page navigation resets the state of the global toggle button.
add_task(function*() {
diff --git a/devtools/client/animationinspector/test/browser_animation_toggle_button_toggles_animations.js b/devtools/client/animationinspector/test/browser_animation_toggle_button_toggles_animations.js
index 384c89d3ec48..5885fec00904 100644
--- a/devtools/client/animationinspector/test/browser_animation_toggle_button_toggles_animations.js
+++ b/devtools/client/animationinspector/test/browser_animation_toggle_button_toggles_animations.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the main toggle button actually toggles animations.
// This test doesn't need to be extra careful about checking that *all*
// animations have been paused (including inside iframes) because there's an
diff --git a/devtools/client/animationinspector/test/browser_animation_toolbar_exists.js b/devtools/client/animationinspector/test/browser_animation_toolbar_exists.js
index c2ddff879b2d..8ecc44ccfde0 100644
--- a/devtools/client/animationinspector/test/browser_animation_toolbar_exists.js
+++ b/devtools/client/animationinspector/test/browser_animation_toolbar_exists.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that the animation panel has a top toolbar that contains the play/pause
// button and that is displayed at all times.
// Also test that this toolbar gets replaced by the timeline toolbar when there
diff --git a/devtools/client/animationinspector/test/browser_animation_ui_updates_when_animation_data_changes.js b/devtools/client/animationinspector/test/browser_animation_ui_updates_when_animation_data_changes.js
index 38e1c88f83a8..b27e2ebe39d2 100644
--- a/devtools/client/animationinspector/test/browser_animation_ui_updates_when_animation_data_changes.js
+++ b/devtools/client/animationinspector/test/browser_animation_ui_updates_when_animation_data_changes.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Verify that if the animation's duration, iterations or delay change in
// content, then the widget reflects the changes.
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_host-layout.js b/devtools/client/debugger/test/mochitest/browser_dbg_host-layout.js
index f7c715c6f3ff..5376421d9188 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg_host-layout.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_host-layout.js
@@ -12,7 +12,7 @@ var gDefaultHostType = Services.prefs.getCharPref("devtools.toolbox.host");
function test() {
// test is too slow on some platforms due to the number of test cases
- requestLongerTimeout(2);
+ requestLongerTimeout(3);
Task.spawn(function*() {
yield testHosts(["bottom", "side", "window:big"], ["horizontal", "vertical", "horizontal"]);
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js
index 676878d245cd..8f7173ac3344 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests if opening the variables inspection popup preserves the highlighting
* associated with the currently debugged line.
diff --git a/devtools/client/fontinspector/test/browser_fontinspector.js b/devtools/client/fontinspector/test/browser_fontinspector.js
index 3f90fad59ebb..17497d30448a 100644
--- a/devtools/client/fontinspector/test/browser_fontinspector.js
+++ b/devtools/client/fontinspector/test/browser_fontinspector.js
@@ -3,6 +3,8 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
+requestLongerTimeout(2);
+
const TEST_URI = BASE_URI + "browser_fontinspector.html";
const FONTS = [
{name: "Ostrich Sans Medium", remote: true, url: BASE_URI + "ostrich-regular.ttf",
diff --git a/devtools/client/fontinspector/test/browser_fontinspector_theme-change.js b/devtools/client/fontinspector/test/browser_fontinspector_theme-change.js
index 8096bb952966..6c42e6b6ac2b 100644
--- a/devtools/client/fontinspector/test/browser_fontinspector_theme-change.js
+++ b/devtools/client/fontinspector/test/browser_fontinspector_theme-change.js
@@ -3,6 +3,8 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
+requestLongerTimeout(2);
+
// Test that the preview images are updated when the theme changes.
const { getTheme, setTheme } = require("devtools/client/shared/theme");
diff --git a/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js b/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js
index b2ebc87df4d8..2625cf4703e4 100644
--- a/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js
+++ b/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js
@@ -3,6 +3,8 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
+requestLongerTimeout(2);
+
// Tests that disabling the cache for a tab works as it should when toolboxes
// are not toggled.
loadHelperScript("helper_disable_cache.js");
diff --git a/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js b/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js
index 0f71c8579e06..3861d3cdb977 100644
--- a/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js
+++ b/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js
@@ -3,6 +3,8 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
+requestLongerTimeout(2);
+
// Tests that disabling the cache for a tab works as it should when toolboxes
// are toggled.
loadHelperScript("helper_disable_cache.js");
diff --git a/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js b/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js
index b42a643ab83a..73c06e10a845 100644
--- a/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js
+++ b/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
var {Toolbox} = require("devtools/client/framework/toolbox");
var toolbox, toolIDs, idIndex, secondTime = false,
diff --git a/devtools/client/framework/test/browser_toolbox_window_reload_target.js b/devtools/client/framework/test/browser_toolbox_window_reload_target.js
index a99bc519fd1a..71a65b9a2b71 100644
--- a/devtools/client/framework/test/browser_toolbox_window_reload_target.js
+++ b/devtools/client/framework/test/browser_toolbox_window_reload_target.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
const TEST_URL = "data:text/html;charset=utf-8,"+
"Test reload"+
"
Testing reload from devtools
";
diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-inline.js b/devtools/client/inspector/test/browser_inspector_highlighter-inline.js
index 0299f251320f..1abddafeff88 100644
--- a/devtools/client/inspector/test/browser_inspector_highlighter-inline.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-inline.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that highlighting various inline boxes displays the right number of
// polygons in the page.
diff --git a/devtools/client/markupview/test/browser_markupview_anonymous_02.js b/devtools/client/markupview/test/browser_markupview_anonymous_02.js
index 6847f08658b2..d8dc826a163d 100644
--- a/devtools/client/markupview/test/browser_markupview_anonymous_02.js
+++ b/devtools/client/markupview/test/browser_markupview_anonymous_02.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test XBL anonymous content in the markupview
const TEST_URL = "chrome://devtools/content/scratchpad/scratchpad.xul";
diff --git a/devtools/client/markupview/test/browser_markupview_dragdrop_reorder.js b/devtools/client/markupview/test/browser_markupview_dragdrop_reorder.js
index 8fafcc7ef8d7..98164e2a4fbd 100644
--- a/devtools/client/markupview/test/browser_markupview_dragdrop_reorder.js
+++ b/devtools/client/markupview/test/browser_markupview_dragdrop_reorder.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test different kinds of drag and drop node re-ordering.
const TEST_URL = TEST_URL_ROOT + "doc_markup_dragdrop.html";
diff --git a/devtools/client/markupview/test/browser_markupview_events_jquery_1.6.js b/devtools/client/markupview/test/browser_markupview_events_jquery_1.6.js
index 78ecb01216e5..3c1e76962a29 100644
--- a/devtools/client/markupview/test/browser_markupview_events_jquery_1.6.js
+++ b/devtools/client/markupview/test/browser_markupview_events_jquery_1.6.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that markup view event bubbles show the correct event info for jQuery
// and jQuery Live events (jQuery version 1.6).
diff --git a/devtools/client/markupview/test/browser_markupview_events_jquery_1.7.js b/devtools/client/markupview/test/browser_markupview_events_jquery_1.7.js
index a1c316fba2ec..ad238b8059c0 100644
--- a/devtools/client/markupview/test/browser_markupview_events_jquery_1.7.js
+++ b/devtools/client/markupview/test/browser_markupview_events_jquery_1.7.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that markup view event bubbles show the correct event info for jQuery
// and jQuery Live events (jQuery version 1.7).
diff --git a/devtools/client/markupview/test/browser_markupview_events_jquery_2.1.1.js b/devtools/client/markupview/test/browser_markupview_events_jquery_2.1.1.js
index a43adb5a2e08..17bade18522a 100644
--- a/devtools/client/markupview/test/browser_markupview_events_jquery_2.1.1.js
+++ b/devtools/client/markupview/test/browser_markupview_events_jquery_2.1.1.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Test that markup view event bubbles show the correct event info for jQuery
// and jQuery Live events (jQuery version 2.1.1).
diff --git a/devtools/client/markupview/test/browser_markupview_keybindings_01.js b/devtools/client/markupview/test/browser_markupview_keybindings_01.js
index 3c37739b512a..39654d7ad57a 100644
--- a/devtools/client/markupview/test/browser_markupview_keybindings_01.js
+++ b/devtools/client/markupview/test/browser_markupview_keybindings_01.js
@@ -4,6 +4,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Tests tabbing through attributes on a node
const TEST_URL = "data:text/html;charset=utf8,";
diff --git a/devtools/client/markupview/test/browser_markupview_keybindings_04.js b/devtools/client/markupview/test/browser_markupview_keybindings_04.js
index 2529641b3e87..357ad4022438 100644
--- a/devtools/client/markupview/test/browser_markupview_keybindings_04.js
+++ b/devtools/client/markupview/test/browser_markupview_keybindings_04.js
@@ -5,6 +5,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Tests that selecting a node using the browser context menu (inspect element)
// or the element picker focuses that node so that the keyboard can be used
// immediately.
diff --git a/devtools/client/performance/test/browser_perf-categories-js-calltree.js b/devtools/client/performance/test/browser_perf-categories-js-calltree.js
index 111c8fecd838..db82ac5a2372 100644
--- a/devtools/client/performance/test/browser_perf-categories-js-calltree.js
+++ b/devtools/client/performance/test/browser_perf-categories-js-calltree.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the categories are shown in the js call tree when platform data
* is enabled.
diff --git a/devtools/client/performance/test/browser_perf-console-record-05.js b/devtools/client/performance/test/browser_perf-console-record-05.js
index 5e92ce90a9d8..3f49aba7a28e 100644
--- a/devtools/client/performance/test/browser_perf-console-record-05.js
+++ b/devtools/client/performance/test/browser_perf-console-record-05.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that multiple recordings with the same label (non-overlapping) appear
* in the recording list.
diff --git a/devtools/client/performance/test/browser_perf-details-03.js b/devtools/client/performance/test/browser_perf-details-03.js
index 7b77a43e8581..6bfce6c0b50f 100644
--- a/devtools/client/performance/test/browser_perf-details-03.js
+++ b/devtools/client/performance/test/browser_perf-details-03.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the details view hides the memory buttons when a recording does not
* have memory data (withMemory: false), and that when a memory panel is selected,
diff --git a/devtools/client/performance/test/browser_perf-details-04.js b/devtools/client/performance/test/browser_perf-details-04.js
index f5af138a52e8..abb03af79205 100644
--- a/devtools/client/performance/test/browser_perf-details-04.js
+++ b/devtools/client/performance/test/browser_perf-details-04.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the details view hides the toolbar buttons when a recording
* doesn't exist or is in progress.
diff --git a/devtools/client/performance/test/browser_perf-details-05.js b/devtools/client/performance/test/browser_perf-details-05.js
index ccd3979c570a..740dfa99a276 100644
--- a/devtools/client/performance/test/browser_perf-details-05.js
+++ b/devtools/client/performance/test/browser_perf-details-05.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the details view utility functions work as advertised.
*/
diff --git a/devtools/client/performance/test/browser_perf-details-06.js b/devtools/client/performance/test/browser_perf-details-06.js
index 258bd1366fb1..9dbf74ec25e2 100644
--- a/devtools/client/performance/test/browser_perf-details-06.js
+++ b/devtools/client/performance/test/browser_perf-details-06.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the views with `shouldUpdateWhileMouseIsActive` works as intended.
*/
diff --git a/devtools/client/performance/test/browser_perf-details-calltree-render.js b/devtools/client/performance/test/browser_perf-details-calltree-render.js
index ec2aab652b84..61e6c0778bd5 100644
--- a/devtools/client/performance/test/browser_perf-details-calltree-render.js
+++ b/devtools/client/performance/test/browser_perf-details-calltree-render.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the call tree view renders content after recording.
*/
diff --git a/devtools/client/performance/test/browser_perf-jit-view-01.js b/devtools/client/performance/test/browser_perf-jit-view-01.js
index a5b6f1099ee9..552f08cb2bdc 100644
--- a/devtools/client/performance/test/browser_perf-jit-view-01.js
+++ b/devtools/client/performance/test/browser_perf-jit-view-01.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the JIT Optimizations view renders optimization data
* if on, and displays selected frames on focus.
diff --git a/devtools/client/performance/test/browser_perf-legacy-front-01.js b/devtools/client/performance/test/browser_perf-legacy-front-01.js
index 70c9642980cf..f01ee8b2ad17 100644
--- a/devtools/client/performance/test/browser_perf-legacy-front-01.js
+++ b/devtools/client/performance/test/browser_perf-legacy-front-01.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that when setting recording features in the UI (like enabling framerate or memory),
* if the target does not support these features, then the target's support overrides
diff --git a/devtools/client/performance/test/browser_perf-legacy-front-02.js b/devtools/client/performance/test/browser_perf-legacy-front-02.js
index 5587031ff6d0..0537fe6850b8 100644
--- a/devtools/client/performance/test/browser_perf-legacy-front-02.js
+++ b/devtools/client/performance/test/browser_perf-legacy-front-02.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the recording model is populated correctly when using timeline
* and memory actor mocks, and the correct views are shown.
diff --git a/devtools/client/performance/test/browser_perf-loading-02.js b/devtools/client/performance/test/browser_perf-loading-02.js
index 2519d112ae1a..09aa7f6f71e2 100644
--- a/devtools/client/performance/test/browser_perf-loading-02.js
+++ b/devtools/client/performance/test/browser_perf-loading-02.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the details view is locked after recording has stopped and before
* the recording has finished loading.
diff --git a/devtools/client/performance/test/browser_perf-options-enable-framerate.js b/devtools/client/performance/test/browser_perf-options-enable-framerate.js
index cc0cd274506f..5f39daa62325 100644
--- a/devtools/client/performance/test/browser_perf-options-enable-framerate.js
+++ b/devtools/client/performance/test/browser_perf-options-enable-framerate.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that `enable-framerate` toggles the visibility of the fps graph,
* as well as enabling ticks data on the PerformanceFront.
diff --git a/devtools/client/performance/test/browser_perf-options-show-idle-blocks-01.js b/devtools/client/performance/test/browser_perf-options-show-idle-blocks-01.js
index e8124223aaf8..d4d4ae6543ac 100644
--- a/devtools/client/performance/test/browser_perf-options-show-idle-blocks-01.js
+++ b/devtools/client/performance/test/browser_perf-options-show-idle-blocks-01.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the js flamegraphs get rerendered when toggling `show-idle-blocks`
*/
diff --git a/devtools/client/performance/test/browser_perf-options-show-platform-data-01.js b/devtools/client/performance/test/browser_perf-options-show-platform-data-01.js
index 251a8b40bc38..3868399aa19e 100644
--- a/devtools/client/performance/test/browser_perf-options-show-platform-data-01.js
+++ b/devtools/client/performance/test/browser_perf-options-show-platform-data-01.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the js call tree views get rerendered when toggling `show-platform-data`
*/
diff --git a/devtools/client/performance/test/browser_perf-overview-selection-01.js b/devtools/client/performance/test/browser_perf-overview-selection-01.js
index 7c1e5b4cc290..448160dc5201 100644
--- a/devtools/client/performance/test/browser_perf-overview-selection-01.js
+++ b/devtools/client/performance/test/browser_perf-overview-selection-01.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that events are fired from OverviewView from selection manipulation.
*/
diff --git a/devtools/client/performance/test/browser_perf-overview-selection-02.js b/devtools/client/performance/test/browser_perf-overview-selection-02.js
index 3f5541f47402..2e161da1a176 100644
--- a/devtools/client/performance/test/browser_perf-overview-selection-02.js
+++ b/devtools/client/performance/test/browser_perf-overview-selection-02.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that the graphs' selection is correctly disabled or enabled.
*/
diff --git a/devtools/client/performance/test/browser_perf-private-browsing.js b/devtools/client/performance/test/browser_perf-private-browsing.js
index c43d4a0b368a..5d6ce557d985 100644
--- a/devtools/client/performance/test/browser_perf-private-browsing.js
+++ b/devtools/client/performance/test/browser_perf-private-browsing.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Tests that disables the frontend when in private browsing mode.
*/
diff --git a/devtools/client/performance/test/browser_perf-refresh.js b/devtools/client/performance/test/browser_perf-refresh.js
index 345d9e096d31..24f6be284ad6 100644
--- a/devtools/client/performance/test/browser_perf-refresh.js
+++ b/devtools/client/performance/test/browser_perf-refresh.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
/**
* Rough test that the recording still continues after a refresh.
*/
diff --git a/devtools/client/shared/test/browser_filter-editor-05.js b/devtools/client/shared/test/browser_filter-editor-05.js
index b12132b5e4ee..95d85098838f 100644
--- a/devtools/client/shared/test/browser_filter-editor-05.js
+++ b/devtools/client/shared/test/browser_filter-editor-05.js
@@ -3,6 +3,8 @@
"use strict";
+requestLongerTimeout(2);
+
// Tests the Filter Editor Widget's label-dragging
const TEST_URI = "chrome://devtools/content/shared/widgets/filter-frame.xhtml";
diff --git a/devtools/client/sourceeditor/test/browser_vimemacs.js b/devtools/client/sourceeditor/test/browser_vimemacs.js
index 05c12be89320..6680bc8628f9 100644
--- a/devtools/client/sourceeditor/test/browser_vimemacs.js
+++ b/devtools/client/sourceeditor/test/browser_vimemacs.js
@@ -3,6 +3,8 @@
"use strict";
+requestLongerTimeout(2);
+
const URI = "chrome://mochitests/content/browser/devtools/client" +
"/sourceeditor/test/codemirror/vimemacs.html";
loadHelperScript("helper_codemirror_runner.js");
diff --git a/devtools/shared/heapsnapshot/AutoMemMap.cpp b/devtools/shared/heapsnapshot/AutoMemMap.cpp
index 162ee5d5ede6..c9b821d787a7 100644
--- a/devtools/shared/heapsnapshot/AutoMemMap.cpp
+++ b/devtools/shared/heapsnapshot/AutoMemMap.cpp
@@ -29,7 +29,7 @@ AutoMemMap::~AutoMemMap()
}
nsresult
-AutoMemMap::init(const char* filePath, PRIntn flags, PRIntn mode, PRFileMapProtect prot)
+AutoMemMap::init(const char* filePath, int flags, int mode, PRFileMapProtect prot)
{
MOZ_ASSERT(!fd);
MOZ_ASSERT(!fileMap);
diff --git a/devtools/shared/heapsnapshot/AutoMemMap.h b/devtools/shared/heapsnapshot/AutoMemMap.h
index 2b378704eb09..537d680042ec 100644
--- a/devtools/shared/heapsnapshot/AutoMemMap.h
+++ b/devtools/shared/heapsnapshot/AutoMemMap.h
@@ -54,7 +54,7 @@ public:
~AutoMemMap();
// Initialize this AutoMemMap.
- nsresult init(const char* filePath, PRIntn flags = PR_RDONLY, PRIntn mode = 0,
+ nsresult init(const char* filePath, int flags = PR_RDONLY, int mode = 0,
PRFileMapProtect prot = PR_PROT_READONLY);
// Get the size of the memory mapped file.
diff --git a/dom/base/nsWrapperCache.cpp b/dom/base/nsWrapperCache.cpp
index 0b19e1a3630f..e1d88feaee10 100644
--- a/dom/base/nsWrapperCache.cpp
+++ b/dom/base/nsWrapperCache.cpp
@@ -9,6 +9,7 @@
#include "js/Class.h"
#include "js/Proxy.h"
#include "mozilla/dom/DOMJSProxyHandler.h"
+#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/HoldDropJSObjects.h"
#include "nsCycleCollectionTraversalCallback.h"
#include "nsCycleCollector.h"
@@ -24,11 +25,25 @@ nsWrapperCache::HasJSObjectMovedOp(JSObject* aWrapper)
}
#endif
-/* static */ void
+void
nsWrapperCache::HoldJSObjects(void* aScriptObjectHolder,
nsScriptObjectTracer* aTracer)
{
cyclecollector::HoldJSObjectsImpl(aScriptObjectHolder, aTracer);
+ if (mWrapper && !JS::ObjectIsTenured(mWrapper)) {
+ CycleCollectedJSRuntime::Get()->NurseryWrapperPreserved(mWrapper);
+ }
+}
+
+void
+nsWrapperCache::SetWrapperJSObject(JSObject* aWrapper)
+{
+ mWrapper = aWrapper;
+ UnsetWrapperFlags(kWrapperFlagsMask & ~WRAPPER_IS_NOT_DOM_BINDING);
+
+ if (aWrapper && !JS::ObjectIsTenured(aWrapper)) {
+ CycleCollectedJSRuntime::Get()->NurseryWrapperAdded(this);
+ }
}
void
diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h
index af645a66a8b4..0c8daaa35baa 100644
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -258,14 +258,15 @@ protected:
void TraceWrapper(JSTracer* aTrc, const char* name)
{
if (mWrapper) {
- JS_CallObjectTracer(aTrc, &mWrapper, name);
+ JS_CallUnbarrieredObjectTracer(aTrc, &mWrapper, name);
}
}
void PoisonWrapper()
{
if (mWrapper) {
- mWrapper.setToCrashOnTouch();
+ // See setToCrashOnTouch() in RootingAPI.h
+ mWrapper = reinterpret_cast(1);
}
}
@@ -287,13 +288,7 @@ private:
return mWrapper;
}
- void SetWrapperJSObject(JSObject* aWrapper)
- {
- mWrapper = aWrapper;
- UnsetWrapperFlags(kWrapperFlagsMask & ~WRAPPER_IS_NOT_DOM_BINDING);
- }
-
- void TraceWrapperJSObject(JSTracer* aTrc, const char* aName);
+ void SetWrapperJSObject(JSObject* aWrapper);
FlagsType GetWrapperFlags() const
{
@@ -318,8 +313,8 @@ private:
mFlags &= ~aFlagsToUnset;
}
- static void HoldJSObjects(void* aScriptObjectHolder,
- nsScriptObjectTracer* aTracer);
+ void HoldJSObjects(void* aScriptObjectHolder,
+ nsScriptObjectTracer* aTracer);
#ifdef DEBUG
public:
@@ -349,8 +344,8 @@ private:
enum { kWrapperFlagsMask = (WRAPPER_BIT_PRESERVED | WRAPPER_IS_NOT_DOM_BINDING) };
- JS::Heap mWrapper;
- FlagsType mFlags;
+ JSObject* mWrapper;
+ FlagsType mFlags;
};
enum { WRAPPER_CACHE_FLAGS_BITS_USED = 2 };
diff --git a/dom/base/nsWrapperCacheInlines.h b/dom/base/nsWrapperCacheInlines.h
index 6bba5350acf9..f91e5db591ea 100644
--- a/dom/base/nsWrapperCacheInlines.h
+++ b/dom/base/nsWrapperCacheInlines.h
@@ -53,10 +53,4 @@ nsWrapperCache::IsBlackAndDoesNotNeedTracing(nsISupports* aThis)
return IsBlack() && HasNothingToTrace(aThis);
}
-inline void
-nsWrapperCache::TraceWrapperJSObject(JSTracer* aTrc, const char* aName)
-{
- JS_CallObjectTracer(aTrc, &mWrapper, aName);
-}
-
#endif /* nsWrapperCache_h___ */
diff --git a/dom/base/test/browser_use_counters.js b/dom/base/test/browser_use_counters.js
index 304a831039aa..48a3b76abc6b 100644
--- a/dom/base/test/browser_use_counters.js
+++ b/dom/base/test/browser_use_counters.js
@@ -1,5 +1,7 @@
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+requestLongerTimeout(2);
+
var {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
const gHttpTestRoot = "http://example.com/browser/dom/base/test/";
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py
index 66d66c9fb879..6dfe6825f270 100644
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -422,6 +422,8 @@ class CGDOMJSClass(CGThing):
classFlags += "JSCLASS_HAS_RESERVED_SLOTS(%d)" % slotCount
traceHook = 'nullptr'
reservedSlots = slotCount
+ if self.descriptor.interface.isProbablyShortLivingObject():
+ classFlags += " | JSCLASS_SKIP_NURSERY_FINALIZE"
if self.descriptor.interface.getExtendedAttribute("NeedResolve"):
resolveHook = RESOLVE_HOOK_NAME
mayResolveHook = MAY_RESOLVE_HOOK_NAME
diff --git a/dom/bindings/Makefile.in b/dom/bindings/Makefile.in
index 8875e103518c..2161aa5a17e9 100644
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -2,7 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-abs_dist := $(abspath $(DIST))
webidl_base := $(topsrcdir)/dom/webidl
# Generated by moz.build
diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py
index bee6af4d92cc..e664988d2c01 100644
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -564,6 +564,9 @@ class IDLExternalInterface(IDLObjectWithIdentifier, IDLExposureMixins):
def isJSImplemented(self):
return False
+ def isProbablyShortLivingObject(self):
+ return False
+
def getNavigatorProperty(self):
return None
@@ -1408,7 +1411,8 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
identifier == "ChromeOnly" or
identifier == "Unforgeable" or
identifier == "UnsafeInPrerendering" or
- identifier == "LegacyEventInit"):
+ identifier == "LegacyEventInit" or
+ identifier == "ProbablyShortLivingObject"):
# Known extended attributes that do not take values
if not attr.noArguments():
raise WebIDLError("[%s] must take no arguments" % identifier,
@@ -1522,6 +1526,14 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
def isJSImplemented(self):
return bool(self.getJSImplementation())
+ def isProbablyShortLivingObject(self):
+ current = self
+ while current:
+ if current.getExtendedAttribute("ProbablyShortLivingObject"):
+ return True
+ current = current.parent
+ return False
+
def getNavigatorProperty(self):
naviProp = self.getExtendedAttribute("NavigatorProperty")
if not naviProp:
diff --git a/dom/canvas/WebGLContextBuffers.cpp b/dom/canvas/WebGLContextBuffers.cpp
index 7a221782e8d7..1e6497c9b43c 100644
--- a/dom/canvas/WebGLContextBuffers.cpp
+++ b/dom/canvas/WebGLContextBuffers.cpp
@@ -177,7 +177,9 @@ WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage)
}
boundBuffer->SetByteLength(size);
+
if (!boundBuffer->ElementArrayCacheBufferData(nullptr, size)) {
+ boundBuffer->SetByteLength(0);
return ErrorOutOfMemory("bufferData: out of memory");
}
}
@@ -227,9 +229,12 @@ WebGLContext::BufferDataT(GLenum target,
}
boundBuffer->SetByteLength(data.LengthAllowShared());
+
// Warning: Possibly shared memory. See bug 1225033.
- if (!boundBuffer->ElementArrayCacheBufferData(data.DataAllowShared(), data.LengthAllowShared()))
+ if (!boundBuffer->ElementArrayCacheBufferData(data.DataAllowShared(), data.LengthAllowShared())) {
+ boundBuffer->SetByteLength(0);
return ErrorOutOfMemory("bufferData: out of memory");
+ }
}
void
diff --git a/dom/devicestorage/DeviceStorageStatics.cpp b/dom/devicestorage/DeviceStorageStatics.cpp
index d8fed46d4ad3..6db92455366d 100644
--- a/dom/devicestorage/DeviceStorageStatics.cpp
+++ b/dom/devicestorage/DeviceStorageStatics.cpp
@@ -131,6 +131,30 @@ DeviceStorageStatics::InitDirs()
sMutex.AssertCurrentThreadOwns();
DS_LOG_INFO("");
+#if !defined(MOZ_WIDGET_GONK)
+ if (!XRE_IsParentProcess()) {
+ // For gonk, we have the parent process forward the directory information
+ // to the child using ContentParent::ForwardKnownInfo. On desktop, this
+ // winds up slowing down the startup (in particular ts_paint), so rather
+ // than penalize all e10s processes, we do a synchronous IPC call here,
+ // which only penalizes child processes which actually use DeviceStorage.
+
+ dom::ContentChild* child = dom::ContentChild::GetSingleton();
+ DeviceStorageLocationInfo locationInfo;
+ child->SendGetDeviceStorageLocations(&locationInfo);
+
+ NS_NewLocalFile(locationInfo.apps(), true, getter_AddRefs(sInstance->mDirs[TYPE_APPS]));
+ NS_NewLocalFile(locationInfo.crashes(), true, getter_AddRefs(sInstance->mDirs[TYPE_CRASHES]));
+ NS_NewLocalFile(locationInfo.pictures(), true, getter_AddRefs(sInstance->mDirs[TYPE_PICTURES]));
+ NS_NewLocalFile(locationInfo.videos(), true, getter_AddRefs(sInstance->mDirs[TYPE_VIDEOS]));
+ NS_NewLocalFile(locationInfo.music(), true, getter_AddRefs(sInstance->mDirs[TYPE_MUSIC]));
+ NS_NewLocalFile(locationInfo.sdcard(), true, getter_AddRefs(sInstance->mDirs[TYPE_SDCARD]));
+
+ sInstance->mInitialized = true;
+ return;
+ }
+#endif
+
nsCOMPtr dirService
= do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
MOZ_ASSERT(dirService);
@@ -271,6 +295,13 @@ DeviceStorageStatics::DumpDirs()
nullptr
};
+ const char* ptStr;
+ if (XRE_IsParentProcess()) {
+ ptStr = "parent";
+ } else {
+ ptStr = "child";
+ }
+
for (uint32_t i = 0; i < TYPE_COUNT; ++i) {
MOZ_ASSERT(storageTypes[i]);
@@ -278,8 +309,8 @@ DeviceStorageStatics::DumpDirs()
if (mDirs[i]) {
mDirs[i]->GetPath(path);
}
- DS_LOG_INFO("%s: '%s'",
- storageTypes[i], NS_LossyConvertUTF16toASCII(path).get());
+ DS_LOG_INFO("(%s) %s: '%s'",
+ ptStr, storageTypes[i], NS_LossyConvertUTF16toASCII(path).get());
}
#endif
}
@@ -297,6 +328,23 @@ DeviceStorageStatics::Shutdown()
Preferences::RemoveObserver(this, kPrefWritableName);
}
+/* static */ void
+DeviceStorageStatics::GetDeviceStorageLocationsForIPC(
+ DeviceStorageLocationInfo* aLocationInfo)
+{
+ MOZ_ASSERT(XRE_IsParentProcess());
+ MOZ_ASSERT(NS_IsMainThread());
+
+ InitializeDirs();
+
+ GetDirPath(TYPE_APPS, aLocationInfo->apps());
+ GetDirPath(TYPE_CRASHES, aLocationInfo->crashes());
+ GetDirPath(TYPE_PICTURES, aLocationInfo->pictures());
+ GetDirPath(TYPE_VIDEOS, aLocationInfo->videos());
+ GetDirPath(TYPE_MUSIC, aLocationInfo->music());
+ GetDirPath(TYPE_SDCARD, aLocationInfo->sdcard());
+}
+
/* static */ already_AddRefed
DeviceStorageStatics::GetDir(DeviceStorageType aType)
{
@@ -332,6 +380,16 @@ DeviceStorageStatics::GetDir(DeviceStorageType aType)
return file.forget();
}
+/* static */ void
+DeviceStorageStatics::GetDirPath(DeviceStorageType aType, nsString& aDirPath)
+{
+ aDirPath.Truncate();
+ nsCOMPtr file = GetDir(aType);
+ if (file) {
+ file->GetPath(aDirPath);
+ }
+}
+
/* static */ bool
DeviceStorageStatics::HasOverrideRootDir()
{
diff --git a/dom/devicestorage/DeviceStorageStatics.h b/dom/devicestorage/DeviceStorageStatics.h
index 5fa7d9b4164e..2c8fa0b0f07e 100644
--- a/dom/devicestorage/DeviceStorageStatics.h
+++ b/dom/devicestorage/DeviceStorageStatics.h
@@ -8,7 +8,12 @@
#define mozilla_dom_devicestorage_DeviceStorageStatics_h
#include "mozilla/Mutex.h"
+#include "mozilla/RefPtr.h"
+#include "mozilla/StaticMutex.h"
+#include "mozilla/StaticPtr.h"
+#include "nsArrayUtils.h"
+class nsString;
class nsDOMDeviceStorage;
class DeviceStorageFile;
#ifdef MOZ_WIDGET_GONK
@@ -35,6 +40,8 @@ public:
static void GetWritableName(nsString& aName);
static void SetWritableName(const nsAString& aName);
+ static void GetDeviceStorageLocationsForIPC(DeviceStorageLocationInfo* aLocationInfo);
+
static bool HasOverrideRootDir();
static already_AddRefed GetAppsDir();
static already_AddRefed GetCrashesDir();
@@ -56,6 +63,7 @@ private:
};
static already_AddRefed GetDir(DeviceStorageType aType);
+ static void GetDirPath(DeviceStorageType aType, nsString& aString);
DeviceStorageStatics();
virtual ~DeviceStorageStatics();
diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp
index 9d12b2fb4609..e600094e90c9 100644
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -237,9 +237,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
JSObject*
Event::WrapObject(JSContext* aCx, JS::Handle aGivenProto)
{
- if (mIsMainThreadEvent && !GetWrapperPreserveColor()) {
- nsJSContext::LikelyShortLivingObjectCreated();
- }
return WrapObjectInternal(aCx, aGivenProto);
}
diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp
index 819e8a5bc336..9584a14d4319 100644
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1210,6 +1210,10 @@ EventStateManager::DispatchCrossProcessEvent(WidgetEvent* aEvent,
return retval;
}
+ case ePluginEventClass: {
+ *aStatus = nsEventStatus_eConsumeNoDefault;
+ return remote->SendPluginEvent(*aEvent->AsPluginEvent());
+ }
default: {
MOZ_CRASH("Attempt to send non-whitelisted event?");
}
diff --git a/dom/events/TextComposition.cpp b/dom/events/TextComposition.cpp
index fbcdb4cdea74..f2cefeb44ca0 100644
--- a/dom/events/TextComposition.cpp
+++ b/dom/events/TextComposition.cpp
@@ -20,6 +20,21 @@
#include "mozilla/unused.h"
#include "mozilla/dom/TabParent.h"
+#ifdef XP_MACOSX
+// Some defiens will be conflict with OSX SDK
+#define TextRange _TextRange
+#define TextRangeArray _TextRangeArray
+#define Comment _Comment
+#endif
+
+#include "nsPluginInstanceOwner.h"
+
+#ifdef XP_MACOSX
+#undef TextRange
+#undef TextRangeArray
+#undef Comment
+#endif
+
using namespace mozilla::widget;
namespace mozilla {
@@ -117,12 +132,26 @@ TextComposition::CloneAndDispatchAs(
nsEventStatus* status = aStatus ? aStatus : &dummyStatus;
if (aMessage == eCompositionUpdate) {
mLastData = compositionEvent.mData;
+ mLastRanges = aCompositionEvent->mRanges;
}
- EventDispatcher::Dispatch(mNode, mPresContext,
- &compositionEvent, nullptr, status, aCallBack);
+
+ DispatchEvent(&compositionEvent, status, aCallBack, aCompositionEvent);
return compositionEvent.mFlags;
}
+void
+TextComposition::DispatchEvent(WidgetCompositionEvent* aDispatchEvent,
+ nsEventStatus* aStatus,
+ EventDispatchingCallback* aCallBack,
+ const WidgetCompositionEvent *aOriginalEvent)
+{
+ nsPluginInstanceOwner::GeneratePluginEvent(aOriginalEvent,
+ aDispatchEvent);
+
+ EventDispatcher::Dispatch(mNode, mPresContext,
+ aDispatchEvent, nullptr, aStatus, aCallBack);
+}
+
void
TextComposition::OnCompositionEventDiscarded(
WidgetCompositionEvent* aCompositionEvent)
@@ -217,6 +246,7 @@ TextComposition::DispatchCompositionEvent(
aCompositionEvent->mFlags.mPropagationStopped = true;
if (aCompositionEvent->CausesDOMTextEvent()) {
mLastData = aCompositionEvent->mData;
+ mLastRanges = aCompositionEvent->mRanges;
// Although, the composition event hasn't been actually handled yet,
// emulate an editor to be handling the composition event.
EditorWillHandleCompositionChangeEvent(aCompositionEvent);
@@ -341,8 +371,7 @@ TextComposition::DispatchCompositionEvent(
CloneAndDispatchAs(aCompositionEvent, eCompositionChange,
aStatus, aCallBack);
} else {
- EventDispatcher::Dispatch(mNode, mPresContext,
- aCompositionEvent, nullptr, aStatus, aCallBack);
+ DispatchEvent(aCompositionEvent, aStatus, aCallBack);
}
} else {
*aStatus = nsEventStatus_eConsumeNoDefault;
diff --git a/dom/events/TextComposition.h b/dom/events/TextComposition.h
index 12cca5bbff11..6ddcde248019 100644
--- a/dom/events/TextComposition.h
+++ b/dom/events/TextComposition.h
@@ -61,6 +61,10 @@ public:
// Note that mString and mLastData are different between dispatcing
// compositionupdate and compositionchange event handled by focused editor.
const nsString& String() const { return mString; }
+ // The latest clauses range of the composition string.
+ // During compositionupdate event, GetRanges() returns old ranges.
+ // So if getting on compositionupdate, Use GetLastRange instead of GetRange().
+ TextRangeArray* GetLastRanges() const { return mLastRanges; }
// Returns the clauses and/or caret range of the composition string.
// This is modified at a call of EditorWillHandleCompositionChangeEvent().
// This may return null if there is no clauses and caret.
@@ -191,6 +195,9 @@ private:
// This is the clause and caret range information which is managed by
// the focused editor. This may be null if there is no clauses or caret.
RefPtr mRanges;
+ // Same as mRange, but mRange will have old data during compositionupdate.
+ // So this will be valied during compositionupdate.
+ RefPtr mLastRanges;
// mNativeContext stores a opaque pointer. This works as the "ID" for this
// composition. Don't access the instance, it may not be available.
@@ -293,6 +300,15 @@ private:
EventDispatchingCallback* aCallBack,
bool aIsSynthesized);
+ /**
+ * Simply calling EventDispatcher::Dispatch() with plugin event.
+ * If dispatching event has no orginal clone, aOriginalEvent can be null.
+ */
+ void DispatchEvent(WidgetCompositionEvent* aDispatchEvent,
+ nsEventStatus* aStatus,
+ EventDispatchingCallback* aCallback,
+ const WidgetCompositionEvent *aOriginalEvent = nullptr);
+
/**
* HandleSelectionEvent() sends the selection event to ContentEventHandler
* or dispatches it to the focused child process.
diff --git a/dom/html/HTMLSharedListElement.cpp b/dom/html/HTMLSharedListElement.cpp
index 61d5ba15d385..e63a980a36e8 100644
--- a/dom/html/HTMLSharedListElement.cpp
+++ b/dom/html/HTMLSharedListElement.cpp
@@ -99,11 +99,8 @@ HTMLSharedListElement::MapAttributesIntoRule(const nsMappedAttributes* aAttribut
if (listStyleType->GetUnit() == eCSSUnit_Null) {
// type: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
- if (value) {
- if (value->Type() == nsAttrValue::eEnum)
- listStyleType->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
- else
- listStyleType->SetIntValue(NS_STYLE_LIST_STYLE_DECIMAL, eCSSUnit_Enumerated);
+ if (value && value->Type() == nsAttrValue::eEnum) {
+ listStyleType->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
}
}
}
diff --git a/dom/html/test/browser_bug1108547.js b/dom/html/test/browser_bug1108547.js
index a36177e865a2..ee872e199586 100644
--- a/dom/html/test/browser_bug1108547.js
+++ b/dom/html/test/browser_bug1108547.js
@@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+requestLongerTimeout(2);
+
function test() {
waitForExplicitFinish();
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index d40cb331ca5b..9d6675139f7d 100755
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -30,6 +30,7 @@
#include "AudioChannelService.h"
#include "BlobParent.h"
#include "CrashReporterParent.h"
+#include "DeviceStorageStatics.h"
#include "GMPServiceParent.h"
#include "HandlerServiceParent.h"
#include "IHistory.h"
@@ -5780,6 +5781,13 @@ ContentParent::RecvGetDeviceStorageLocation(const nsString& aType,
#endif
}
+bool
+ContentParent::RecvGetDeviceStorageLocations(DeviceStorageLocationInfo* info)
+{
+ DeviceStorageStatics::GetDeviceStorageLocationsForIPC(info);
+ return true;
+}
+
bool
ContentParent::RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo)
{
diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h
index c6b0fafa16b3..d28ac058989b 100644
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -948,6 +948,8 @@ private:
virtual bool RecvGetDeviceStorageLocation(const nsString& aType,
nsString* aPath) override;
+ virtual bool RecvGetDeviceStorageLocations(DeviceStorageLocationInfo* info) override;
+
virtual bool RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo) override;
// If you add strong pointers to cycle collected objects here, be sure to
diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl
index 61dc5a4ce717..a5367aab0480 100644
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -52,6 +52,7 @@ using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h";
using struct nsRect from "nsRect.h";
using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
+using class mozilla::WidgetPluginEvent from "ipc/nsGUIEventIPC.h";
using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
@@ -280,6 +281,16 @@ parent:
*/
prio(urgent) async SetPluginFocused(bool aFocused);
+ /**
+ * Set IME candidate window by windowless plugin if plugin has focus.
+ */
+ async SetCandidateWindowForPlugin(int32_t aX, int32_t aY);
+
+ /**
+ * When plugin event isn't consumed, call this
+ */
+ async DefaultProcOfPluginEvent(WidgetPluginEvent aEvent);
+
/**
* Request that the parent process move focus to the browser's frame. If
* canRaise is true, the window can be raised if it is inactive.
@@ -634,6 +645,7 @@ child:
uint64_t aInputBlockId,
nsEventStatus aApzResponse);
RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction, uint32_t aDropEffect);
+ PluginEvent(WidgetPluginEvent aEvent);
/**
* @see nsIDOMWindowUtils sendKeyEvent.
diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl
index 95ba01c98a75..d516cb777a57 100644
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -219,6 +219,15 @@ union DeviceStorageParams
DeviceStorageUnmountParams;
};
+struct DeviceStorageLocationInfo {
+ nsString music;
+ nsString pictures;
+ nsString videos;
+ nsString sdcard;
+ nsString apps;
+ nsString crashes;
+};
+
struct FMRadioRequestEnableParams
{
double frequency;
@@ -1163,6 +1172,9 @@ parent:
sync GetDeviceStorageLocation(nsString type)
returns (nsString path);
+ sync GetDeviceStorageLocations()
+ returns (DeviceStorageLocationInfo info);
+
sync GetAndroidSystemInfo()
returns (AndroidSystemInfo info);
diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp
index b07b65018ecb..056b4ae1c030 100644
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1943,6 +1943,19 @@ TabChild::RecvRealDragEvent(const WidgetDragEvent& aEvent,
return true;
}
+bool
+TabChild::RecvPluginEvent(const WidgetPluginEvent& aEvent)
+{
+ WidgetPluginEvent localEvent(aEvent);
+ localEvent.widget = mPuppetWidget;
+ nsEventStatus status = APZCCallbackHelper::DispatchWidgetEvent(localEvent);
+ if (status != nsEventStatus_eConsumeNoDefault) {
+ // If not consumed, we should call default action
+ SendDefaultProcOfPluginEvent(aEvent);
+ }
+ return true;
+}
+
void
TabChild::RequestNativeKeyBindings(AutoCacheNativeKeyCommands* aAutoCache,
WidgetKeyboardEvent* aEvent)
diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h
index 1ba716afafe0..83c030a4159b 100644
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -379,6 +379,7 @@ public:
const nsString& aEvent) override;
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
const nsCString& aResponse) override;
+ virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override;
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) override;
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) override;
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) override;
diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp
index e05afeb186a1..95913d99e6d1 100644
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2396,6 +2396,31 @@ TabParent::RecvSetPluginFocused(const bool& aFocused)
return true;
}
+ bool
+TabParent::RecvSetCandidateWindowForPlugin(const int32_t& aX,
+ const int32_t& aY)
+{
+ nsCOMPtr widget = GetWidget();
+ if (!widget) {
+ return true;
+ }
+
+ widget->SetCandidateWindowForPlugin(aX, aY);
+ return true;
+}
+
+bool
+TabParent::RecvDefaultProcOfPluginEvent(const WidgetPluginEvent& aEvent)
+{
+ nsCOMPtr widget = GetWidget();
+ if (!widget) {
+ return true;
+ }
+
+ widget->DefaultProcOfPluginEvent(aEvent);
+ return true;
+}
+
bool
TabParent::RecvGetInputContext(int32_t* aIMEEnabled,
int32_t* aIMEOpen)
diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h
index 4d533f8bebf6..5b1efe49483d 100644
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -196,6 +196,10 @@ public:
const int32_t& aPanelY,
nsString* aCommitted) override;
virtual bool RecvSetPluginFocused(const bool& aFocused) override;
+ virtual bool RecvSetCandidateWindowForPlugin(const int32_t& aX,
+ const int32_t& aY) override;
+ virtual bool RecvDefaultProcOfPluginEvent(
+ const WidgetPluginEvent& aEvent) override;
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
int32_t* aIMEOpen) override;
virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js
index edb6a76d3a9b..f7358d6f3ac8 100644
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -1038,6 +1038,34 @@ RTCPeerConnection.prototype = {
});
},
+ _setParameters: function(sender, parameters) {
+ if (!Services.prefs.getBoolPref("media.peerconnection.simulcast")) {
+ return;
+ }
+ // validate parameters input
+ var encodings = parameters.encodings || [];
+
+ encodings.reduce((uniqueRids, encoding) => {
+ if (!encoding.rid && encodings.length > 1) {
+ throw new this._win.DOMException("Missing rid", "TypeError");
+ }
+ if (uniqueRids[encoding.rid]) {
+ throw new this._win.DOMException("Duplicate rid", "TypeError");
+ }
+ uniqueRids[encoding.rid] = true;
+ return uniqueRids;
+ }, {});
+
+ this._impl.setParameters(sender.track, parameters);
+ },
+
+ _getParameters: function(sender) {
+ if (!Services.prefs.getBoolPref("media.peerconnection.simulcast")) {
+ return;
+ }
+ return this._impl.getParameters(sender.track);
+ },
+
close: function() {
if (this._closed) {
return;
@@ -1494,6 +1522,14 @@ RTCRtpSender.prototype = {
replaceTrack: function(withTrack) {
return this._pc._chain(() => this._pc._replaceTrack(this, withTrack));
+ },
+
+ setParameters: function(parameters) {
+ return this._pc._setParameters(this, parameters);
+ },
+
+ getParameters: function() {
+ return this._pc._getParameters(this);
}
};
diff --git a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
index 3dafa11fa19d..8fc94ef3951b 100644
--- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
@@ -67,10 +67,8 @@ FFmpegH264Decoder::FFmpegH264Decoder(
ImageContainer* aImageContainer)
: FFmpegDataDecoder(aTaskQueue, aCallback, GetCodecId(aConfig.mMimeType))
, mImageContainer(aImageContainer)
- , mPictureWidth(aConfig.mImage.width)
- , mPictureHeight(aConfig.mImage.height)
- , mDisplayWidth(aConfig.mDisplay.width)
- , mDisplayHeight(aConfig.mDisplay.height)
+ , mDisplay(aConfig.mDisplay)
+ , mImage(aConfig.mImage)
{
MOZ_COUNT_CTOR(FFmpegH264Decoder);
// Use a new MediaByteBuffer as the object will be modified during initialization.
@@ -87,8 +85,8 @@ FFmpegH264Decoder::Init()
mCodecContext->get_buffer = AllocateBufferCb;
mCodecContext->release_buffer = ReleaseBufferCb;
- mCodecContext->width = mPictureWidth;
- mCodecContext->height = mPictureHeight;
+ mCodecContext->width = mImage.width;
+ mCodecContext->height = mImage.height;
return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
}
@@ -207,7 +205,7 @@ FFmpegH264Decoder::DoDecodeFrame(MediaRawData* aSample,
}
VideoInfo info;
- info.mDisplay = nsIntSize(mDisplayWidth, mDisplayHeight);
+ info.mDisplay = mDisplay;
VideoData::YCbCrBuffer b;
b.mPlanes[0].mData = mFrame->data[0];
@@ -236,7 +234,7 @@ FFmpegH264Decoder::DoDecodeFrame(MediaRawData* aSample,
b,
!!mFrame->key_frame,
-1,
- gfx::IntRect(0, 0, mCodecContext->width, mCodecContext->height));
+ mImage);
if (!v) {
NS_WARNING("image allocation error.");
mCallback->Error();
diff --git a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h
index 5a89815dba5e..b35d601cf2e5 100644
--- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h
@@ -64,10 +64,8 @@ private:
static void ReleaseBufferCb(AVCodecContext* aCodecContext, AVFrame* aFrame);
RefPtr mImageContainer;
- uint32_t mPictureWidth;
- uint32_t mPictureHeight;
- uint32_t mDisplayWidth;
- uint32_t mDisplayHeight;
+ nsIntSize mDisplay;
+ nsIntRect mImage;
class PtsCorrectionContext {
public:
diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini
index 323970df4e87..5d23ed830abc 100644
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -147,6 +147,8 @@ skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' &
[test_peerConnection_setLocalAnswerInHaveLocalOffer.html]
[test_peerConnection_setLocalAnswerInStable.html]
[test_peerConnection_setLocalOfferInHaveRemoteOffer.html]
+[test_peerConnection_setParameters.html]
+skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html]
[test_peerConnection_setRemoteAnswerInStable.html]
[test_peerConnection_setRemoteOfferInHaveLocalOffer.html]
diff --git a/dom/media/tests/mochitest/test_peerConnection_setParameters.html b/dom/media/tests/mochitest/test_peerConnection_setParameters.html
new file mode 100644
index 000000000000..2b5733c0bc92
--- /dev/null
+++ b/dom/media/tests/mochitest/test_peerConnection_setParameters.html
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp
index 15eff7a7419b..b132753d90af 100644
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -191,11 +191,11 @@ nsPluginHost *nsPluginHost::sInst;
/* we should probably put this into a global library now that this is the second
time we need this. */
static
-PRInt32
-busy_beaver_PR_Read(PRFileDesc *fd, void * start, PRInt32 len)
+int32_t
+busy_beaver_PR_Read(PRFileDesc *fd, void * start, int32_t len)
{
int n;
- PRInt32 remaining = len;
+ int32_t remaining = len;
while (remaining > 0)
{
diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp
index fed6b11e52fb..5ba6fb04d020 100644
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -60,6 +60,9 @@ using mozilla::DefaultXDisplay;
#include "nsFrameSelection.h"
#include "PuppetWidget.h"
#include "nsPIWindowRoot.h"
+#include "mozilla/IMEStateManager.h"
+#include "mozilla/TextComposition.h"
+#include "mozilla/AutoRestore.h"
#include "nsContentCID.h"
#include "nsWidgetsCID.h"
@@ -366,6 +369,11 @@ nsPluginInstanceOwner::nsPluginInstanceOwner()
mFullScreen = false;
mJavaView = nullptr;
#endif
+
+#ifdef XP_WIN
+ mGotCompositionData = false;
+ mSentStartComposition = false;
+#endif
}
nsPluginInstanceOwner::~nsPluginInstanceOwner()
@@ -791,7 +799,185 @@ nsPluginInstanceOwner::SetNetscapeWindowAsParent(HWND aWindowToAdopt)
reinterpret_cast(aWindowToAdopt));
return NS_OK;
}
-#endif
+
+bool
+nsPluginInstanceOwner::GetCompositionString(uint32_t aType,
+ nsTArray* aDist,
+ int32_t* aLength)
+{
+ // Mark pkugin calls ImmGetCompositionStringW correctly
+ mGotCompositionData = true;
+
+ RefPtr composition = GetTextComposition();
+ if (NS_WARN_IF(!composition)) {
+ return false;
+ }
+
+ switch(aType) {
+ case GCS_COMPSTR: {
+ if (!composition->IsComposing()) {
+ *aLength = 0;
+ return true;
+ }
+
+ uint32_t len = composition->LastData().Length() * sizeof(char16_t);
+ if (len) {
+ aDist->SetLength(len);
+ memcpy(aDist->Elements(), composition->LastData().get(), len);
+ }
+ *aLength = len;
+ return true;
+ }
+
+ case GCS_RESULTSTR: {
+ if (composition->IsComposing()) {
+ *aLength = 0;
+ return true;
+ }
+
+ uint32_t len = composition->LastData().Length() * sizeof(char16_t);
+ if (len) {
+ aDist->SetLength(len);
+ memcpy(aDist->Elements(), composition->LastData().get(), len);
+ }
+ *aLength = len;
+ return true;
+ }
+
+ case GCS_CURSORPOS: {
+ *aLength = 0;
+ TextRangeArray* ranges = composition->GetLastRanges();
+ if (!ranges) {
+ return true;
+ }
+ *aLength = ranges->GetCaretPosition();
+ if (*aLength < 0) {
+ return false;
+ }
+ return true;
+ }
+
+ case GCS_COMPATTR: {
+ TextRangeArray* ranges = composition->GetLastRanges();
+ if (!ranges || ranges->IsEmpty()) {
+ *aLength = 0;
+ return true;
+ }
+
+ aDist->SetLength(composition->LastData().Length());
+ memset(aDist->Elements(), ATTR_INPUT, aDist->Length());
+
+ for (TextRange& range : *ranges) {
+ uint8_t type = ATTR_INPUT;
+ switch(range.mRangeType) {
+ case NS_TEXTRANGE_RAWINPUT:
+ type = ATTR_INPUT;
+ break;
+ case NS_TEXTRANGE_SELECTEDRAWTEXT:
+ type = ATTR_TARGET_NOTCONVERTED;
+ break;
+ case NS_TEXTRANGE_CONVERTEDTEXT:
+ type = ATTR_CONVERTED;
+ break;
+ case NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
+ type = ATTR_TARGET_CONVERTED;
+ break;
+ default:
+ continue;
+ }
+
+ size_t minLen = std::min(range.mEndOffset, aDist->Length());
+ for (size_t i = range.mStartOffset; i < minLen; i++) {
+ (*aDist)[i] = type;
+ }
+ }
+ *aLength = aDist->Length();
+ return true;
+ }
+
+ case GCS_COMPCLAUSE: {
+ RefPtr ranges = composition->GetLastRanges();
+ if (!ranges || ranges->IsEmpty()) {
+ aDist->SetLength(sizeof(uint32_t));
+ memset(aDist->Elements(), 0, sizeof(uint32_t));
+ *aLength = aDist->Length();
+ return true;
+ }
+ nsAutoTArray clauses;
+ clauses.AppendElement(0);
+ for (TextRange& range : *ranges) {
+ if (!range.IsClause()) {
+ continue;
+ }
+ clauses.AppendElement(range.mEndOffset);
+ }
+
+ aDist->SetLength(clauses.Length() * sizeof(uint32_t));
+ memcpy(aDist->Elements(), clauses.Elements(), aDist->Length());
+ *aLength = aDist->Length();
+ return true;
+ }
+
+ case GCS_RESULTREADSTR: {
+ // When returning error causes unexpected error, so we return 0 instead.
+ *aLength = 0;
+ return true;
+ }
+
+ case GCS_RESULTCLAUSE: {
+ // When returning error causes unexpected error, so we return 0 instead.
+ *aLength = 0;
+ return true;
+ }
+
+ default:
+ NS_WARNING(
+ nsPrintfCString("Unsupported type %x of ImmGetCompositionStringW hook",
+ aType).get());
+ break;
+ }
+
+ return false;
+}
+
+bool
+nsPluginInstanceOwner::SetCandidateWindow(int32_t aX, int32_t aY)
+{
+ if (NS_WARN_IF(!mPluginFrame)) {
+ return false;
+ }
+
+ nsCOMPtr widget = GetContainingWidgetIfOffset();
+ if (!widget) {
+ widget = GetRootWidgetForPluginFrame(mPluginFrame);
+ if (NS_WARN_IF(!widget)) {
+ return false;
+ }
+ }
+
+ widget->SetCandidateWindowForPlugin(aX, aY);
+ return true;
+}
+
+bool
+nsPluginInstanceOwner::RequestCommitOrCancel(bool aCommitted)
+{
+ nsCOMPtr widget = GetContainingWidgetIfOffset();
+ if (!widget) {
+ widget = GetRootWidgetForPluginFrame(mPluginFrame);
+ if (NS_WARN_IF(!widget)) {
+ return false;
+ }
+ }
+
+ if (aCommitted) {
+ widget->NotifyIME(widget::REQUEST_TO_COMMIT_COMPOSITION);
+ } else {
+ widget->NotifyIME(widget::REQUEST_TO_CANCEL_COMPOSITION);
+ }
+ return true;
+}
+#endif // #ifdef XP_WIN
NS_IMETHODIMP nsPluginInstanceOwner::SetEventModel(int32_t eventModel)
{
@@ -1597,6 +1783,154 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent,
return NS_OK;
}
+#ifdef XP_WIN
+void
+nsPluginInstanceOwner::CallDefaultProc(const WidgetGUIEvent* aEvent)
+{
+ nsCOMPtr widget = GetContainingWidgetIfOffset();
+ if (!widget) {
+ widget = GetRootWidgetForPluginFrame(mPluginFrame);
+ if (NS_WARN_IF(!widget)) {
+ return;
+ }
+ }
+
+ const NPEvent* npEvent =
+ static_cast(aEvent->mPluginEvent);
+ if (NS_WARN_IF(!npEvent)) {
+ return;
+ }
+
+ WidgetPluginEvent pluginEvent(true, ePluginInputEvent, widget);
+ pluginEvent.mPluginEvent.Copy(*npEvent);
+ widget->DefaultProcOfPluginEvent(pluginEvent);
+}
+
+already_AddRefed
+nsPluginInstanceOwner::GetTextComposition()
+{
+ if (NS_WARN_IF(!mPluginFrame)) {
+ return nullptr;
+ }
+
+ nsCOMPtr widget = GetContainingWidgetIfOffset();
+ if (!widget) {
+ widget = GetRootWidgetForPluginFrame(mPluginFrame);
+ if (NS_WARN_IF(!widget)) {
+ return nullptr;
+ }
+ }
+
+ RefPtr composition =
+ IMEStateManager::GetTextCompositionFor(widget);
+ if (NS_WARN_IF(!composition)) {
+ return nullptr;
+ }
+
+ return composition.forget();
+}
+#endif
+
+nsresult
+nsPluginInstanceOwner::DispatchCompositionToPlugin(nsIDOMEvent* aEvent)
+{
+#ifdef XP_WIN
+ if (!mPluginWindow) {
+ // CompositionEvent isn't cancellable. So it is unnecessary to call
+ // PreventDefaults() to consume event
+ return NS_OK;
+ }
+ WidgetCompositionEvent* compositionEvent =
+ aEvent->GetInternalNSEvent()->AsCompositionEvent();
+ if (NS_WARN_IF(!compositionEvent)) {
+ return NS_ERROR_INVALID_ARG;
+ }
+
+ if (compositionEvent->mMessage == eCompositionChange) {
+ RefPtr composition = GetTextComposition();
+ if (NS_WARN_IF(!composition)) {
+ return NS_ERROR_FAILURE;
+ }
+ TextComposition::CompositionChangeEventHandlingMarker
+ compositionChangeEventHandlingMarker(composition, compositionEvent);
+ }
+
+ // Protected mode Flash returns noDefault by NPP_HandleEvent, but
+ // composition information into plugin is invalid because plugin's bug.
+ // So if plugin doesn't get composition data by WM_IME_COMPOSITION, we
+ // recongnize it isn't handled
+ AutoRestore restore(mGotCompositionData);
+ mGotCompositionData = false;
+
+ nsEventStatus status = ProcessEvent(*compositionEvent);
+ aEvent->StopImmediatePropagation();
+
+ // Composition event isn't handled by plugin, so we have to call default proc.
+ const NPEvent* pPluginEvent =
+ static_cast(compositionEvent->mPluginEvent);
+ if (NS_WARN_IF(!pPluginEvent)) {
+ return NS_OK;
+ }
+
+ if (pPluginEvent->event == WM_IME_STARTCOMPOSITION) {
+ // Flash's protected mode lies that composition event is handled, but it
+ // cannot do it well. So even if handled, we should post this message when
+ // no IMM API calls during WM_IME_COMPOSITION.
+ if (nsEventStatus_eConsumeNoDefault != status) {
+ CallDefaultProc(compositionEvent);
+ mSentStartComposition = true;
+ } else {
+ mSentStartComposition = false;
+ }
+ return NS_OK;
+ }
+
+ if (pPluginEvent->event == WM_IME_ENDCOMPOSITION) {
+ // Always post WM_END_COMPOSITION to default proc. Because Flash may lie
+ // that it doesn't handle composition well, but event is handled.
+ // Even if posting this message, default proc do nothing if unnecessary.
+ CallDefaultProc(compositionEvent);
+ return NS_OK;
+ }
+
+ if (pPluginEvent->event == WM_IME_COMPOSITION && !mGotCompositionData) {
+ nsCOMPtr widget = GetContainingWidgetIfOffset();
+ if (!widget) {
+ widget = GetRootWidgetForPluginFrame(mPluginFrame);
+ }
+
+ if (pPluginEvent->lParam & GCS_RESULTSTR) {
+ // GCS_RESULTSTR's default proc will generate WM_CHAR. So emulate it.
+ for (size_t i = 0; i < compositionEvent->mData.Length(); i++) {
+ WidgetPluginEvent charEvent(true, ePluginInputEvent, widget);
+ NPEvent event;
+ event.event = WM_CHAR;
+ event.wParam = compositionEvent->mData[i];
+ event.lParam = 0;
+ charEvent.mPluginEvent.Copy(event);
+ ProcessEvent(charEvent);
+ }
+ return NS_OK;
+ }
+ if (!mSentStartComposition) {
+ // We post WM_IME_COMPOSITION to default proc, but
+ // WM_IME_STARTCOMPOSITION isn't post yet. We should post it at first.
+ WidgetPluginEvent event(true, ePluginInputEvent, widget);
+ NPEvent npevent;
+ npevent.event = WM_IME_STARTCOMPOSITION;
+ npevent.wParam = 0;
+ npevent.lParam = 0;
+ event.mPluginEvent.Copy(npevent);
+ CallDefaultProc(&event);
+ mSentStartComposition = true;
+ }
+
+ CallDefaultProc(compositionEvent);
+ }
+#endif // #ifdef XP_WIN
+ return NS_OK;
+}
+
nsresult
nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
{
@@ -1651,6 +1985,11 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
if (eventType.EqualsLiteral("keypress")) {
return ProcessKeyPress(aEvent);
}
+ if (eventType.EqualsLiteral("compositionstart") ||
+ eventType.EqualsLiteral("compositionend") ||
+ eventType.EqualsLiteral("text")) {
+ return DispatchCompositionToPlugin(aEvent);
+ }
nsCOMPtr dragEvent(do_QueryInterface(aEvent));
if (dragEvent && mInstance) {
@@ -2477,6 +2816,11 @@ nsPluginInstanceOwner::Destroy()
content->RemoveEventListener(NS_LITERAL_STRING("dragstart"), this, true);
content->RemoveEventListener(NS_LITERAL_STRING("draggesture"), this, true);
content->RemoveEventListener(NS_LITERAL_STRING("dragend"), this, true);
+ content->RemoveSystemEventListener(NS_LITERAL_STRING("compositionstart"),
+ this, true);
+ content->RemoveSystemEventListener(NS_LITERAL_STRING("compositionend"),
+ this, true);
+ content->RemoveSystemEventListener(NS_LITERAL_STRING("text"), this, true);
#if MOZ_WIDGET_ANDROID
RemovePluginView();
@@ -2872,6 +3216,11 @@ nsresult nsPluginInstanceOwner::Init(nsIContent* aContent)
aContent->AddEventListener(NS_LITERAL_STRING("dragstart"), this, true);
aContent->AddEventListener(NS_LITERAL_STRING("draggesture"), this, true);
aContent->AddEventListener(NS_LITERAL_STRING("dragend"), this, true);
+ aContent->AddSystemEventListener(NS_LITERAL_STRING("compositionstart"),
+ this, true);
+ aContent->AddSystemEventListener(NS_LITERAL_STRING("compositionend"), this,
+ true);
+ aContent->AddSystemEventListener(NS_LITERAL_STRING("text"), this, true);
return NS_OK;
}
@@ -3374,6 +3723,51 @@ already_AddRefed nsPluginInstanceOwner::GetBaseURI() const
return content->GetBaseURI();
}
+// static
+void
+nsPluginInstanceOwner::GeneratePluginEvent(
+ const WidgetCompositionEvent* aSrcCompositionEvent,
+ WidgetCompositionEvent* aDistCompositionEvent)
+{
+#ifdef XP_WIN
+ NPEvent newEvent;
+ switch (aDistCompositionEvent->mMessage) {
+ case eCompositionChange: {
+ newEvent.event = WM_IME_COMPOSITION;
+ newEvent.wParam = 0;
+ if (aSrcCompositionEvent &&
+ (aSrcCompositionEvent->mMessage == eCompositionCommit ||
+ aSrcCompositionEvent->mMessage == eCompositionCommitAsIs)) {
+ newEvent.lParam = GCS_RESULTSTR;
+ } else {
+ newEvent.lParam = GCS_COMPSTR | GCS_COMPATTR | GCS_COMPCLAUSE;
+ }
+ TextRangeArray* ranges = aDistCompositionEvent->mRanges;
+ if (ranges && ranges->HasCaret()) {
+ newEvent.lParam |= GCS_CURSORPOS;
+ }
+ break;
+ }
+
+ case eCompositionStart:
+ newEvent.event = WM_IME_STARTCOMPOSITION;
+ newEvent.wParam = 0;
+ newEvent.lParam = 0;
+ break;
+
+ case eCompositionEnd:
+ newEvent.event = WM_IME_ENDCOMPOSITION;
+ newEvent.wParam = 0;
+ newEvent.lParam = 0;
+ break;
+
+ default:
+ return;
+ }
+ aDistCompositionEvent->mPluginEvent.Copy(newEvent);
+#endif
+}
+
// nsPluginDOMContextMenuListener class implementation
nsPluginDOMContextMenuListener::nsPluginDOMContextMenuListener(nsIContent* aContent)
diff --git a/dom/plugins/base/nsPluginInstanceOwner.h b/dom/plugins/base/nsPluginInstanceOwner.h
index e902b2d797e6..eb73f062e85c 100644
--- a/dom/plugins/base/nsPluginInstanceOwner.h
+++ b/dom/plugins/base/nsPluginInstanceOwner.h
@@ -29,6 +29,7 @@ class nsPluginFrame;
class nsDisplayListBuilder;
namespace mozilla {
+class TextComposition;
namespace dom {
struct MozPluginParameter;
} // namespace dom
@@ -118,6 +119,10 @@ public:
nsEventStatus ProcessEvent(const mozilla::WidgetGUIEvent& anEvent);
+ static void GeneratePluginEvent(
+ const mozilla::WidgetCompositionEvent* aSrcCompositionEvent,
+ mozilla::WidgetCompositionEvent* aDistCompositionEvent);
+
#if defined(XP_WIN)
void SetWidgetWindowAsParent(HWND aWindowToAdopt);
nsresult SetNetscapeWindowAsParent(HWND aWindowToAdopt);
@@ -256,6 +261,11 @@ public:
void NotifyHostCreateWidget();
void NotifyDestroyPending();
+ bool GetCompositionString(uint32_t aIndex, nsTArray* aString,
+ int32_t* aLength);
+ bool SetCandidateWindow(int32_t aX, int32_t aY);
+ bool RequestCommitOrCancel(bool aCommitted);
+
private:
virtual ~nsPluginInstanceOwner();
@@ -278,6 +288,10 @@ private:
#if defined(XP_WIN)
nsIWidget* GetContainingWidgetIfOffset();
+ already_AddRefed GetTextComposition();
+
+ bool mGotCompositionData;
+ bool mSentStartComposition;
#endif
nsPluginNativeWindow *mPluginWindow;
@@ -329,6 +343,11 @@ private:
nsresult DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent,
bool aAllowPropagate = false);
nsresult DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent);
+ nsresult DispatchCompositionToPlugin(nsIDOMEvent* aEvent);
+
+#ifdef XP_WIN
+ void CallDefaultProc(const mozilla::WidgetGUIEvent* aEvent);
+#endif
#ifdef XP_MACOSX
static NPBool ConvertPointPuppet(PuppetWidget *widget, nsPluginFrame* pluginFrame,
diff --git a/dom/plugins/ipc/NPEventWindows.h b/dom/plugins/ipc/NPEventWindows.h
index d485000b31fe..79a694b7bd05 100644
--- a/dom/plugins/ipc/NPEventWindows.h
+++ b/dom/plugins/ipc/NPEventWindows.h
@@ -100,6 +100,18 @@ struct ParamTraits
case WM_SETFOCUS:
case WM_KILLFOCUS:
+
+ case WM_IME_STARTCOMPOSITION:
+ case WM_IME_COMPOSITION:
+ case WM_IME_ENDCOMPOSITION:
+ case WM_IME_CHAR:
+ case WM_IME_SETCONTEXT:
+ case WM_IME_COMPOSITIONFULL:
+ case WM_IME_KEYDOWN:
+ case WM_IME_KEYUP:
+ case WM_IME_SELECT:
+ case WM_INPUTLANGCHANGEREQUEST:
+ case WM_INPUTLANGCHANGE:
break;
default:
diff --git a/dom/plugins/ipc/PPluginInstance.ipdl b/dom/plugins/ipc/PPluginInstance.ipdl
index edf9f4bf7ca9..1fb1286dc5a4 100644
--- a/dom/plugins/ipc/PPluginInstance.ipdl
+++ b/dom/plugins/ipc/PPluginInstance.ipdl
@@ -260,6 +260,15 @@ parent:
// returned by NPN_GetValue_NPNVnetscapeWindow. Only used on Windows.
async SetNetscapeWindowAsParent(NativeWindowHandle childWindow);
+ sync GetCompositionString(uint32_t aType)
+ returns (uint8_t[] aDist, int32_t aLength);
+ // Set candidate window position.
+ //
+ // @param aX x position of candidate window
+ // @param aY y position of candidate window
+ async SetCandidateWindow(int32_t aX, int32_t aY);
+ sync RequestCommitOrCancel(bool aCommitted);
+
both:
async PPluginScriptableObject();
diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp
index 4fe39efe1b43..083ac4736cd1 100644
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -73,6 +73,25 @@ static WindowsDllInterceptor sUser32Intercept;
static HWND sWinlessPopupSurrogateHWND = nullptr;
static User32TrackPopupMenu sUser32TrackPopupMenuStub = nullptr;
+typedef HIMC (WINAPI *Imm32ImmGetContext)(HWND hWND);
+typedef BOOL (WINAPI *Imm32ImmReleaseContext)(HWND hWND, HIMC hIMC);
+typedef LONG (WINAPI *Imm32ImmGetCompositionString)(HIMC hIMC,
+ DWORD dwIndex,
+ LPVOID lpBuf,
+ DWORD dwBufLen);
+typedef BOOL (WINAPI *Imm32ImmSetCandidateWindow)(HIMC hIMC,
+ LPCANDIDATEFORM lpCandidate);
+typedef BOOL (WINAPI *Imm32ImmNotifyIME)(HIMC hIMC, DWORD dwAction,
+ DWORD dwIndex, DWORD dwValue);
+static WindowsDllInterceptor sImm32Intercept;
+static Imm32ImmGetContext sImm32ImmGetContextStub = nullptr;
+static Imm32ImmReleaseContext sImm32ImmReleaseContextStub = nullptr;
+static Imm32ImmGetCompositionString sImm32ImmGetCompositionStringStub = nullptr;
+static Imm32ImmSetCandidateWindow sImm32ImmSetCandidateWindowStub = nullptr;
+static Imm32ImmNotifyIME sImm32ImmNotifyIME = nullptr;
+static PluginInstanceChild* sCurrentPluginInstance = nullptr;
+static const HIMC sHookIMC = (const HIMC)0xefefefef;
+
using mozilla::gfx::SharedDIB;
#include
@@ -197,6 +216,7 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface,
if (GetQuirks() & QUIRK_UNITY_FIXUP_MOUSE_CAPTURE) {
SetUnityHooks();
}
+ InitImm32Hook();
#endif // OS_WIN
}
@@ -1983,6 +2003,135 @@ PluginInstanceChild::CreateWinlessPopupSurrogate()
SendSetNetscapeWindowAsParent(mWinlessPopupSurrogateHWND);
}
+// static
+HIMC
+PluginInstanceChild::ImmGetContextProc(HWND aWND)
+{
+ if (!sCurrentPluginInstance) {
+ return sImm32ImmGetContextStub(aWND);
+ }
+
+ wchar_t szClass[21];
+ int haveClass = GetClassNameW(aWND, szClass, ArrayLength(szClass));
+ if (!haveClass || wcscmp(szClass, L"SWFlash_PlaceholderX")) {
+ NS_WARNING("We cannot recongnize hooked window class");
+ return sImm32ImmGetContextStub(aWND);
+ }
+
+ return sHookIMC;
+}
+
+// static
+BOOL
+PluginInstanceChild::ImmReleaseContextProc(HWND aWND, HIMC aIMC)
+{
+ if (aIMC == sHookIMC) {
+ return TRUE;
+ }
+
+ return sImm32ImmReleaseContextStub(aWND, aIMC);
+}
+
+// static
+LONG
+PluginInstanceChild::ImmGetCompositionStringProc(HIMC aIMC, DWORD aIndex,
+ LPVOID aBuf, DWORD aLen)
+{
+ if (aIMC != sHookIMC) {
+ return sImm32ImmGetCompositionStringStub(aIMC, aIndex, aBuf, aLen);
+ }
+ if (!sCurrentPluginInstance) {
+ return IMM_ERROR_GENERAL;
+ }
+ nsAutoTArray dist;
+ int32_t length = 0; // IMM_ERROR_NODATA
+ sCurrentPluginInstance->SendGetCompositionString(aIndex, &dist, &length);
+ if (length == IMM_ERROR_NODATA || length == IMM_ERROR_GENERAL) {
+ return length;
+ }
+
+ if (aBuf && aLen >= static_cast(length)) {
+ memcpy(aBuf, dist.Elements(), length);
+ }
+ return length;
+}
+
+// staitc
+BOOL
+PluginInstanceChild::ImmSetCandidateWindowProc(HIMC aIMC, LPCANDIDATEFORM aForm)
+{
+ if (aIMC != sHookIMC) {
+ return sImm32ImmSetCandidateWindowStub(aIMC, aForm);
+ }
+
+ if (!sCurrentPluginInstance ||
+ aForm->dwIndex != 0 ||
+ !(aForm->dwStyle & CFS_CANDIDATEPOS)) {
+ // Flash only uses CFS_CANDIDATEPOS with index == 0.
+ return FALSE;
+ }
+
+ sCurrentPluginInstance->SendSetCandidateWindow(
+ aForm->ptCurrentPos.x, aForm->ptCurrentPos.y);
+ return TRUE;
+}
+
+// static
+BOOL
+PluginInstanceChild::ImmNotifyIME(HIMC aIMC, DWORD aAction, DWORD aIndex,
+ DWORD aValue)
+{
+ if (aIMC != sHookIMC) {
+ return sImm32ImmNotifyIME(aIMC, aAction, aIndex, aValue);
+ }
+
+ // We only supports NI_COMPOSITIONSTR because Flash uses it only
+ if (!sCurrentPluginInstance ||
+ aAction != NI_COMPOSITIONSTR ||
+ (aIndex != CPS_COMPLETE && aIndex != CPS_CANCEL)) {
+ return FALSE;
+ }
+
+ sCurrentPluginInstance->SendRequestCommitOrCancel(aAction == CPS_COMPLETE);
+ return TRUE;
+}
+
+void
+PluginInstanceChild::InitImm32Hook()
+{
+ if (!(GetQuirks() & QUIRK_WINLESS_HOOK_IME)) {
+ return;
+ }
+
+ if (sImm32ImmGetContextStub) {
+ return;
+ }
+
+ // When using windowless plugin, IMM API won't work due ot OOP.
+
+ sImm32Intercept.Init("imm32.dll");
+ sImm32Intercept.AddHook(
+ "ImmGetContext",
+ reinterpret_cast(ImmGetContextProc),
+ (void**)&sImm32ImmGetContextStub);
+ sImm32Intercept.AddHook(
+ "ImmReleaseContext",
+ reinterpret_cast(ImmReleaseContextProc),
+ (void**)&sImm32ImmReleaseContextStub);
+ sImm32Intercept.AddHook(
+ "ImmGetCompositionStringW",
+ reinterpret_cast(ImmGetCompositionStringProc),
+ (void**)&sImm32ImmGetCompositionStringStub);
+ sImm32Intercept.AddHook(
+ "ImmSetCandidateWindow",
+ reinterpret_cast(ImmSetCandidateWindowProc),
+ (void**)&sImm32ImmSetCandidateWindowStub);
+ sImm32Intercept.AddHook(
+ "ImmNotifyIME",
+ reinterpret_cast(ImmNotifyIME),
+ (void**)&sImm32ImmNotifyIME);
+}
+
void
PluginInstanceChild::DestroyWinlessPopupSurrogate()
{
@@ -2016,6 +2165,13 @@ PluginInstanceChild::WinlessHandleEvent(NPEvent& event)
focusHwnd = SetFocus(mWinlessPopupSurrogateHWND);
}
+ AutoRestore pluginInstance(sCurrentPluginInstance);
+ if (event.event == WM_IME_STARTCOMPOSITION ||
+ event.event == WM_IME_COMPOSITION ||
+ event.event == WM_KILLFOCUS) {
+ sCurrentPluginInstance = this;
+ }
+
MessageLoop* loop = MessageLoop::current();
AutoRestore modalLoop(loop->os_modal_loop());
diff --git a/dom/plugins/ipc/PluginInstanceChild.h b/dom/plugins/ipc/PluginInstanceChild.h
index 37164aec3590..6ddd751219d7 100644
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
@@ -305,6 +305,7 @@ private:
void HookSetWindowLongPtr();
void SetUnityHooks();
void ClearUnityHooks();
+ void InitImm32Hook();
static inline bool SetWindowLongHookCheck(HWND hWnd,
int nIndex,
LONG_PTR newLong);
@@ -350,6 +351,15 @@ private:
LONG newLong);
#endif
+ static HIMC WINAPI ImmGetContextProc(HWND aWND);
+ static BOOL WINAPI ImmReleaseContextProc(HWND aWND, HIMC aIMC);
+ static LONG WINAPI ImmGetCompositionStringProc(HIMC aIMC, DWORD aIndex,
+ LPVOID aBuf, DWORD aLen);
+ static BOOL WINAPI ImmSetCandidateWindowProc(HIMC hIMC,
+ LPCANDIDATEFORM plCandidate);
+ static BOOL WINAPI ImmNotifyIME(HIMC aIMC, DWORD aAction, DWORD aIndex,
+ DWORD aValue);
+
class FlashThrottleAsyncMsg : public ChildAsyncCall
{
public:
diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp
index 46374a5daeaa..e8e63f5f957a 100644
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -1568,6 +1568,16 @@ PluginInstanceParent::NPP_HandleEvent(void* event)
// We send this in nsPluginFrame just before painting
return SendWindowPosChanged(npremoteevent);
}
+
+ case WM_IME_STARTCOMPOSITION:
+ case WM_IME_COMPOSITION:
+ case WM_IME_ENDCOMPOSITION:
+ if (!(mParent->GetQuirks() & QUIRK_WINLESS_HOOK_IME)) {
+ // IME message will be posted on allowed plugins only such as
+ // Flash. Because if we cannot know that plugin can handle
+ // IME correctly.
+ return 0;
+ }
break;
}
}
@@ -2368,6 +2378,50 @@ PluginInstanceParent::Cast(NPP aInstance, PluginAsyncSurrogate** aSurrogate)
return instancePtr;
}
+bool
+PluginInstanceParent::RecvGetCompositionString(const uint32_t& aIndex,
+ nsTArray* aDist,
+ int32_t* aLength)
+{
+#if defined(OS_WIN)
+ nsPluginInstanceOwner* owner = GetOwner();
+ if (!owner) {
+ *aLength = IMM_ERROR_GENERAL;
+ return true;
+ }
+
+ if (!owner->GetCompositionString(aIndex, aDist, aLength)) {
+ *aLength = IMM_ERROR_NODATA;
+ }
+#endif
+ return true;
+}
+
+bool
+PluginInstanceParent::RecvSetCandidateWindow(const int32_t& aX,
+ const int32_t& aY)
+{
+#if defined(OS_WIN)
+ nsPluginInstanceOwner* owner = GetOwner();
+ if (owner) {
+ owner->SetCandidateWindow(aX, aY);
+ }
+#endif
+ return true;
+}
+
+bool
+PluginInstanceParent::RecvRequestCommitOrCancel(const bool& aCommitted)
+{
+#if defined(OS_WIN)
+ nsPluginInstanceOwner* owner = GetOwner();
+ if (owner) {
+ owner->RequestCommitOrCancel(aCommitted);
+ }
+#endif
+ return true;
+}
+
void
PluginInstanceParent::RecordDrawingModel()
{
diff --git a/dom/plugins/ipc/PluginInstanceParent.h b/dom/plugins/ipc/PluginInstanceParent.h
index 2469da5bfa77..43700f7b0e0f 100644
--- a/dom/plugins/ipc/PluginInstanceParent.h
+++ b/dom/plugins/ipc/PluginInstanceParent.h
@@ -352,6 +352,16 @@ public:
static PluginInstanceParent* Cast(NPP instance,
PluginAsyncSurrogate** aSurrogate = nullptr);
+ // for IME hook
+ virtual bool
+ RecvGetCompositionString(const uint32_t& aIndex,
+ nsTArray* aBuffer,
+ int32_t* aLength) override;
+ virtual bool
+ RecvSetCandidateWindow(const int32_t& aX, const int32_t& aY) override;
+ virtual bool
+ RecvRequestCommitOrCancel(const bool& aCommitted) override;
+
private:
// Create an appropriate platform surface for a background of size
// |aSize|. Return true if successful.
diff --git a/dom/plugins/ipc/PluginQuirks.cpp b/dom/plugins/ipc/PluginQuirks.cpp
index 86c890093e30..a6528e661856 100644
--- a/dom/plugins/ipc/PluginQuirks.cpp
+++ b/dom/plugins/ipc/PluginQuirks.cpp
@@ -34,6 +34,7 @@ int GetQuirksFromMimeTypeAndFilename(const nsCString& aMimeType,
quirks |= QUIRK_FLASH_HOOK_SETLONGPTR;
quirks |= QUIRK_FLASH_HOOK_GETWINDOWINFO;
quirks |= QUIRK_FLASH_FIXUP_MOUSE_CAPTURE;
+ quirks |= QUIRK_WINLESS_HOOK_IME;
#endif
}
@@ -62,6 +63,12 @@ int GetQuirksFromMimeTypeAndFilename(const nsCString& aMimeType,
}
#endif
+#ifdef OS_WIN
+ if (specialType == nsPluginHost::eSpecialType_Test) {
+ quirks |= QUIRK_WINLESS_HOOK_IME;
+ }
+#endif
+
return quirks;
}
diff --git a/dom/plugins/ipc/PluginQuirks.h b/dom/plugins/ipc/PluginQuirks.h
index fb77afd74c6b..8b59066c0dc7 100644
--- a/dom/plugins/ipc/PluginQuirks.h
+++ b/dom/plugins/ipc/PluginQuirks.h
@@ -58,6 +58,8 @@ enum PluginQuirks {
QUIRK_FLASH_RETURN_EMPTY_DOCUMENT_ORIGIN = 1 << 11,
// Win: Addresses a Unity bug with mouse capture.
QUIRK_UNITY_FIXUP_MOUSE_CAPTURE = 1 << 12,
+ // Win: Hook IMM32 API to handle IME event on windowless plugin
+ QUIRK_WINLESS_HOOK_IME = 1 << 13,
};
int GetQuirksFromMimeTypeAndFilename(const nsCString& aMimeType,
diff --git a/dom/plugins/test/mochitest/mochitest.ini b/dom/plugins/test/mochitest/mochitest.ini
index 6494bc7ac9b2..6ed983d34c6b 100644
--- a/dom/plugins/test/mochitest/mochitest.ini
+++ b/dom/plugins/test/mochitest/mochitest.ini
@@ -116,6 +116,8 @@ skip-if = toolkit != "cocoa"
[test_twostreams.html]
[test_windowed_invalidate.html]
skip-if = os != "win"
+[test_windowless_ime.html]
+skip-if = os != "win"
[test_visibility.html]
skip-if = toolkit == "cocoa"
[test_zero_opacity.html]
diff --git a/dom/plugins/test/mochitest/test_windowless_ime.html b/dom/plugins/test/mochitest/test_windowless_ime.html
new file mode 100644
index 000000000000..8a1264fdc2a9
--- /dev/null
+++ b/dom/plugins/test/mochitest/test_windowless_ime.html
@@ -0,0 +1,46 @@
+
+
+
+
+ Test #1 for Bug 539565
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/plugins/test/testaddon/Makefile.in b/dom/plugins/test/testaddon/Makefile.in
index b023a0db199b..7b6dd6bc5f53 100644
--- a/dom/plugins/test/testaddon/Makefile.in
+++ b/dom/plugins/test/testaddon/Makefile.in
@@ -13,7 +13,7 @@ addon_file_name = testaddon.xpi
endif
# This is so hacky. Waiting on bug 988938.
-testdir = $(abspath $(DEPTH)/_tests/xpcshell/dom/plugins/test/unit/)
+testdir = $(topobjdir)/_tests/xpcshell/dom/plugins/test/unit/
addonpath = $(testdir)/$(addon_file_name)
ifdef COMPILE_ENVIRONMENT
diff --git a/dom/plugins/test/testplugin/nptest.cpp b/dom/plugins/test/testplugin/nptest.cpp
index 6e3dc640a9b0..6651ce349681 100644
--- a/dom/plugins/test/testplugin/nptest.cpp
+++ b/dom/plugins/test/testplugin/nptest.cpp
@@ -173,6 +173,7 @@ static bool startAudioPlayback(NPObject* npobj, const NPVariant* args, uint32_t
static bool stopAudioPlayback(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
static bool getAudioMuted(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
static bool nativeWidgetIsVisible(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
+static bool getLastCompositionText(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
static const NPUTF8* sPluginMethodIdentifierNames[] = {
"npnEvaluateTest",
@@ -244,6 +245,7 @@ static const NPUTF8* sPluginMethodIdentifierNames[] = {
"stopAudioPlayback",
"audioMuted",
"nativeWidgetIsVisible",
+ "getLastCompositionText",
};
static NPIdentifier sPluginMethodIdentifiers[MOZ_ARRAY_LENGTH(sPluginMethodIdentifierNames)];
static const ScriptableFunction sPluginMethodFunctions[] = {
@@ -316,6 +318,7 @@ static const ScriptableFunction sPluginMethodFunctions[] = {
stopAudioPlayback,
getAudioMuted,
nativeWidgetIsVisible,
+ getLastCompositionText,
};
static_assert(MOZ_ARRAY_LENGTH(sPluginMethodIdentifierNames) ==
@@ -852,6 +855,7 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char*
instanceData->asyncDrawing = AD_NONE;
instanceData->frontBuffer = nullptr;
instanceData->backBuffer = nullptr;
+ instanceData->placeholderWnd = nullptr;
instance->pdata = instanceData;
TestNPObject* scriptableObject = (TestNPObject*)NPN_CreateObject(instance, &sNPClass);
@@ -3514,6 +3518,26 @@ nativeWidgetIsVisible(NPObject* npobj, const NPVariant* args,
}
#endif
+bool
+getLastCompositionText(NPObject* npobj, const NPVariant* args,
+ uint32_t argCount, NPVariant* result)
+{
+#ifdef XP_WIN
+ if (argCount != 0) {
+ return false;
+ }
+
+ NPP npp = static_cast(npobj)->npp;
+ InstanceData* id = static_cast(npp->pdata);
+ char *outval = NPN_StrDup(id->lastComposition.c_str());
+ STRINGZ_TO_NPVARIANT(outval, *result);
+ return true;
+#else
+ // XXX not implemented
+ return false;
+#endif
+}
+
bool
callOnDestroy(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result)
{
diff --git a/dom/plugins/test/testplugin/nptest.h b/dom/plugins/test/testplugin/nptest.h
index 12e427a5e60f..2fbc2d4b437c 100644
--- a/dom/plugins/test/testplugin/nptest.h
+++ b/dom/plugins/test/testplugin/nptest.h
@@ -156,6 +156,8 @@ typedef struct InstanceData {
AsyncDrawing asyncDrawing;
NPAsyncSurface *frontBuffer;
NPAsyncSurface *backBuffer;
+ std::string lastComposition;
+ void* placeholderWnd;
} InstanceData;
void notifyDidPaint(InstanceData* instanceData);
diff --git a/dom/plugins/test/testplugin/nptest_windows.cpp b/dom/plugins/test/testplugin/nptest_windows.cpp
index 3d807bc532ec..8b02872e9540 100644
--- a/dom/plugins/test/testplugin/nptest_windows.cpp
+++ b/dom/plugins/test/testplugin/nptest_windows.cpp
@@ -654,6 +654,29 @@ pluginGetClipRegionRectEdge(InstanceData* instanceData,
return NPTEST_INT32_ERROR;
}
+static
+void
+createDummyWindowForIME(InstanceData* instanceData)
+{
+ WNDCLASSW wndClass;
+ wndClass.style = 0;
+ wndClass.lpfnWndProc = DefWindowProcW;
+ wndClass.cbClsExtra = 0;
+ wndClass.cbWndExtra = 0;
+ wndClass.hInstance = GetModuleHandleW(NULL);
+ wndClass.hIcon = nullptr;
+ wndClass.hCursor = nullptr;
+ wndClass.hbrBackground = (HBRUSH)COLOR_WINDOW;
+ wndClass.lpszMenuName = NULL;
+ wndClass.lpszClassName = L"SWFlash_PlaceholderX";
+ RegisterClassW(&wndClass);
+
+ instanceData->placeholderWnd =
+ static_cast(CreateWindowW(L"SWFlash_PlaceholderX", L"", WS_CHILD, 0,
+ 0, 0, 0, HWND_MESSAGE, NULL,
+ GetModuleHandleW(NULL), NULL));
+}
+
/* windowless plugin events */
static bool
@@ -725,6 +748,35 @@ handleEventInternal(InstanceData* instanceData, NPEvent* pe, LRESULT* result)
return true;
}
+ case WM_IME_STARTCOMPOSITION:
+ instanceData->lastComposition.erase();
+ if (!instanceData->placeholderWnd) {
+ createDummyWindowForIME(instanceData);
+ }
+ return true;
+
+ case WM_IME_ENDCOMPOSITION:
+ instanceData->lastComposition.erase();
+ return true;
+
+ case WM_IME_COMPOSITION: {
+ if (pe->lParam & GCS_COMPSTR) {
+ HIMC hIMC = ImmGetContext((HWND)instanceData->placeholderWnd);
+ if (!hIMC) {
+ return false;
+ }
+ WCHAR compStr[256];
+ LONG len = ImmGetCompositionStringW(hIMC, GCS_COMPSTR, compStr,
+ 256 * sizeof(WCHAR));
+ CHAR buffer[256];
+ len = ::WideCharToMultiByte(CP_UTF8, 0, compStr, len / sizeof(WCHAR),
+ buffer, 256, nullptr, nullptr);
+ instanceData->lastComposition.append(buffer, len);
+ ::ImmReleaseContext((HWND)instanceData->placeholderWnd, hIMC);
+ }
+ return true;
+ }
+
default:
return false;
}
diff --git a/dom/plugins/test/testplugin/testplugin.mozbuild b/dom/plugins/test/testplugin/testplugin.mozbuild
index e8e1a7615cce..86e3fc24a7c9 100644
--- a/dom/plugins/test/testplugin/testplugin.mozbuild
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -38,6 +38,7 @@ elif toolkit == 'windows':
]
OS_LIBS += [
'msimg32',
+ 'imm32'
]
# must link statically with the CRT; nptest isn't Gecko code
diff --git a/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html b/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html
index 5cef661c48c7..5540909ef75e 100644
--- a/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html
+++ b/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html
@@ -32,7 +32,7 @@
SimpleTest.waitForExplicitFinish(1);
- var iframe
+ var iframe = document.getElementById("iframe")
, iframeDiv
, contentDocument
, pointerLocked = 0
@@ -55,7 +55,9 @@
}
function startTest () {
- iframe = document.getElementById("iframe");
+ SimpleTest.waitForFocus(doStartTest, iframe.contentWindow);
+ }
+ function doStartTest() {
contentDocument = iframe.contentDocument;
iframeDiv = contentDocument.getElementById("div");
@@ -64,7 +66,7 @@
contentDocument.addEventListener("mozpointerlockchange", function () {
if (contentDocument.mozPointerLockElement === iframeDiv) {
pointerLocked++;
- resetIframe();
+ contentDocument.mozCancelFullScreen();
}
});
@@ -73,11 +75,14 @@
});
contentDocument.addEventListener("mozfullscreenchange", function () {
- if (contentDocument.mozFullScreen &&
- contentDocument.mozFullScreenElement === iframeDiv) {
+ if (contentDocument.mozFullScreen) {
+ ok(contentDocument.mozFullScreenElement === iframeDiv,
+ "Fullscreen element can only be iframe div");
// during second run iframe won't have allow-pointer-lock flag and
// mozRequestPointerLock will fail, mozpointerlockerror should be fired
iframeDiv.mozRequestPointerLock();
+ } else if (numberOfRuns === 1) {
+ resetIframe();
} else if (numberOfRuns === 2) {
runTests();
}
diff --git a/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
index bba42edbb413..56d1fefbbe49 100644
--- a/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
+++ b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
@@ -57,9 +57,10 @@
if (document.mozFullScreenElement === parentDiv) {
if (parentDivFullScreen === true) {
document.mozCancelFullScreen();
+ } else {
+ parentDivFullScreen = true;
+ parentDiv.mozRequestPointerLock();
}
- parentDivFullScreen = true;
- parentDiv.mozRequestPointerLock();
}
else if (document.mozFullScreenElement === childDiv) {
pointerLocked = !!document.mozPointerLockElement;
diff --git a/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
index 200feec207ab..01b1d1d43e1d 100644
--- a/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
+++ b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
@@ -24,6 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
*/
SimpleTest.waitForExplicitFinish();
+ SimpleTest.requestFlakyTimeout("We may need to wait for window's moving");
var div
, divRect
diff --git a/dom/tests/mochitest/pointerlock/mochitest.ini b/dom/tests/mochitest/pointerlock/mochitest.ini
index 07aeac0abd1a..14a5b627e286 100644
--- a/dom/tests/mochitest/pointerlock/mochitest.ini
+++ b/dom/tests/mochitest/pointerlock/mochitest.ini
@@ -21,4 +21,4 @@ support-files =
iframe_differentDOM.html
[test_pointerlock-api.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' || os == 'linux' || os == 'win' # B2G - window.open focus issues using fullscreen. (For Linux & Win) Bug1180351
+skip-if = buildapp == 'b2g' || toolkit == 'android' # B2G - window.open focus issues using fullscreen.
diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
index 002bd781733e..fbf6e0a50d45 100644
--- a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
+++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
@@ -60,8 +60,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
var gDisableList = [
// Bug 1174323
- { file: "file_screenClientXYConst.html",
- platform: "MacIntel" }
+ { file: "file_screenClientXYConst.html", platform: "MacIntel" },
+ { file: "file_screenClientXYConst.html", platform: "Win32" },
+ { file: "file_screenClientXYConst.html", platform: "Win64" },
];
var gTestWindow = null;
diff --git a/dom/webidl/Event.webidl b/dom/webidl/Event.webidl
index 8e908db743e0..3b479c1f0920 100644
--- a/dom/webidl/Event.webidl
+++ b/dom/webidl/Event.webidl
@@ -11,7 +11,7 @@
*/
[Constructor(DOMString type, optional EventInit eventInitDict),
- Exposed=(Window,Worker,System)]
+ Exposed=(Window,Worker,System), ProbablyShortLivingObject]
interface Event {
[Pure]
readonly attribute DOMString type;
diff --git a/dom/webidl/MutationObserver.webidl b/dom/webidl/MutationObserver.webidl
index ccb188b65e7e..a891205c2773 100644
--- a/dom/webidl/MutationObserver.webidl
+++ b/dom/webidl/MutationObserver.webidl
@@ -7,6 +7,7 @@
* http://dom.spec.whatwg.org
*/
+[ProbablyShortLivingObject]
interface MutationRecord {
[Constant]
readonly attribute DOMString type;
diff --git a/dom/webidl/PeerConnectionImpl.webidl b/dom/webidl/PeerConnectionImpl.webidl
index 3fe6e4b4debd..e09606cca737 100644
--- a/dom/webidl/PeerConnectionImpl.webidl
+++ b/dom/webidl/PeerConnectionImpl.webidl
@@ -47,6 +47,11 @@ interface PeerConnectionImpl {
[Throws]
void replaceTrack(MediaStreamTrack thisTrack, MediaStreamTrack withTrack);
[Throws]
+ void setParameters(MediaStreamTrack track,
+ optional RTCRtpParameters parameters);
+ [Throws]
+ RTCRtpParameters getParameters(MediaStreamTrack track);
+ [Throws]
void closeStreams();
sequence getLocalStreams();
diff --git a/dom/webidl/RTCRtpSender.webidl b/dom/webidl/RTCRtpSender.webidl
index dda71d680537..a08ed370e8e5 100644
--- a/dom/webidl/RTCRtpSender.webidl
+++ b/dom/webidl/RTCRtpSender.webidl
@@ -4,13 +4,73 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
- * http://lists.w3.org/Archives/Public/public-webrtc/2014May/0067.html
+ * http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface
*/
+enum RTCPriorityType {
+ "very-low",
+ "low",
+ "medium",
+ "high"
+};
+
+enum RTCDegradationPreference {
+ "maintain-framerate",
+ "maintain-resolution",
+ "balanced"
+};
+
+dictionary RTCRtxParameters {
+ unsigned long ssrc;
+};
+
+dictionary RTCFecParameters {
+ unsigned long ssrc;
+};
+
+dictionary RTCRtpEncodingParameters {
+ unsigned long ssrc;
+ RTCRtxParameters rtx;
+ RTCFecParameters fec;
+ boolean active;
+ RTCPriorityType priority;
+ unsigned long maxBitrate;
+ RTCDegradationPreference degradationPreference = "balanced";
+ DOMString rid;
+ float scaleResolutionDownBy = 1.0;
+};
+
+dictionary RTCRtpHeaderExtensionParameters {
+ DOMString uri;
+ unsigned short id;
+ boolean encrypted;
+};
+
+dictionary RTCRtcpParameters {
+ DOMString cname;
+ boolean reducedSize;
+};
+
+dictionary RTCRtpCodecParameters {
+ unsigned short payloadType;
+ DOMString mimeType;
+ unsigned long clockRate;
+ unsigned short channels = 1;
+ DOMString sdpFmtpLine;
+};
+
+dictionary RTCRtpParameters {
+ sequence encodings;
+ sequence headerExtensions;
+ RTCRtcpParameters rtcp;
+ sequence codecs;
+};
+
[Pref="media.peerconnection.enabled",
JSImplementation="@mozilla.org/dom/rtpsender;1"]
interface RTCRtpSender {
readonly attribute MediaStreamTrack track;
-
+ void setParameters (optional RTCRtpParameters parameters);
+ RTCRtpParameters getParameters();
Promise replaceTrack(MediaStreamTrack track);
};
diff --git a/gfx/harfbuzz/src/Makefile.in b/gfx/harfbuzz/src/Makefile.in
deleted file mode 100644
index b28584491f44..000000000000
--- a/gfx/harfbuzz/src/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (C) 2010 Mozilla Foundation
-#
-# This is used to integrate the HarfBuzz library with the Mozilla build.
-#
-# Permission is hereby granted, without written agreement and without
-# license or royalty fees, to use, copy, modify, and distribute this
-# software and its documentation for any purpose, provided that the
-# above copyright notice and the following two paragraphs appear in
-# all copies of this software.
-#
-# IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
-# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
-# ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
-# IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-#
-# THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
-# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
-# ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
-# PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-#
-# Mozilla author(s): Jonathan Kew
-#
-
-include $(topsrcdir)/config/rules.mk
-
-# Cancel the effect of the -DDEBUG macro if present,
-# because harfbuzz uses that name for its own purposes
-COMPILE_CXXFLAGS += -UDEBUG
diff --git a/gfx/harfbuzz/src/moz.build b/gfx/harfbuzz/src/moz.build
index 51dfc705c125..86bbb2b56f6c 100644
--- a/gfx/harfbuzz/src/moz.build
+++ b/gfx/harfbuzz/src/moz.build
@@ -69,3 +69,6 @@ DEFINES['PACKAGE_BUGREPORT'] = '"http://bugzilla.mozilla.org/"'
DEFINES['HAVE_OT'] = 1
DEFINES['HB_NO_MT'] = True
DEFINES['HB_NO_UNICODE_FUNCS'] = True
+# Cancel the effect of the -DDEBUG macro if present,
+# because harfbuzz uses that name for its own purposes
+DEFINES['DEBUG'] = False
diff --git a/gfx/vr/gfxVROculus.cpp b/gfx/vr/gfxVROculus.cpp
index 35169aae2753..44f845c1e7b2 100644
--- a/gfx/vr/gfxVROculus.cpp
+++ b/gfx/vr/gfxVROculus.cpp
@@ -149,7 +149,6 @@ InitializeOculusCAPI()
}
if (!ovrlib) {
- printf_stderr("Failed to load Oculus VR library!\n");
return false;
}
}
diff --git a/gfx/vr/gfxVROculus050.cpp b/gfx/vr/gfxVROculus050.cpp
index e3542632e73c..af867f165699 100644
--- a/gfx/vr/gfxVROculus050.cpp
+++ b/gfx/vr/gfxVROculus050.cpp
@@ -153,7 +153,6 @@ InitializeOculusCAPI()
}
if (!ovrlib) {
- printf_stderr("Failed to load Oculus VR library!\n");
return false;
}
}
diff --git a/gfx/vr/ipc/VRManagerParent.cpp b/gfx/vr/ipc/VRManagerParent.cpp
index 56a2b865ec8b..0080323cf0b2 100644
--- a/gfx/vr/ipc/VRManagerParent.cpp
+++ b/gfx/vr/ipc/VRManagerParent.cpp
@@ -106,7 +106,6 @@ VRManagerParent::CreateSameProcess()
void
VRManagerParent::DeferredDestroy()
{
- MOZ_ASSERT(mCompositorThreadHolder);
mCompositorThreadHolder = nullptr;
mSelfRef = nullptr;
}
diff --git a/js/public/TrackedOptimizationInfo.h b/js/public/TrackedOptimizationInfo.h
index 642f4d773055..ee9931278718 100644
--- a/js/public/TrackedOptimizationInfo.h
+++ b/js/public/TrackedOptimizationInfo.h
@@ -144,6 +144,7 @@ namespace JS {
\
_(ICNameStub_ReadSlot) \
_(ICNameStub_CallGetter) \
+ _(ICNameStub_TypeOfNoProperty) \
\
_(CantInlineGeneric) \
_(CantInlineNoTarget) \
diff --git a/js/src/asmjs/AsmJS.cpp b/js/src/asmjs/AsmJS.cpp
index b50d1688cf6d..80169567eb20 100644
--- a/js/src/asmjs/AsmJS.cpp
+++ b/js/src/asmjs/AsmJS.cpp
@@ -2034,9 +2034,12 @@ class MOZ_STACK_CLASS ModuleValidator
auto mutedErrors = Module::MutedBool(parser_.ss->mutedErrors());
- CacheableChars filename = make_string_copy(parser_.ss->filename());
- if (!filename)
- return false;
+ CacheableChars filename;
+ if (parser_.ss->filename()) {
+ filename = make_string_copy(parser_.ss->filename());
+ if (!filename)
+ return false;
+ }
CacheableTwoByteChars displayURL;
if (parser_.ss->hasDisplayURL()) {
@@ -6738,7 +6741,6 @@ CheckSwitch(FunctionValidator& f, ParseNode* switchStmt)
if (!CheckStatement(f, CaseBody(stmt)))
return false;
-
}
bool hasDefault = false;
diff --git a/js/src/asmjs/WasmIonCompile.cpp b/js/src/asmjs/WasmIonCompile.cpp
index b8ab10954377..0248b990d823 100644
--- a/js/src/asmjs/WasmIonCompile.cpp
+++ b/js/src/asmjs/WasmIonCompile.cpp
@@ -3075,7 +3075,6 @@ wasm::IonCompileFunction(IonCompileTask* task)
// Compile MIR graph
{
-
jit::SpewBeginFunction(&mir, nullptr);
jit::AutoSpewEndFunction spewEndFunction(&mir);
diff --git a/js/src/builtin/Date.js b/js/src/builtin/Date.js
index 8e938b30da9f..bd2d5854cbd0 100644
--- a/js/src/builtin/Date.js
+++ b/js/src/builtin/Date.js
@@ -101,7 +101,7 @@ function Date_toLocaleString() {
}
// Step 7.
- return intl_FormatDateTime(dateTimeFormat, x);
+ return intl_FormatDateTime(dateTimeFormat, x, false);
}
@@ -134,7 +134,7 @@ function Date_toLocaleDateString() {
}
// Step 7.
- return intl_FormatDateTime(dateTimeFormat, x);
+ return intl_FormatDateTime(dateTimeFormat, x, false);
}
@@ -167,5 +167,5 @@ function Date_toLocaleTimeString() {
}
// Step 7.
- return intl_FormatDateTime(dateTimeFormat, x);
+ return intl_FormatDateTime(dateTimeFormat, x, false);
}
diff --git a/js/src/builtin/Intl.cpp b/js/src/builtin/Intl.cpp
index 89fe2178688a..c780d1434745 100644
--- a/js/src/builtin/Intl.cpp
+++ b/js/src/builtin/Intl.cpp
@@ -12,6 +12,7 @@
#include "builtin/Intl.h"
#include "mozilla/Range.h"
+#include "mozilla/ScopeExit.h"
#include
@@ -45,6 +46,7 @@ using namespace js;
using mozilla::IsFinite;
using mozilla::IsNegativeZero;
+using mozilla::MakeScopeExit;
#if ENABLE_INTL_API
using icu::Locale;
@@ -176,6 +178,7 @@ ucol_getKeywordValuesForLocale(const char* key, const char* locale, UBool common
struct UParseError;
struct UFieldPosition;
+struct UFieldPositionIterator;
typedef void* UNumberFormat;
enum UNumberFormatStyle {
@@ -339,6 +342,46 @@ udatpg_close(UDateTimePatternGenerator* dtpg)
typedef void* UCalendar;
typedef void* UDateFormat;
+enum UDateFormatField {
+ UDAT_ERA_FIELD = 0,
+ UDAT_YEAR_FIELD = 1,
+ UDAT_MONTH_FIELD = 2,
+ UDAT_DATE_FIELD = 3,
+ UDAT_HOUR_OF_DAY1_FIELD = 4,
+ UDAT_HOUR_OF_DAY0_FIELD = 5,
+ UDAT_MINUTE_FIELD = 6,
+ UDAT_SECOND_FIELD = 7,
+ UDAT_FRACTIONAL_SECOND_FIELD = 8,
+ UDAT_DAY_OF_WEEK_FIELD = 9,
+ UDAT_DAY_OF_YEAR_FIELD = 10,
+ UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11,
+ UDAT_WEEK_OF_YEAR_FIELD = 12,
+ UDAT_WEEK_OF_MONTH_FIELD = 13,
+ UDAT_AM_PM_FIELD = 14,
+ UDAT_HOUR1_FIELD = 15,
+ UDAT_HOUR0_FIELD = 16,
+ UDAT_TIMEZONE_FIELD = 17,
+ UDAT_YEAR_WOY_FIELD = 18,
+ UDAT_DOW_LOCAL_FIELD = 19,
+ UDAT_EXTENDED_YEAR_FIELD = 20,
+ UDAT_JULIAN_DAY_FIELD = 21,
+ UDAT_MILLISECONDS_IN_DAY_FIELD = 22,
+ UDAT_TIMEZONE_RFC_FIELD = 23,
+ UDAT_TIMEZONE_GENERIC_FIELD = 24,
+ UDAT_STANDALONE_DAY_FIELD = 25,
+ UDAT_STANDALONE_MONTH_FIELD = 26,
+ UDAT_QUARTER_FIELD = 27,
+ UDAT_STANDALONE_QUARTER_FIELD = 28,
+ UDAT_TIMEZONE_SPECIAL_FIELD = 29,
+ UDAT_YEAR_NAME_FIELD = 30,
+ UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31,
+ UDAT_TIMEZONE_ISO_FIELD = 32,
+ UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33,
+ UDAT_RELATED_YEAR_FIELD = 34,
+ UDAT_TIME_SEPARATOR_FIELD = 35,
+ UDAT_FIELD_COUNT = 36
+};
+
enum UDateFormatStyle {
UDAT_PATTERN = -2,
UDAT_IGNORE = UDAT_PATTERN
@@ -383,6 +426,32 @@ udat_format(const UDateFormat* format, UDate dateToFormat, UChar* result,
MOZ_CRASH("udat_format: Intl API disabled");
}
+static int32_t
+udat_formatForFields(const UDateFormat* format, UDate dateToFormat,
+ UChar* result, int32_t resultLength, UFieldPositionIterator* fpositer,
+ UErrorCode* status)
+{
+ MOZ_CRASH("udat_formatForFields: Intl API disabled");
+}
+
+static UFieldPositionIterator*
+ufieldpositer_open(UErrorCode* status)
+{
+ MOZ_CRASH("ufieldpositer_open: Intl API disabled");
+}
+
+static void
+ufieldpositer_close(UFieldPositionIterator* fpositer)
+{
+ MOZ_CRASH("ufieldpositer_close: Intl API disabled");
+}
+
+static int32_t
+ufieldpositer_next(UFieldPositionIterator* fpositer, int32_t* beginIndex, int32_t* endIndex)
+{
+ MOZ_CRASH("ufieldpositer_next: Intl API disabled");
+}
+
static void
udat_close(UDateFormat* format)
{
@@ -1669,11 +1738,9 @@ InitDateTimeFormatClass(JSContext* cx, HandleObject Intl, Handle
if (!JS_DefineFunctions(cx, proto, dateTimeFormat_methods))
return nullptr;
- /*
- * Install the getter for DateTimeFormat.prototype.format, which returns a
- * bound formatting function for the specified DateTimeFormat object
- * (suitable for passing to methods like Array.prototype.map).
- */
+ // Install a getter for DateTimeFormat.prototype.format that returns a
+ // formatting function bound to a specified DateTimeFormat object (suitable
+ // for passing to methods like Array.prototype.map).
RootedValue getter(cx);
if (!GlobalObject::getIntrinsicValue(cx, cx->global(), cx->names().DateTimeFormatFormatGet,
&getter))
@@ -1687,6 +1754,22 @@ InitDateTimeFormatClass(JSContext* cx, HandleObject Intl, Handle
return nullptr;
}
+ // If the still-experimental DateTimeFormat.prototype.formatToParts method
+ // is enabled, also add its getter.
+ if (cx->compartment()->creationOptions().experimentalDateTimeFormatFormatToPartsEnabled()) {
+ if (!GlobalObject::getIntrinsicValue(cx, cx->global(),
+ cx->names().DateTimeFormatFormatToPartsGet, &getter))
+ {
+ return nullptr;
+ }
+ if (!DefineProperty(cx, proto, cx->names().formatToParts, UndefinedHandleValue,
+ JS_DATA_TO_FUNC_PTR(JSGetterOp, &getter.toObject()),
+ nullptr, JSPROP_GETTER | JSPROP_SHARED))
+ {
+ return nullptr;
+ }
+ }
+
RootedValue options(cx);
if (!CreateDefaultOptions(cx, &options))
return nullptr;
@@ -1986,6 +2069,210 @@ intl_FormatDateTime(JSContext* cx, UDateFormat* df, double x, MutableHandleValue
return false;
result.setString(str);
+
+ return true;
+}
+
+using FieldType = ImmutablePropertyNamePtr JSAtomState::*;
+
+static FieldType
+GetFieldTypeForFormatField(UDateFormatField fieldName)
+{
+ // See intl/icu/source/i18n/unicode/udat.h for a detailed field list. This
+ // switch is deliberately exhaustive: cases might have to be added/removed
+ // if this code is compiled with a different ICU with more
+ // UDateFormatField enum initializers. Please guard such cases with
+ // appropriate ICU version-testing #ifdefs, should cross-version divergence
+ // occur.
+ switch (fieldName) {
+ case UDAT_ERA_FIELD:
+ return &JSAtomState::era;
+ case UDAT_YEAR_FIELD:
+ case UDAT_YEAR_WOY_FIELD:
+ case UDAT_EXTENDED_YEAR_FIELD:
+ case UDAT_YEAR_NAME_FIELD:
+ return &JSAtomState::year;
+
+ case UDAT_MONTH_FIELD:
+ case UDAT_STANDALONE_MONTH_FIELD:
+ return &JSAtomState::month;
+
+ case UDAT_DATE_FIELD:
+ case UDAT_JULIAN_DAY_FIELD:
+ return &JSAtomState::day;
+
+ case UDAT_HOUR_OF_DAY1_FIELD:
+ case UDAT_HOUR_OF_DAY0_FIELD:
+ case UDAT_HOUR1_FIELD:
+ case UDAT_HOUR0_FIELD:
+ return &JSAtomState::hour;
+
+ case UDAT_MINUTE_FIELD:
+ return &JSAtomState::minute;
+
+ case UDAT_SECOND_FIELD:
+ return &JSAtomState::second;
+
+ case UDAT_DAY_OF_WEEK_FIELD:
+ case UDAT_STANDALONE_DAY_FIELD:
+ case UDAT_DOW_LOCAL_FIELD:
+ case UDAT_DAY_OF_WEEK_IN_MONTH_FIELD:
+ return &JSAtomState::weekday;
+
+ case UDAT_AM_PM_FIELD:
+ return &JSAtomState::dayperiod;
+
+ case UDAT_TIMEZONE_FIELD:
+ return &JSAtomState::timeZoneName;
+
+ case UDAT_FRACTIONAL_SECOND_FIELD:
+ case UDAT_DAY_OF_YEAR_FIELD:
+ case UDAT_WEEK_OF_YEAR_FIELD:
+ case UDAT_WEEK_OF_MONTH_FIELD:
+ case UDAT_MILLISECONDS_IN_DAY_FIELD:
+ case UDAT_TIMEZONE_RFC_FIELD:
+ case UDAT_TIMEZONE_GENERIC_FIELD:
+ case UDAT_QUARTER_FIELD:
+ case UDAT_STANDALONE_QUARTER_FIELD:
+ case UDAT_TIMEZONE_SPECIAL_FIELD:
+ case UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD:
+ case UDAT_TIMEZONE_ISO_FIELD:
+ case UDAT_TIMEZONE_ISO_LOCAL_FIELD:
+#ifndef U_HIDE_INTERNAL_API
+ case UDAT_RELATED_YEAR_FIELD:
+#endif
+#ifndef U_HIDE_DRAFT_API
+ case UDAT_TIME_SEPARATOR_FIELD:
+#endif
+ // These fields are all unsupported.
+ return nullptr;
+
+ case UDAT_FIELD_COUNT:
+ MOZ_ASSERT_UNREACHABLE("format field sentinel value returned by "
+ "iterator!");
+ }
+
+ MOZ_ASSERT_UNREACHABLE("unenumerated, undocumented format field returned "
+ "by iterator");
+ return nullptr;
+}
+
+static bool
+intl_FormatToPartsDateTime(JSContext* cx, UDateFormat* df, double x, MutableHandleValue result)
+{
+ if (!IsFinite(x)) {
+ JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_DATE_NOT_FINITE);
+ return false;
+ }
+
+ Vector chars(cx);
+ if (!chars.resize(INITIAL_CHAR_BUFFER_SIZE))
+ return false;
+
+ UErrorCode status = U_ZERO_ERROR;
+ UFieldPositionIterator* fpositer = ufieldpositer_open(&status);
+ if (U_FAILURE(status)) {
+ JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
+ return false;
+ }
+ auto closeFieldPosIter = MakeScopeExit([&]() { ufieldpositer_close(fpositer); });
+
+ int resultSize =
+ udat_formatForFields(df, x, Char16ToUChar(chars.begin()), INITIAL_CHAR_BUFFER_SIZE,
+ fpositer, &status);
+ if (status == U_BUFFER_OVERFLOW_ERROR) {
+ if (!chars.resize(resultSize))
+ return false;
+ status = U_ZERO_ERROR;
+ udat_formatForFields(df, x, Char16ToUChar(chars.begin()), resultSize, fpositer, &status);
+ }
+ if (U_FAILURE(status)) {
+ JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
+ return false;
+ }
+
+ RootedArrayObject partsArray(cx, NewDenseEmptyArray(cx));
+ if (!partsArray)
+ return false;
+ if (resultSize == 0) {
+ // An empty string contains no parts, so avoid extra work below.
+ result.setObject(*partsArray);
+ return true;
+ }
+
+ RootedString overallResult(cx, NewStringCopyN(cx, chars.begin(), resultSize));
+ if (!overallResult)
+ return false;
+
+ size_t lastEndIndex = 0;
+
+ uint32_t partIndex = 0;
+ RootedObject singlePart(cx);
+ RootedValue partType(cx);
+ RootedString partSubstr(cx);
+ RootedValue val(cx);
+
+ auto AppendPart = [&](FieldType type, size_t beginIndex, size_t endIndex) {
+ singlePart = NewBuiltinClassInstance(cx);
+ if (!singlePart)
+ return false;
+
+ partType = StringValue(cx->names().*type);
+ if (!DefineProperty(cx, singlePart, cx->names().type, partType))
+ return false;
+
+ partSubstr = SubstringKernel(cx, overallResult, beginIndex, endIndex - beginIndex);
+ if (!partSubstr)
+ return false;
+
+ val = StringValue(partSubstr);
+ if (!DefineProperty(cx, singlePart, cx->names().value, val))
+ return false;
+
+ val = ObjectValue(*singlePart);
+ if (!DefineElement(cx, partsArray, partIndex, val))
+ return false;
+
+ lastEndIndex = endIndex;
+ partIndex++;
+ return true;
+ };
+
+ int32_t fieldInt, beginIndexInt, endIndexInt;
+ while ((fieldInt = ufieldpositer_next(fpositer, &beginIndexInt, &endIndexInt)) >= 0) {
+ MOZ_ASSERT(beginIndexInt >= 0);
+ MOZ_ASSERT(endIndexInt >= 0);
+ MOZ_ASSERT(beginIndexInt <= endIndexInt,
+ "field iterator returning invalid range");
+
+ size_t beginIndex(beginIndexInt);
+ size_t endIndex(endIndexInt);
+
+ // Technically this isn't guaranteed. But it appears true in pratice,
+ // and http://bugs.icu-project.org/trac/ticket/12024 is expected to
+ // correct the documentation lapse.
+ MOZ_ASSERT(lastEndIndex <= beginIndex,
+ "field iteration didn't return fields in order start to "
+ "finish as expected");
+
+ if (FieldType type = GetFieldTypeForFormatField(static_cast(fieldInt))) {
+ if (lastEndIndex < beginIndex) {
+ if (!AppendPart(&JSAtomState::separator, lastEndIndex, beginIndex))
+ return false;
+ }
+
+ if (!AppendPart(type, beginIndex, endIndex))
+ return false;
+ }
+ }
+
+ // Append any final separator.
+ if (lastEndIndex < overallResult->length()) {
+ if (!AppendPart(&JSAtomState::separator, lastEndIndex, overallResult->length()))
+ return false;
+ }
+
+ result.setObject(*partsArray);
return true;
}
@@ -1993,9 +2280,10 @@ bool
js::intl_FormatDateTime(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
- MOZ_ASSERT(args.length() == 2);
+ MOZ_ASSERT(args.length() == 3);
MOZ_ASSERT(args[0].isObject());
MOZ_ASSERT(args[1].isNumber());
+ MOZ_ASSERT(args[2].isBoolean());
RootedObject dateTimeFormat(cx, &args[0].toObject());
@@ -2024,7 +2312,9 @@ js::intl_FormatDateTime(JSContext* cx, unsigned argc, Value* vp)
// Use the UDateFormat to actually format the time stamp.
RootedValue result(cx);
- bool success = intl_FormatDateTime(cx, df, args[1].toNumber(), &result);
+ bool success = args[2].toBoolean()
+ ? intl_FormatToPartsDateTime(cx, df, args[1].toNumber(), &result)
+ : intl_FormatDateTime(cx, df, args[1].toNumber(), &result);
if (!isDateTimeFormatInstance)
udat_close(df);
diff --git a/js/src/builtin/Intl.js b/js/src/builtin/Intl.js
index d69fa4599671..de7a1132265f 100644
--- a/js/src/builtin/Intl.js
+++ b/js/src/builtin/Intl.js
@@ -2712,10 +2712,9 @@ function dateTimeFormatFormatToBind() {
var x = (date === undefined) ? std_Date_now() : ToNumber(date);
// Step 1.a.iii.
- return intl_FormatDateTime(this, x);
+ return intl_FormatDateTime(this, x, false);
}
-
/**
* Returns a function bound to this DateTimeFormat that returns a String value
* representing the result of calling ToNumber(date) according to the
@@ -2742,6 +2741,35 @@ function Intl_DateTimeFormat_format_get() {
}
+function dateTimeFormatFormatToPartsToBind() {
+ // Steps 1.a.i-ii
+ var date = arguments.length > 0 ? arguments[0] : undefined;
+ var x = (date === undefined) ? std_Date_now() : ToNumber(date);
+
+ // Step 1.a.iii.
+ return intl_FormatDateTime(this, x, true);
+}
+
+
+function Intl_DateTimeFormat_formatToParts_get() {
+ // Check "this DateTimeFormat object" per introduction of section 12.3.
+ var internals = getDateTimeFormatInternals(this, "formatToParts");
+
+ // Step 1.
+ if (internals.boundFormatToParts === undefined) {
+ // Step 1.a.
+ var F = dateTimeFormatFormatToPartsToBind;
+
+ // Step 1.b-d.
+ var bf = callFunction(std_Function_bind, F, this);
+ internals.boundFormatToParts = bf;
+ }
+
+ // Step 2.
+ return internals.boundFormatToParts;
+}
+
+
/**
* Returns the resolved options for a DateTimeFormat object.
*
diff --git a/js/src/builtin/embedjs.py b/js/src/builtin/embedjs.py
index ece905dfefc3..fc2e9942e6f2 100644
--- a/js/src/builtin/embedjs.py
+++ b/js/src/builtin/embedjs.py
@@ -134,12 +134,8 @@ def get_config_defines(buildconfig):
# Collect defines equivalent to ACDEFINES and add MOZ_DEBUG_DEFINES.
env = {key: value for key, value in buildconfig.defines.iteritems()
if key not in buildconfig.non_global_defines}
- for value in buildconfig.substs['MOZ_DEBUG_DEFINES'].split():
- assert value[:2] == "-D"
- pair = value[2:].split('=', 1)
- if len(pair) == 1:
- pair.append(1)
- env[pair[0]] = pair[1]
+ for define in buildconfig.substs['MOZ_DEBUG_DEFINES']:
+ env[define] = 1
return env
def process_inputs(namespace, c_out, msg_file, inputs):
diff --git a/js/src/configure.in b/js/src/configure.in
index 0f02b1fc2e78..74807ee6629c 100644
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1272,7 +1272,7 @@ if test "$GNU_CC"; then
esac
fi
- _DEFINES_CFLAGS='-include $(DEPTH)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
+ _DEFINES_CFLAGS='-include $(topobjdir)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
_USE_CPP_INCLUDE_FLAG=1
elif test "$SOLARIS_SUNPRO_CC"; then
@@ -1384,7 +1384,7 @@ if test "$GNU_CXX"; then
esac
fi
- _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/js/src/js-confdefs.h'
+ _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(topobjdir)/js/src/js-confdefs.h'
_USE_CPP_INCLUDE_FLAG=1
# Recent clang and gcc support C++11 deleted functions without warnings if
@@ -1744,8 +1744,8 @@ ia64*-hpux*)
WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
_USE_CPP_INCLUDE_FLAG=1
- _DEFINES_CFLAGS='-FI $(DEPTH)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
- _DEFINES_CXXFLAGS='-FI $(DEPTH)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
+ _DEFINES_CFLAGS='-FI $(topobjdir)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
+ _DEFINES_CXXFLAGS='-FI $(topobjdir)/js/src/js-confdefs.h -DMOZILLA_CLIENT'
CFLAGS="$CFLAGS -W3 -Gy"
CXXFLAGS="$CXXFLAGS -W3 -Gy"
if test "$CPU_ARCH" = "x86" -a -z "$CLANG_CL"; then
@@ -3731,22 +3731,19 @@ CXXFLAGS=`echo \
COMPILE_CFLAGS=`echo \
$_DEFINES_CFLAGS \
- $_DEPEND_CFLAGS \
$COMPILE_CFLAGS`
COMPILE_CXXFLAGS=`echo \
$_DEFINES_CXXFLAGS \
- $_DEPEND_CFLAGS \
$COMPILE_CXXFLAGS`
HOST_CFLAGS=`echo \
- $HOST_CFLAGS \
- $_DEPEND_CFLAGS`
+ $HOST_CFLAGS`
HOST_CXXFLAGS=`echo \
- $HOST_CXXFLAGS \
- $_DEPEND_CFLAGS`
+ $HOST_CXXFLAGS`
+AC_SUBST(_DEPEND_CFLAGS)
AC_SUBST(MOZ_NATIVE_NSPR)
if test -n "$MOZ_NUWA_PROCESS"; then
diff --git a/js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js b/js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js
new file mode 100644
index 000000000000..47001030f4bb
--- /dev/null
+++ b/js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js
@@ -0,0 +1,25 @@
+window.tests.set('propertyTreeSplitting', (function() {
+var garbage = [];
+var garbageIndex = 0;
+return {
+ description: "use delete to generate Shape garbage",
+ load: (N) => { garbage = new Array(N); },
+ unload: () => { garbage = []; garbageIndex = 0; },
+ makeGarbage: (N) => {
+ function f()
+ {
+ var a1 = eval;
+ delete eval;
+ eval = a1;
+ var a3 = toString;
+ delete toString;
+ toString = a3;
+ }
+ for (var a = 0; a < N; ++a) {
+ garbage[garbageIndex++] = new f();
+ if (garbageIndex == garbage.length)
+ garbageIndex = 0;
+ }
+ }
+};
+})());
diff --git a/js/src/devtools/gc-ubench/index.html b/js/src/devtools/gc-ubench/index.html
index 027e0c06f968..3b2ae9076877 100644
--- a/js/src/devtools/gc-ubench/index.html
+++ b/js/src/devtools/gc-ubench/index.html
@@ -20,6 +20,7 @@
+
diff --git a/js/src/devtools/rootAnalysis/annotations.js b/js/src/devtools/rootAnalysis/annotations.js
index 860e06eacb52..c603f9828cf4 100644
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -78,7 +78,8 @@ var ignoreCallees = {
"z_stream_s.zfree" : true,
"GrGLInterface.fCallback" : true,
"std::strstreambuf._M_alloc_fun" : true,
- "std::strstreambuf._M_free_fun" : true
+ "std::strstreambuf._M_free_fun" : true,
+ "struct js::gc::Callback.op" : true,
};
function fieldCallCannotGC(csu, fullfield)
@@ -187,6 +188,9 @@ var ignoreFunctions = {
"void test::RingbufferDumper::OnTestPartResult(testing::TestPartResult*)" : true,
"float64 JS_GetCurrentEmbedderTime()" : true,
+
+ "uint64 js::TenuringTracer::moveObjectToTenured(JSObject*, JSObject*, int32)" : true,
+ "uint32 js::TenuringTracer::moveObjectToTenured(JSObject*, JSObject*, int32)" : true,
};
function isProtobuf(name)
diff --git a/js/src/doc/JITOptimizations/Outcomes.md b/js/src/doc/JITOptimizations/Outcomes.md
index 38e6089319e3..ddd59da2a007 100644
--- a/js/src/doc/JITOptimizations/Outcomes.md
+++ b/js/src/doc/JITOptimizations/Outcomes.md
@@ -407,6 +407,11 @@ a scope chain object.
An inline cache element which loads a bare variable name by calling a
getter function on the global object.
+### ICNameStub_TypeOfNoProperty
+
+An inline cache element which loads undefined for the type
+of a missing property.
+
## Call Inlining Outcomes
Optimization outcomes of attempts to inline function calls.
diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h
index d7cf559b9874..0ee6357a11c7 100644
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -756,6 +756,9 @@ class GCRuntime
void setGCCallback(JSGCCallback callback, void* data);
void callGCCallback(JSGCStatus status) const;
+ void setObjectsTenuredCallback(JSObjectsTenuredCallback callback,
+ void* data);
+ void callObjectsTenuredCallback();
bool addFinalizeCallback(JSFinalizeCallback callback, void* data);
void removeFinalizeCallback(JSFinalizeCallback func);
bool addWeakPointerZoneGroupCallback(JSWeakPointerZoneGroupCallback callback, void* data);
@@ -1273,6 +1276,7 @@ class GCRuntime
bool fullCompartmentChecks;
Callback gcCallback;
+ Callback tenuredCallback;
CallbackVector finalizeCallbacks;
CallbackVector updateWeakPointerZoneGroupCallbacks;
CallbackVector updateWeakPointerCompartmentCallbacks;
diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp
index 8df3c3c6d226..2627b12cc9ae 100644
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -2215,6 +2215,8 @@ js::TenuringTracer::moveObjectToTenured(JSObject* dst, JSObject* src, AllocKind
tenuredSize += UnboxedArrayObject::objectMovedDuringMinorGC(this, dst, src, dstKind);
} else if (src->is()) {
tenuredSize += ArgumentsObject::objectMovedDuringMinorGC(this, dst, src);
+ } else if (JSObjectMovedOp op = dst->getClass()->ext.objectMovedOp) {
+ op(dst, src);
} else {
// Objects with JSCLASS_SKIP_NURSERY_FINALIZE need to be handled above
// to ensure any additional nursery buffers they hold are moved.
diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
index a5bcb6b9696d..8d03adc05073 100644
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -496,6 +496,10 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList
forwardedBuffers.finish();
TIME_END(updateJitActivations);
+ TIME_START(objectsTenuredCallback);
+ rt->gc.callObjectsTenuredCallback();
+ TIME_END(objectsTenuredCallback);
+
// Sweep.
TIME_START(freeMallocedBuffers);
freeMallocedBuffers();
@@ -576,6 +580,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList
{"mkDbgr", TIME_TOTAL(markDebugger)},
{"clrNOC", TIME_TOTAL(clearNewObjectCache)},
{"collct", TIME_TOTAL(collectToFP)},
+ {" tenCB", TIME_TOTAL(objectsTenuredCallback)},
{"swpABO", TIME_TOTAL(sweepArrayBufferViewList)},
{"updtIn", TIME_TOTAL(updateJitActivations)},
{"frSlts", TIME_TOTAL(freeMallocedBuffers)},
diff --git a/js/src/jit-test/tests/ion/bug470143.js b/js/src/jit-test/tests/ion/bug470143.js
new file mode 100644
index 000000000000..0b63d4f0a4ff
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug470143.js
@@ -0,0 +1,6 @@
+// Test that getname caches correctly handle typeof for missing names.
+function f() { for (i = 0; i < 2000; ++i) { var k = typeof nosuchvar; } return k; }
+
+assertEq(f(), "undefined");
+this.nosuchvar = 5;
+assertEq(f(), "number");
diff --git a/js/src/jit/IonCaches.cpp b/js/src/jit/IonCaches.cpp
index ca3b6fda210e..2d358735af1a 100644
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -4920,6 +4920,62 @@ IsCacheableNameCallGetter(HandleObject scopeChain, HandleObject obj, HandleObjec
IsCacheableGetPropCallScripted(obj, holder, shape);
}
+bool
+NameIC::attachTypeOfNoProperty(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject scopeChain)
+{
+ MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_);
+ Label failures;
+ StubAttacher attacher(*this);
+
+ Register scratchReg = outputReg().valueReg().scratchReg();
+
+ masm.movePtr(scopeChainReg(), scratchReg);
+
+ // Generate scope chain guards.
+ // Since the property was not defined on any object, iterate until reaching the global.
+ JSObject* tobj = scopeChain;
+ while (true) {
+ GenerateScopeChainGuard(masm, tobj, scratchReg, nullptr, &failures);
+
+ if (tobj->is())
+ break;
+
+ // Load the next link.
+ tobj = &tobj->as().enclosingScope();
+ masm.extractObject(Address(scratchReg, ScopeObject::offsetOfEnclosingScope()), scratchReg);
+ }
+
+ masm.moveValue(UndefinedValue(), outputReg().valueReg());
+ attacher.jumpRejoin(masm);
+
+ masm.bind(&failures);
+ attacher.jumpNextStub(masm);
+
+ return linkAndAttachStub(cx, masm, attacher, ion, "generic",
+ JS::TrackedOutcome::ICNameStub_TypeOfNoProperty);
+}
+
+static bool
+IsCacheableNameNoProperty(HandleObject scopeChain, HandleObject obj,
+ HandleObject holder, HandleShape shape, jsbytecode* pc,
+ NameIC& cache)
+{
+ if (cache.isTypeOf() && !shape) {
+ MOZ_ASSERT(!obj);
+ MOZ_ASSERT(!holder);
+ MOZ_ASSERT(scopeChain);
+
+ // Assert those extra things checked by IsCacheableNoProperty().
+ MOZ_ASSERT(cache.outputReg().hasValue());
+ MOZ_ASSERT(pc != nullptr);
+
+ return true;
+ }
+
+ return false;
+}
+
bool
NameIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex, HandleObject scopeChain,
MutableHandleValue vp)
@@ -4962,6 +5018,9 @@ NameIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex, Handl
{
return false;
}
+ } else if (IsCacheableNameNoProperty(scopeChain, obj, holder, shape, pc, cache)) {
+ if (!cache.attachTypeOfNoProperty(cx, outerScript, ion, scopeChain))
+ return false;
}
}
diff --git a/js/src/jit/IonCaches.h b/js/src/jit/IonCaches.h
index e3c3e35371f8..9655be2f2c6c 100644
--- a/js/src/jit/IonCaches.h
+++ b/js/src/jit/IonCaches.h
@@ -794,6 +794,9 @@ class NameIC : public IonCache
HandleObject scopeChain, HandleObject obj, HandleObject holder,
HandleShape shape, void* returnAddr);
+ bool attachTypeOfNoProperty(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject scopeChain);
+
static bool
update(JSContext* cx, HandleScript outerScript, size_t cacheIndex, HandleObject scopeChain,
MutableHandleValue vp);
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index e3e0cad2eb0c..07a75f3f9d71 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1395,6 +1395,14 @@ JS_SetGCCallback(JSRuntime* rt, JSGCCallback cb, void* data)
rt->gc.setGCCallback(cb, data);
}
+JS_PUBLIC_API(void)
+JS_SetObjectsTenuredCallback(JSRuntime* rt, JSObjectsTenuredCallback cb,
+ void* data)
+{
+ AssertHeapIsIdle(rt);
+ rt->gc.setObjectsTenuredCallback(cb, data);
+}
+
JS_PUBLIC_API(bool)
JS_AddFinalizeCallback(JSRuntime* rt, JSFinalizeCallback cb, void* data)
{
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index fd8e23699aff..07f9e34199c1 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -572,6 +572,9 @@ typedef enum JSGCStatus {
typedef void
(* JSGCCallback)(JSRuntime* rt, JSGCStatus status, void* data);
+typedef void
+(* JSObjectsTenuredCallback)(JSRuntime* rt, void* data);
+
typedef enum JSFinalizeStatus {
/**
* Called when preparing to sweep a group of compartments, before anything
@@ -1654,6 +1657,10 @@ JS_MaybeGC(JSContext* cx);
extern JS_PUBLIC_API(void)
JS_SetGCCallback(JSRuntime* rt, JSGCCallback cb, void* data);
+extern JS_PUBLIC_API(void)
+JS_SetObjectsTenuredCallback(JSRuntime* rt, JSObjectsTenuredCallback cb,
+ void* data);
+
extern JS_PUBLIC_API(bool)
JS_AddFinalizeCallback(JSRuntime* rt, JSFinalizeCallback cb, void* data);
@@ -2173,7 +2180,8 @@ class JS_PUBLIC_API(CompartmentCreationOptions)
invisibleToDebugger_(false),
mergeable_(false),
preserveJitCode_(false),
- cloneSingletons_(false)
+ cloneSingletons_(false),
+ experimentalDateTimeFormatFormatToPartsEnabled_(false)
{
zone_.spec = JS::FreshZone;
}
@@ -2236,6 +2244,24 @@ class JS_PUBLIC_API(CompartmentCreationOptions)
return *this;
}
+ // ECMA-402 is considering adding a "formatToParts" DateTimeFormat method,
+ // that exposes not just a formatted string but its ordered subcomponents.
+ // The method, its semantics, and its name are all well short of being
+ // finalized, so for now it's exposed *only* if requested.
+ //
+ // Until "formatToParts" is included in a final specification edition, it's
+ // subject to change or removal at any time. Do *not* rely on it in
+ // mission-critical code that can't be changed if ECMA-402 decides not to
+ // accept the method in its current form.
+ bool experimentalDateTimeFormatFormatToPartsEnabled() const {
+ return experimentalDateTimeFormatFormatToPartsEnabled_;
+ }
+ CompartmentCreationOptions& setExperimentalDateTimeFormatFormatToPartsEnabled(bool flag) {
+ experimentalDateTimeFormatFormatToPartsEnabled_ = flag;
+ return *this;
+ }
+
+
private:
JSAddonId* addonId_;
JSTraceOp traceGlobal_;
@@ -2247,6 +2273,7 @@ class JS_PUBLIC_API(CompartmentCreationOptions)
bool mergeable_;
bool preserveJitCode_;
bool cloneSingletons_;
+ bool experimentalDateTimeFormatFormatToPartsEnabled_;
};
/**
diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp
index e8d3d583d878..99ee99ee1b53 100644
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1606,6 +1606,21 @@ GCRuntime::callGCCallback(JSGCStatus status) const
gcCallback.op(rt, status, gcCallback.data);
}
+void
+GCRuntime::setObjectsTenuredCallback(JSObjectsTenuredCallback callback,
+ void* data)
+{
+ tenuredCallback.op = callback;
+ tenuredCallback.data = data;
+}
+
+void
+GCRuntime::callObjectsTenuredCallback()
+{
+ if (tenuredCallback.op)
+ tenuredCallback.op(rt, tenuredCallback.data);
+}
+
namespace {
class AutoNotifyGCActivity {
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
index b7e90943b8ef..d45948c06422 100644
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -3977,6 +3977,11 @@ NewGlobal(JSContext* cx, unsigned argc, Value* vp)
if (v.isBoolean())
creationOptions.setCloneSingletons(v.toBoolean());
+ if (!JS_GetProperty(cx, opts, "experimentalDateTimeFormatFormatToPartsEnabled", &v))
+ return true;
+ if (v.isBoolean())
+ creationOptions.setExperimentalDateTimeFormatFormatToPartsEnabled(v.toBoolean());
+
if (!JS_GetProperty(cx, opts, "sameZoneAs", &v))
return false;
if (v.isObject())
diff --git a/js/src/tests/Intl/DateTimeFormat/formatToParts.js b/js/src/tests/Intl/DateTimeFormat/formatToParts.js
new file mode 100644
index 000000000000..e88439cffdcd
--- /dev/null
+++ b/js/src/tests/Intl/DateTimeFormat/formatToParts.js
@@ -0,0 +1,176 @@
+// |reftest| skip-if(!this.hasOwnProperty("Intl")||!this.newGlobal||!newGlobal({experimentalDateTimeFormatFormatToPartsEnabled:true}).Intl.DateTimeFormat().formatToParts)
+// Any copyright is dedicated to the Public Domain.
+// http://creativecommons.org/licenses/publicdomain/
+
+// Tests the format function with a diverse set of locales and options.
+// Always use UTC to avoid dependencies on test environment.
+
+/*
+ * Return true if A is equal to B, where equality on arrays and objects
+ * means that they have the same set of enumerable properties, the values
+ * of each property are deep_equal, and their 'length' properties are
+ * equal. Equality on other types is ==.
+ */
+function deepEqual(a, b) {
+ if (typeof a !== typeof b)
+ return false;
+
+ if (a === null)
+ return b === null;
+
+ if (typeof a === 'object') {
+ // For every property of a, does b have that property with an equal value?
+ var props = {};
+ for (var prop in a) {
+ if (!deepEqual(a[prop], b[prop]))
+ return false;
+ props[prop] = true;
+ }
+
+ // Are all of b's properties present on a?
+ for (var prop in b)
+ if (!props[prop])
+ return false;
+
+ // length isn't enumerable, but we want to check it, too.
+ return a.length === b.length;
+ }
+
+ return Object.is(a, b);
+}
+
+function composeDate(parts) {
+ return parts.map(({value}) => value)
+ .reduce((string, part) => string + part);
+}
+
+var format;
+var date = Date.UTC(2012, 11, 17, 3, 0, 42);
+
+// The experimental formatToParts method is only exposed if specifically
+// requested. Perform all tests using DateTimeFormat instances from a global
+// object with this method enabled.
+var DateTimeFormat =
+ newGlobal({experimentalDateTimeFormatFormatToPartsEnabled:true}).Intl.DateTimeFormat;
+
+// Locale en-US; default options.
+format = new DateTimeFormat("en-us", {timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'month', value: '12' },
+ { type: 'separator', value: '/' },
+ { type: 'day', value: '17' },
+ { type: 'separator', value: '/' },
+ { type: 'year', value: '2012' }
+]), true);
+
+// Just date
+format = new DateTimeFormat("en-us", {
+ year: 'numeric',
+ month: 'numeric',
+ day: 'numeric',
+ timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'month', value: '12' },
+ { type: 'separator', value: '/' },
+ { type: 'day', value: '17' },
+ { type: 'separator', value: '/' },
+ { type: 'year', value: '2012' }
+]), true);
+assertEq(composeDate(format.formatToParts(date)), format.format(date));
+
+// Just time in hour24
+format = new DateTimeFormat("en-us", {
+ hour: 'numeric',
+ minute: 'numeric',
+ second: 'numeric',
+ hour12: false,
+ timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'hour', value: '03' },
+ { type: 'separator', value: ':' },
+ { type: 'minute', value: '00' },
+ { type: 'separator', value: ':' },
+ { type: 'second', value: '42' }
+]), true);
+assertEq(composeDate(format.formatToParts(date)), format.format(date));
+
+// Just time in hour12
+format = new DateTimeFormat("en-us", {
+ hour: 'numeric',
+ minute: 'numeric',
+ second: 'numeric',
+ hour12: true,
+ timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'hour', value: '3' },
+ { type: 'separator', value: ':' },
+ { type: 'minute', value: '00' },
+ { type: 'separator', value: ':' },
+ { type: 'second', value: '42' },
+ { type: 'separator', value: ' ' },
+ { type: 'dayperiod', value: 'AM' }
+]), true);
+assertEq(composeDate(format.formatToParts(date)), format.format(date));
+
+// Just month.
+format = new DateTimeFormat("en-us", {
+ month: "narrow",
+ timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'month', value: 'D' }
+]), true);
+assertEq(composeDate(format.formatToParts(date)), format.format(date));
+
+// Just weekday.
+format = new DateTimeFormat("en-us", {
+ weekday: "narrow",
+ timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'weekday', value: 'M' }
+]), true);
+assertEq(composeDate(format.formatToParts(date)), format.format(date));
+
+// Year and era.
+format = new DateTimeFormat("en-us", {
+ year: "numeric",
+ era: "short",
+ timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'year', value: '2012' },
+ { type: 'separator', value: ' ' },
+ { type: 'era', value: 'AD' }
+]), true);
+assertEq(composeDate(format.formatToParts(date)), format.format(date));
+
+// Time and date
+format = new DateTimeFormat("en-us", {
+ weekday: 'long',
+ year: 'numeric',
+ month: 'numeric',
+ day: 'numeric',
+ hour: 'numeric',
+ minute: 'numeric',
+ second: 'numeric',
+ hour12: true,
+ timeZone: "UTC"});
+assertEq(deepEqual(format.formatToParts(date), [
+ { type: 'weekday', value: 'Monday' },
+ { type: 'separator', value: ', ' },
+ { type: 'month', value: '12' },
+ { type: 'separator', value: '/' },
+ { type: 'day', value: '17' },
+ { type: 'separator', value: '/' },
+ { type: 'year', value: '2012' },
+ { type: 'separator', value: ', ' },
+ { type: 'hour', value: '3' },
+ { type: 'separator', value: ':' },
+ { type: 'minute', value: '00' },
+ { type: 'separator', value: ':' },
+ { type: 'second', value: '42' },
+ { type: 'separator', value: ' ' },
+ { type: 'dayperiod', value: 'AM' }
+]), true);
+assertEq(composeDate(format.formatToParts(date)), format.format(date));
+
+if (typeof reportCompare === "function")
+ reportCompare(0, 0, 'ok');
diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h
index 23aead116693..b6cf006254f7 100644
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -59,6 +59,9 @@
macro(currencyDisplay, currencyDisplay, "currencyDisplay") \
macro(DateTimeFormat, DateTimeFormat, "DateTimeFormat") \
macro(DateTimeFormatFormatGet, DateTimeFormatFormatGet, "Intl_DateTimeFormat_format_get") \
+ macro(DateTimeFormatFormatToPartsGet, DateTimeFormatFormatToPartsGet, "Intl_DateTimeFormat_formatToParts_get") \
+ macro(day, day, "day") \
+ macro(dayperiod, dayperiod, "dayperiod") \
macro(decodeURI, decodeURI, "decodeURI") \
macro(decodeURIComponent, decodeURIComponent, "decodeURIComponent") \
macro(default_, default_, "default") \
@@ -80,6 +83,7 @@
macro(endTimestamp, endTimestamp, "endTimestamp") \
macro(enumerable, enumerable, "enumerable") \
macro(enumerate, enumerate, "enumerate") \
+ macro(era, era, "era") \
macro(escape, escape, "escape") \
macro(eval, eval, "eval") \
macro(false, false_, "false") \
@@ -95,6 +99,7 @@
macro(forceInterpreter, forceInterpreter, "forceInterpreter") \
macro(forEach, forEach, "forEach") \
macro(format, format, "format") \
+ macro(formatToParts, formatToParts, "formatToParts") \
macro(frame, frame, "frame") \
macro(from, from, "from") \
macro(gcCycleNumber, gcCycleNumber, "gcCycleNumber") \
@@ -109,6 +114,7 @@
macro(has, has, "has") \
macro(hasOwn, hasOwn, "hasOwn") \
macro(hasOwnProperty, hasOwnProperty, "hasOwnProperty") \
+ macro(hour, hour, "hour") \
macro(ignoreCase, ignoreCase, "ignoreCase") \
macro(ignorePunctuation, ignorePunctuation, "ignorePunctuation") \
macro(index, index, "index") \
@@ -152,8 +158,10 @@
macro(minimumFractionDigits, minimumFractionDigits, "minimumFractionDigits") \
macro(minimumIntegerDigits, minimumIntegerDigits, "minimumIntegerDigits") \
macro(minimumSignificantDigits, minimumSignificantDigits, "minimumSignificantDigits") \
+ macro(minute, minute, "minute") \
macro(missingArguments, missingArguments, "missingArguments") \
macro(module, module, "module") \
+ macro(month, month, "month") \
macro(multiline, multiline, "multiline") \
macro(name, name, "name") \
macro(NaN, NaN, "NaN") \
@@ -200,7 +208,9 @@
macro(revoke, revoke, "revoke") \
macro(script, script, "script") \
macro(scripts, scripts, "scripts") \
+ macro(second, second, "second") \
macro(sensitivity, sensitivity, "sensitivity") \
+ macro(separator, separator, "separator") \
macro(set, set, "set") \
macro(shape, shape, "shape") \
macro(size, size, "size") \
@@ -221,6 +231,7 @@
macro(throw, throw_, "throw") \
macro(timestamp, timestamp, "timestamp") \
macro(timeZone, timeZone, "timeZone") \
+ macro(timeZoneName, timeZoneName, "timeZoneName") \
macro(toGMTString, toGMTString, "toGMTString") \
macro(toISOString, toISOString, "toISOString") \
macro(toJSON, toJSON, "toJSON") \
@@ -229,6 +240,7 @@
macro(toString, toString, "toString") \
macro(toUTCString, toUTCString, "toUTCString") \
macro(true, true_, "true") \
+ macro(type, type, "type") \
macro(unescape, unescape, "unescape") \
macro(uneval, uneval, "uneval") \
macro(unicode, unicode, "unicode") \
@@ -255,7 +267,9 @@
macro(void0, void0, "(void 0)") \
macro(watch, watch, "watch") \
macro(WeakSet_add, WeakSet_add, "WeakSet_add") \
+ macro(weekday, weekday, "weekday") \
macro(writable, writable, "writable") \
+ macro(year, year, "year") \
macro(yield, yield, "yield") \
macro(raw, raw, "raw") \
/* Type names must be contiguous and ordered; see js::TypeName. */ \
diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp
index a4f52875a768..10d04db34ff9 100644
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1062,6 +1062,9 @@ IsStickyFrameActive(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsIFrame*
// Find the nearest scrollframe.
nsIFrame* cursor = aFrame;
nsIFrame* parent = aParent;
+ if (!parent) {
+ parent = nsLayoutUtils::GetCrossDocParentFrame(aFrame);
+ }
while (parent->GetType() != nsGkAtoms::scrollFrame) {
cursor = parent;
if ((parent = nsLayoutUtils::GetCrossDocParentFrame(cursor)) == nullptr) {
@@ -4952,6 +4955,12 @@ nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder)
// determine if we are inside a fixed pos subtree. If we use the outer AGR
// from outside the fixed pos subtree FLB can't tell that we are fixed pos.
mAnimatedGeometryRoot = mAnimatedGeometryRootForChildren;
+ } else if (mFrame->StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY &&
+ IsStickyFrameActive(aBuilder, mFrame, nullptr)) {
+ // Similar to the IsFixedPosFrameInDisplayPort case we are our own AGR.
+ // We are inside the sticky position, so our AGR is the sticky positioned
+ // frame, which is our AGR, not the parent AGR.
+ mAnimatedGeometryRoot = mAnimatedGeometryRootForChildren;
} else if (mAnimatedGeometryRoot->mParentAGR) {
mAnimatedGeometryRoot = mAnimatedGeometryRoot->mParentAGR;
}
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index d59f3d6ce7a8..53af68d3a272 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -6204,7 +6204,6 @@ nsTextFrame::DrawEmphasisMarks(gfxContext* aContext, WritingMode aWM,
auto info = static_cast(
Properties().Get(EmphasisMarkProperty()));
if (!info) {
- MOZ_ASSERT(!StyleText()->HasTextEmphasis());
return;
}
@@ -7873,7 +7872,9 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
if (i > wordStart) {
nscoord width =
- NSToCoordCeilClamped(textRun->GetAdvanceWidth(wordStart, i - wordStart, &provider));
+ NSToCoordCeilClamped(textRun->GetAdvanceWidth(wordStart, i - wordStart,
+ &provider));
+ width = std::max(0, width);
aData->currentLine = NSCoordSaturatingAdd(aData->currentLine, width);
aData->atStartOfLine = false;
@@ -7885,8 +7886,11 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
aData->trailingWhitespace += width;
} else {
// Some non-whitespace so the old trailingWhitespace is no longer trailing
- aData->trailingWhitespace =
- NSToCoordCeilClamped(textRun->GetAdvanceWidth(trimStart, i - trimStart, &provider));
+ nscoord wsWidth =
+ NSToCoordCeilClamped(textRun->GetAdvanceWidth(trimStart,
+ i - trimStart,
+ &provider));
+ aData->trailingWhitespace = std::max(0, wsWidth);
}
} else {
aData->trailingWhitespace = 0;
@@ -8025,7 +8029,9 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
if (i > lineStart) {
nscoord width =
- NSToCoordCeilClamped(textRun->GetAdvanceWidth(lineStart, i - lineStart, &provider));
+ NSToCoordCeilClamped(textRun->GetAdvanceWidth(lineStart, i - lineStart,
+ &provider));
+ width = std::max(0, width);
aData->currentLine = NSCoordSaturatingAdd(aData->currentLine, width);
if (collapseWhitespace) {
@@ -8036,8 +8042,11 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
aData->trailingWhitespace += width;
} else {
// Some non-whitespace so the old trailingWhitespace is no longer trailing
- aData->trailingWhitespace =
- NSToCoordCeilClamped(textRun->GetAdvanceWidth(trimStart, i - trimStart, &provider));
+ nscoord wsWidth =
+ NSToCoordCeilClamped(textRun->GetAdvanceWidth(trimStart,
+ i - trimStart,
+ &provider));
+ aData->trailingWhitespace = std::max(0, wsWidth);
}
} else {
aData->trailingWhitespace = 0;
diff --git a/layout/reftests/reftest.list b/layout/reftests/reftest.list
index e9204af90771..0a889acc7e29 100644
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -370,6 +370,9 @@ skip-if(Android) include ../xul/reftest/reftest.list
# xul grid (no XUL theme on Android)
skip-if(Android) include ../xul/grid/reftests/reftest.list
+# -webkit-box & associated properties (mapped to modern flexbox)
+include webkit-box/reftest.list
+
# -webkit-gradient expressions
include webkit-gradient/reftest.list
diff --git a/layout/reftests/text/negative-letter-spacing-1-ref.html b/layout/reftests/text/negative-letter-spacing-1-ref.html
new file mode 100644
index 000000000000..3411c34a1f8f
--- /dev/null
+++ b/layout/reftests/text/negative-letter-spacing-1-ref.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+