зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound
This commit is contained in:
Коммит
8c8e1c0526
|
@ -128,6 +128,7 @@ devtools/client/webaudioeditor/lib/dagre-d3.js
|
|||
# Ignore codemirror
|
||||
devtools/client/sourceeditor/codemirror/*.js
|
||||
devtools/client/sourceeditor/codemirror/**/*.js
|
||||
devtools/client/sourceeditor/test/codemirror/*
|
||||
|
||||
# Ignore jquery test libs
|
||||
devtools/client/markupview/test/lib_*
|
||||
|
@ -140,9 +141,12 @@ devtools/client/webide/webide-prefs.js
|
|||
# Ignore various libs
|
||||
devtools/shared/jsbeautify/*
|
||||
devtools/shared/acorn/*
|
||||
devtools/shared/tern/*
|
||||
devtools/client/sourceeditor/tern/*
|
||||
devtools/shared/pretty-fast/*
|
||||
devtools/shared/sourcemap/*
|
||||
devtools/shared/qrcode/decoder/*
|
||||
devtools/shared/qrcode/encoder/*
|
||||
devtools/client/shared/vendor/*
|
||||
|
||||
# mobile/android/ exclusions
|
||||
mobile/android/chrome/content
|
||||
|
|
|
@ -59,6 +59,9 @@ _OPT\.OBJ/
|
|||
# Gradle cache.
|
||||
^.gradle/
|
||||
|
||||
# Local Gradle configuration properties.
|
||||
^local.properties$
|
||||
|
||||
# Python stuff installed at build time.
|
||||
^python/psutil/.*\.so
|
||||
^python/psutil/.*\.pyd
|
||||
|
|
|
@ -765,26 +765,6 @@ exports.testPerTabEvents = function*(assert) {
|
|||
assert.equal(eventCount, 2, "both listeners were notified.");
|
||||
};
|
||||
|
||||
exports.testAttachOnOpen = function (assert, done) {
|
||||
// Take care that attach has to be called on tab ready and not on tab open.
|
||||
open().then(focus).then(window => {
|
||||
tabs.open({
|
||||
url: "data:text/html;charset=utf-8,foobar",
|
||||
onOpen: function (tab) {
|
||||
let worker = tab.attach({
|
||||
contentScript: 'self.postMessage(document.location.href); ',
|
||||
onMessage: function (msg) {
|
||||
assert.equal(msg, "about:blank",
|
||||
"Worker document url is about:blank on open");
|
||||
worker.destroy();
|
||||
close(window).then(done).then(null, assert.fail);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}).then(null, assert.fail);
|
||||
}
|
||||
|
||||
exports.testAttachOnMultipleDocuments = function (assert, done) {
|
||||
// Example of attach that process multiple tab documents
|
||||
open().then(focus).then(window => {
|
||||
|
|
|
@ -174,24 +174,6 @@ exports.testTabClose_alt = function(assert, done) {
|
|||
});
|
||||
};
|
||||
|
||||
exports.testAttachOnOpen_alt = function (assert, done) {
|
||||
// Take care that attach has to be called on tab ready and not on tab open.
|
||||
tabs.open({
|
||||
url: "data:text/html;charset=utf-8,foobar",
|
||||
onOpen: function (tab) {
|
||||
let worker = tab.attach({
|
||||
contentScript: 'self.postMessage(document.location.href); ',
|
||||
onMessage: function (msg) {
|
||||
assert.equal(msg, "about:blank",
|
||||
"Worker document url is about:blank on open");
|
||||
worker.destroy();
|
||||
tab.close(done);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.testAttachOnMultipleDocuments_alt = function (assert, done) {
|
||||
// Example of attach that process multiple tab documents
|
||||
let firstLocation = "data:text/html;charset=utf-8,foobar";
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
||||
<!-- Gecko and Gaia -->
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<!-- Gonk-specific things and forks -->
|
||||
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
|
||||
<project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d70fdfc0244a7217df1cfa7df9f4798cbfa3af6"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
||||
<!-- Gecko and Gaia -->
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<!-- Gonk-specific things and forks -->
|
||||
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
|
||||
<project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"git": {
|
||||
"git_revision": "7e962276913bd4da7ce5fa7540767107ce322c78",
|
||||
"git_revision": "d886e152b42e557db612470d3417fe2947cbdeee",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "a01ece4ccbfbc42c58b2d40ac81ad39ada286d34",
|
||||
"revision": "dfac5317cf962dba4128208821470cd50b01509b",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d70fdfc0244a7217df1cfa7df9f4798cbfa3af6"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7e962276913bd4da7ce5fa7540767107ce322c78"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="d886e152b42e557db612470d3417fe2947cbdeee"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
{
|
||||
"extends": [
|
||||
"../toolkit/.eslintrc"
|
||||
]
|
||||
],
|
||||
|
||||
"rules": {
|
||||
// No redeclaring variables
|
||||
"no-redeclare": 2,
|
||||
|
||||
// Functions must always return something or nothing
|
||||
"consistent-return": 2,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -318,8 +318,10 @@ var PlacesCommandHook = {
|
|||
* whether or not to show the edit-bookmark UI for the bookmark item
|
||||
*/
|
||||
bookmarkPage: Task.async(function* (aBrowser, aParent, aShowEditUI) {
|
||||
if (PlacesUIUtils.useAsyncTransactions)
|
||||
return (yield this._bookmarkPagePT(aBrowser, aParent, aShowEditUI));
|
||||
if (PlacesUIUtils.useAsyncTransactions) {
|
||||
yield this._bookmarkPagePT(aBrowser, aParent, aShowEditUI);
|
||||
return;
|
||||
}
|
||||
|
||||
var uri = aBrowser.currentURI;
|
||||
var itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
|
||||
|
|
|
@ -182,7 +182,7 @@ var gSyncUI = {
|
|||
if (++this._numActiveSyncTasks == 1) {
|
||||
let broadcaster = document.getElementById("sync-status");
|
||||
broadcaster.setAttribute("syncstatus", "active");
|
||||
broadcaster.setAttribute("label", this._stringBundle.GetStringFromName("syncing.label"));
|
||||
broadcaster.setAttribute("label", this._stringBundle.GetStringFromName("syncing2.label"));
|
||||
broadcaster.setAttribute("disabled", "true");
|
||||
}
|
||||
this.updateUI();
|
||||
|
|
|
@ -502,8 +502,8 @@ var gPopupBlockerObserver = {
|
|||
this._reportButton.hidden = true;
|
||||
|
||||
// Hide the notification box (if it's visible).
|
||||
var notificationBox = gBrowser.getNotificationBox();
|
||||
var notification = notificationBox.getNotificationWithValue("popup-blocked");
|
||||
let notificationBox = gBrowser.getNotificationBox();
|
||||
let notification = notificationBox.getNotificationWithValue("popup-blocked");
|
||||
if (notification) {
|
||||
notificationBox.removeNotification(notification, false);
|
||||
}
|
||||
|
@ -534,8 +534,8 @@ var gPopupBlockerObserver = {
|
|||
.replace("#1", brandShortName)
|
||||
.replace("#2", popupCount);
|
||||
|
||||
var notificationBox = gBrowser.getNotificationBox();
|
||||
var notification = notificationBox.getNotificationWithValue("popup-blocked");
|
||||
let notificationBox = gBrowser.getNotificationBox();
|
||||
let notification = notificationBox.getNotificationWithValue("popup-blocked");
|
||||
if (notification) {
|
||||
notification.label = message;
|
||||
}
|
||||
|
|
|
@ -839,7 +839,7 @@ function makePreview(row)
|
|||
// find out the file size
|
||||
var sizeText;
|
||||
if (cacheEntry) {
|
||||
var imageSize = cacheEntry.dataSize;
|
||||
let imageSize = cacheEntry.dataSize;
|
||||
var kbSize = Math.round(imageSize / 1024 * 100) / 100;
|
||||
sizeText = gBundle.getFormattedString("generalSize",
|
||||
[formatNumber(kbSize), formatNumber(imageSize)]);
|
||||
|
@ -953,7 +953,7 @@ function makePreview(row)
|
|||
document.getElementById("theimagecontainer").collapsed = true;
|
||||
}
|
||||
|
||||
var imageSize = "";
|
||||
let imageSize = "";
|
||||
if (url && !isAudio) {
|
||||
if (width != physWidth || height != physHeight) {
|
||||
imageSize = gBundle.getFormattedString("mediaDimensionsScaled",
|
||||
|
|
|
@ -512,7 +512,6 @@ var gSyncSetup = {
|
|||
onWizardBack: function () {
|
||||
switch (this.wizard.pageIndex) {
|
||||
case NEW_ACCOUNT_START_PAGE:
|
||||
case EXISTING_ACCOUNT_LOGIN_PAGE:
|
||||
this.wizard.pageIndex = INTRO_PAGE;
|
||||
return false;
|
||||
case EXISTING_ACCOUNT_CONNECT_PAGE:
|
||||
|
|
|
@ -19,7 +19,7 @@ add_task(function*() {
|
|||
yield new Promise(resolve => whenDelayedStartupFinished(win, resolve));
|
||||
|
||||
is(win.gBrowser.selectedBrowser.permanentKey, key, "Should have properly copied the permanentKey");
|
||||
yield promiseWindowClosed(win);
|
||||
yield BrowserTestUtils.closeWindow(win);
|
||||
|
||||
is(SessionStore.getClosedWindowCount(), 1, "Should have restore data for the closed window");
|
||||
|
||||
|
|
|
@ -46,41 +46,19 @@ function promiseTopicObserved(topic)
|
|||
* The tab to load into.
|
||||
* @param [optional] url
|
||||
* The url to load, or the current url.
|
||||
* @param [optional] event
|
||||
* The load event type to wait for. Defaults to "load".
|
||||
* @return {Promise} resolved when the event is handled.
|
||||
* @resolves to the received event
|
||||
* @rejects if a valid load event is not received within a meaningful interval
|
||||
*/
|
||||
function promiseTabLoadEvent(tab, url, eventType="load")
|
||||
function promiseTabLoadEvent(tab, url)
|
||||
{
|
||||
let deferred = Promise.defer();
|
||||
info("Wait tab event: " + eventType);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
function handle(event) {
|
||||
if (event.originalTarget != tab.linkedBrowser.contentDocument ||
|
||||
event.target.location.href == "about:blank" ||
|
||||
(url && event.target.location.href != url)) {
|
||||
info("Skipping spurious '" + eventType + "'' event" +
|
||||
" for " + event.target.location.href);
|
||||
return;
|
||||
}
|
||||
clearTimeout(timeout);
|
||||
tab.linkedBrowser.removeEventListener(eventType, handle, true);
|
||||
info("Tab event received: " + eventType);
|
||||
deferred.resolve(event);
|
||||
if (url) {
|
||||
browser.loadURI(url);
|
||||
}
|
||||
|
||||
let timeout = setTimeout(() => {
|
||||
if (tab.linkedBrowser)
|
||||
tab.linkedBrowser.removeEventListener(eventType, handle, true);
|
||||
deferred.reject(new Error("Timed out while waiting for a '" + eventType + "'' event"));
|
||||
}, 30000);
|
||||
|
||||
tab.linkedBrowser.addEventListener(eventType, handle, true, true);
|
||||
if (url)
|
||||
tab.linkedBrowser.loadURI(url);
|
||||
return deferred.promise;
|
||||
return BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
}
|
||||
|
||||
const PREF_SECURITY_DELAY_INITIAL = Services.prefs.getIntPref("security.notification_enable_delay");
|
||||
|
|
|
@ -502,11 +502,11 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => {
|
|||
},
|
||||
|
||||
executeScript: function(tabId, details, callback) {
|
||||
self.tabs._execute(tabId, details, 'js', callback);
|
||||
self.tabs._execute(tabId, details, "js", callback);
|
||||
},
|
||||
|
||||
insertCss: function(tabId, details, callback) {
|
||||
self.tabs._execute(tabId, details, 'css', callback);
|
||||
self.tabs._execute(tabId, details, "css", callback);
|
||||
},
|
||||
|
||||
connect: function(tabId, connectInfo) {
|
||||
|
|
|
@ -49,10 +49,6 @@ const WINDOW_HIDEABLE_FEATURES = [
|
|||
|
||||
// Messages that will be received via the Frame Message Manager.
|
||||
const MESSAGES = [
|
||||
// The content script gives us a reference to an object that performs
|
||||
// synchronous collection of session data.
|
||||
"SessionStore:setupSyncHandler",
|
||||
|
||||
// The content script sends us data that has been invalidated and needs to
|
||||
// be saved to disk.
|
||||
"SessionStore:update",
|
||||
|
@ -83,9 +79,6 @@ const MESSAGES = [
|
|||
// ones that preload about:newtab pages, or from browsers where the window
|
||||
// has just been closed.
|
||||
const NOTAB_MESSAGES = new Set([
|
||||
// For a description see above.
|
||||
"SessionStore:setupSyncHandler",
|
||||
|
||||
// For a description see above.
|
||||
"SessionStore:crashedTabRevived",
|
||||
|
||||
|
@ -99,9 +92,6 @@ const NOTAB_MESSAGES = new Set([
|
|||
// The list of messages we accept without an "epoch" parameter.
|
||||
// See getCurrentEpoch() and friends to find out what an "epoch" is.
|
||||
const NOEPOCH_MESSAGES = new Set([
|
||||
// For a description see above.
|
||||
"SessionStore:setupSyncHandler",
|
||||
|
||||
// For a description see above.
|
||||
"SessionStore:crashedTabRevived",
|
||||
|
||||
|
@ -701,9 +691,6 @@ var SessionStoreInternal = {
|
|||
}
|
||||
|
||||
switch (aMessage.name) {
|
||||
case "SessionStore:setupSyncHandler":
|
||||
TabState.setSyncHandler(browser, aMessage.objects.handler);
|
||||
break;
|
||||
case "SessionStore:update":
|
||||
// |browser.frameLoader| might be empty if the browser was already
|
||||
// destroyed and its tab removed. In that case we still have the last
|
||||
|
|
|
@ -27,22 +27,10 @@ XPCOMUtils.defineLazyModuleGetter(this, "Utils",
|
|||
* Module that contains tab state collection methods.
|
||||
*/
|
||||
this.TabState = Object.freeze({
|
||||
setSyncHandler: function (browser, handler) {
|
||||
TabStateInternal.setSyncHandler(browser, handler);
|
||||
},
|
||||
|
||||
update: function (browser, data) {
|
||||
TabStateInternal.update(browser, data);
|
||||
},
|
||||
|
||||
flushAsync: function (browser) {
|
||||
TabStateInternal.flushAsync(browser);
|
||||
},
|
||||
|
||||
flushWindow: function (window) {
|
||||
TabStateInternal.flushWindow(window);
|
||||
},
|
||||
|
||||
collect: function (tab) {
|
||||
return TabStateInternal.collect(tab);
|
||||
},
|
||||
|
@ -53,62 +41,15 @@ this.TabState = Object.freeze({
|
|||
|
||||
copyFromCache(browser, tabData, options) {
|
||||
TabStateInternal.copyFromCache(browser, tabData, options);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
var TabStateInternal = {
|
||||
// A map (xul:browser -> handler) that maps a tab to the
|
||||
// synchronous collection handler object for that tab.
|
||||
// See SyncHandler in content-sessionStore.js.
|
||||
_syncHandlers: new WeakMap(),
|
||||
|
||||
// A map (xul:browser -> int) that maps a browser to the
|
||||
// last "SessionStore:update" message ID we received for it.
|
||||
_latestMessageID: new WeakMap(),
|
||||
|
||||
/**
|
||||
* Install the sync handler object from a given tab.
|
||||
*/
|
||||
setSyncHandler: function (browser, handler) {
|
||||
this._syncHandlers.set(browser.permanentKey, handler);
|
||||
this._latestMessageID.set(browser.permanentKey, 0);
|
||||
},
|
||||
|
||||
/**
|
||||
* Processes a data update sent by the content script.
|
||||
*/
|
||||
update: function (browser, {id, data}) {
|
||||
// Only ever process messages that have an ID higher than the last one we
|
||||
// saw. This ensures we don't use stale data that has already been received
|
||||
// synchronously.
|
||||
if (id > this._latestMessageID.get(browser.permanentKey)) {
|
||||
this._latestMessageID.set(browser.permanentKey, id);
|
||||
TabStateCache.update(browser, data);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* DO NOT USE - DEBUGGING / TESTING ONLY
|
||||
*
|
||||
* This function is used to simulate certain situations where race conditions
|
||||
* can occur by sending data shortly before flushing synchronously.
|
||||
*/
|
||||
flushAsync: function(browser) {
|
||||
if (this._syncHandlers.has(browser.permanentKey)) {
|
||||
this._syncHandlers.get(browser.permanentKey).flushAsync();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Flushes queued content script data for all browsers of a given window.
|
||||
*/
|
||||
flushWindow: function (window) {
|
||||
for (let browser of window.gBrowser.browsers) {
|
||||
if (this._syncHandlers.has(browser.permanentKey)) {
|
||||
let lastID = this._latestMessageID.get(browser.permanentKey);
|
||||
this._syncHandlers.get(browser.permanentKey).flush(lastID);
|
||||
}
|
||||
}
|
||||
update: function (browser, {data}) {
|
||||
TabStateCache.update(browser, data);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -191,52 +191,6 @@ var MessageListener = {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* On initialization, this handler gets sent to the parent process as a CPOW.
|
||||
* The parent will use it only to flush pending data from the frame script
|
||||
* when needed, i.e. when closing a tab, closing a window, shutting down, etc.
|
||||
*
|
||||
* This will hopefully not be needed in the future once we have async APIs for
|
||||
* closing windows and tabs.
|
||||
*/
|
||||
var SyncHandler = {
|
||||
init: function () {
|
||||
// Send this object as a CPOW to chrome. In single-process mode,
|
||||
// the synchronous send ensures that the handler object is
|
||||
// available in SessionStore.jsm immediately upon loading
|
||||
// content-sessionStore.js.
|
||||
sendSyncMessage("SessionStore:setupSyncHandler", {}, {handler: this});
|
||||
},
|
||||
|
||||
/**
|
||||
* This function is used to make the tab process flush all data that
|
||||
* hasn't been sent to the parent process, yet.
|
||||
*
|
||||
* @param id (int)
|
||||
* A unique id that represents the last message received by the chrome
|
||||
* process before flushing. We will use this to determine data that
|
||||
* would be lost when data has been sent asynchronously shortly
|
||||
* before flushing synchronously.
|
||||
*/
|
||||
flush: function (id) {
|
||||
MessageQueue.flush(id);
|
||||
},
|
||||
|
||||
/**
|
||||
* DO NOT USE - DEBUGGING / TESTING ONLY
|
||||
*
|
||||
* This function is used to simulate certain situations where race conditions
|
||||
* can occur by sending data shortly before flushing synchronously.
|
||||
*/
|
||||
flushAsync: function () {
|
||||
if (!Services.prefs.getBoolPref("browser.sessionstore.debug")) {
|
||||
throw new Error("flushAsync() must be used for testing, only.");
|
||||
}
|
||||
|
||||
MessageQueue.send();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Listens for changes to the session history. Whenever the user navigates
|
||||
* we will collect URLs and everything belonging to session history.
|
||||
|
@ -635,13 +589,6 @@ var PrivacyListener = {
|
|||
* flood.
|
||||
*/
|
||||
var MessageQueue = {
|
||||
/**
|
||||
* A unique, monotonically increasing ID used for outgoing messages. This is
|
||||
* important to make it possible to reuse tabs and allow sync flushes before
|
||||
* data could be destroyed.
|
||||
*/
|
||||
_id: 1,
|
||||
|
||||
/**
|
||||
* A map (string -> lazy fn) holding lazy closures of all queued data
|
||||
* collection routines. These functions will return data collected from the
|
||||
|
@ -649,13 +596,6 @@ var MessageQueue = {
|
|||
*/
|
||||
_data: new Map(),
|
||||
|
||||
/**
|
||||
* A map holding the |this._id| value for every type of data back when it
|
||||
* was pushed onto the queue. We will use those IDs to find the data to send
|
||||
* and flush.
|
||||
*/
|
||||
_lastUpdated: new Map(),
|
||||
|
||||
/**
|
||||
* The delay (in ms) used to delay sending changes after data has been
|
||||
* invalidated.
|
||||
|
@ -729,7 +669,6 @@ var MessageQueue = {
|
|||
*/
|
||||
push: function (key, fn) {
|
||||
this._data.set(key, createLazy(fn));
|
||||
this._lastUpdated.set(key, this._id);
|
||||
|
||||
if (!this._timeout && !this._timeoutDisabled) {
|
||||
// Wait a little before sending the message to batch multiple changes.
|
||||
|
@ -741,8 +680,6 @@ var MessageQueue = {
|
|||
* Sends queued data to the chrome process.
|
||||
*
|
||||
* @param options (object)
|
||||
* {id: 123} to override the update ID used to accumulate data to send.
|
||||
* {sync: true} to send data to the parent process synchronously.
|
||||
* {flushID: 123} to specify that this is a flush
|
||||
* {isFinal: true} to signal this is the final message sent on unload
|
||||
*/
|
||||
|
@ -759,36 +696,14 @@ var MessageQueue = {
|
|||
this._timeout = null;
|
||||
}
|
||||
|
||||
let sync = options && options.sync;
|
||||
let startID = (options && options.id) || this._id;
|
||||
let flushID = (options && options.flushID) || 0;
|
||||
|
||||
// We use sendRpcMessage in the sync case because we may have been called
|
||||
// through a CPOW. RPC messages are the only synchronous messages that the
|
||||
// child is allowed to send to the parent while it is handling a CPOW
|
||||
// request.
|
||||
let sendMessage = sync ? sendRpcMessage : sendAsyncMessage;
|
||||
|
||||
let durationMs = Date.now();
|
||||
|
||||
let data = {};
|
||||
let telemetry = {};
|
||||
for (let [key, id] of this._lastUpdated) {
|
||||
// There is no data for the given key anymore because
|
||||
// the parent process already marked it as received.
|
||||
if (!this._data.has(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (startID > id) {
|
||||
// If the |id| passed by the parent process is higher than the one
|
||||
// stored in |_lastUpdated| for the given key we know that the parent
|
||||
// received all necessary data and we can remove it from the map.
|
||||
this._data.delete(key);
|
||||
continue;
|
||||
}
|
||||
|
||||
let value = this._data.get(key)();
|
||||
for (let [key, func] of this._data) {
|
||||
let value = func();
|
||||
if (key == "telemetry") {
|
||||
for (let histogramId of Object.keys(value)) {
|
||||
telemetry[histogramId] = value[histogramId];
|
||||
|
@ -803,8 +718,8 @@ var MessageQueue = {
|
|||
|
||||
try {
|
||||
// Send all data to the parent process.
|
||||
sendMessage("SessionStore:update", {
|
||||
id: this._id, data, telemetry, flushID,
|
||||
sendAsyncMessage("SessionStore:update", {
|
||||
data, telemetry, flushID,
|
||||
isFinal: options.isFinal || false,
|
||||
epoch: gCurrentEpoch
|
||||
});
|
||||
|
@ -812,39 +727,16 @@ var MessageQueue = {
|
|||
let telemetry = {
|
||||
FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM: 1
|
||||
};
|
||||
sendMessage("SessionStore:error", {
|
||||
sendAsyncMessage("SessionStore:error", {
|
||||
telemetry
|
||||
});
|
||||
}
|
||||
|
||||
// Increase our unique message ID.
|
||||
this._id++;
|
||||
},
|
||||
|
||||
/**
|
||||
* This function is used to make the message queue flush all queue data that
|
||||
* hasn't been sent to the parent process, yet.
|
||||
*
|
||||
* @param id (int)
|
||||
* A unique id that represents the latest message received by the
|
||||
* chrome process. We can use this to determine which messages have not
|
||||
* yet been received because they are still stuck in the event queue.
|
||||
*/
|
||||
flush: function (id) {
|
||||
// It's important to always send data, even if there is nothing to flush.
|
||||
// The update message will be received by the parent process that can then
|
||||
// update its last received update ID to ignore stale messages.
|
||||
this.send({id: id + 1, sync: true});
|
||||
|
||||
this._data.clear();
|
||||
this._lastUpdated.clear();
|
||||
}
|
||||
};
|
||||
|
||||
EventListener.init();
|
||||
MessageListener.init();
|
||||
FormDataListener.init();
|
||||
SyncHandler.init();
|
||||
PageStyleListener.init();
|
||||
SessionHistoryListener.init();
|
||||
SessionStorageListener.init();
|
||||
|
|
|
@ -74,7 +74,7 @@ add_task(function flush_on_settabstate() {
|
|||
|
||||
// Flush all data contained in the content script but send it using
|
||||
// asynchronous messages.
|
||||
TabState.flushAsync(browser);
|
||||
TabStateFlusher.flush(browser);
|
||||
|
||||
yield promiseTabState(tab, state);
|
||||
|
||||
|
@ -101,7 +101,7 @@ add_task(function flush_on_tabclose_racy() {
|
|||
|
||||
// Flush all data contained in the content script but send it using
|
||||
// asynchronous messages.
|
||||
TabState.flushAsync(browser);
|
||||
TabStateFlusher.flush(browser);
|
||||
yield promiseRemoveTab(tab);
|
||||
|
||||
let [{state: {storage}}] = JSON.parse(ss.getClosedTabData(window));
|
||||
|
|
|
@ -634,7 +634,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton {
|
|||
#PanelUI-update-status > .toolbarbutton-icon,
|
||||
#PanelUI-fxa-label > .toolbarbutton-icon,
|
||||
#PanelUI-fxa-icon > .toolbarbutton-icon,
|
||||
#PanelUI-remotetabs-syncnow > .toolbarbutton-icon,
|
||||
#PanelUI-customize > .toolbarbutton-icon,
|
||||
#PanelUI-help > .toolbarbutton-icon,
|
||||
#PanelUI-quit > .toolbarbutton-icon {
|
||||
|
@ -668,7 +667,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton {
|
|||
list-style-image: url(chrome://branding/content/icon16.png);
|
||||
}
|
||||
|
||||
#PanelUI-remotetabs-syncnow,
|
||||
#PanelUI-fxa-label,
|
||||
#PanelUI-fxa-icon {
|
||||
list-style-image: url(chrome://browser/skin/sync-horizontalbar.png);
|
||||
|
@ -752,7 +750,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton {
|
|||
visibility: collapse;
|
||||
}
|
||||
|
||||
#PanelUI-remotetabs-syncnow[syncstatus="active"],
|
||||
#PanelUI-fxa-icon[syncstatus="active"] {
|
||||
list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar.png);
|
||||
}
|
||||
|
@ -782,7 +779,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton {
|
|||
|
||||
#PanelUI-fxa-label,
|
||||
#PanelUI-fxa-icon,
|
||||
#PanelUI-remotetabs-syncnow,
|
||||
#PanelUI-customize,
|
||||
#PanelUI-help,
|
||||
#PanelUI-quit {
|
||||
|
@ -1622,12 +1618,10 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left {
|
|||
}
|
||||
|
||||
#PanelUI-fxa-label,
|
||||
#PanelUI-remotetabs-syncnow,
|
||||
#PanelUI-fxa-icon {
|
||||
list-style-image: url(chrome://browser/skin/sync-horizontalbar@2x.png);
|
||||
}
|
||||
|
||||
#PanelUI-remotetabs-syncnow[syncstatus="active"],
|
||||
#PanelUI-fxa-icon[syncstatus="active"] {
|
||||
list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar@2x.png);
|
||||
}
|
||||
|
@ -1650,7 +1644,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left {
|
|||
|
||||
#PanelUI-fxa-label,
|
||||
#PanelUI-fxa-icon,
|
||||
#PanelUI-remotetabs-syncnow,
|
||||
#PanelUI-customize,
|
||||
#PanelUI-help,
|
||||
#PanelUI-quit {
|
||||
|
@ -1660,7 +1653,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left {
|
|||
#PanelUI-update-status > .toolbarbutton-icon,
|
||||
#PanelUI-fxa-label > .toolbarbutton-icon,
|
||||
#PanelUI-fxa-icon > .toolbarbutton-icon,
|
||||
#PanelUI-remotetabs-syncnow > .toolbarbutton-icon,
|
||||
#PanelUI-customize > .toolbarbutton-icon,
|
||||
#PanelUI-help > .toolbarbutton-icon,
|
||||
#PanelUI-quit > .toolbarbutton-icon {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
// Rules from the mozilla plugin
|
||||
"mozilla/balanced-listeners": 2,
|
||||
"mozilla/components-imports": 1,
|
||||
"mozilla/import-globals-from": 1,
|
||||
"mozilla/import-headjs-globals": 1,
|
||||
"mozilla/mark-test-function-used": 1,
|
||||
"mozilla/no-aArgs": 1,
|
||||
|
@ -36,16 +37,16 @@
|
|||
"block-scoped-var": 2,
|
||||
// Enforce one true brace style (opening brace on the same line) and avoid
|
||||
// start and end braces on the same line.
|
||||
"brace-style": [2, "1tbs", {"allowSingleLine": false}],
|
||||
"brace-style": [1, "1tbs", {"allowSingleLine": false}],
|
||||
// Require camel case names
|
||||
"camelcase": 2,
|
||||
"camelcase": 1,
|
||||
// Allow trailing commas for easy list extension. Having them does not
|
||||
// impair readability, but also not required either.
|
||||
"comma-dangle": 0,
|
||||
// Enforce spacing before and after comma
|
||||
"comma-spacing": [2, {"before": false, "after": true}],
|
||||
"comma-spacing": [1, {"before": false, "after": true}],
|
||||
// Enforce one true comma style.
|
||||
"comma-style": [2, "last"],
|
||||
"comma-style": [1, "last"],
|
||||
// Warn about cyclomatic complexity in functions.
|
||||
"complexity": 1,
|
||||
// Require return statements to either always or never specify values.
|
||||
|
@ -84,7 +85,7 @@
|
|||
// Only useful in a node environment.
|
||||
"handle-callback-err": 0,
|
||||
// Tab width.
|
||||
"indent": [2, 2, {"SwitchCase": 1}],
|
||||
"indent": [1, 2, {"SwitchCase": 1}],
|
||||
// Enforces spacing between keys and values in object literal properties.
|
||||
"key-spacing": [1, {"beforeColon": false, "afterColon": true}],
|
||||
// Allow mixed 'LF' and 'CRLF' as linebreaks.
|
||||
|
@ -168,7 +169,7 @@
|
|||
// Allow unnecessary parentheses, as they may make the code more readable.
|
||||
"no-extra-parens": 0,
|
||||
// Disallow unnecessary semicolons.
|
||||
"no-extra-semi": 2,
|
||||
"no-extra-semi": 1,
|
||||
// Deprecated, will be removed in 1.0.
|
||||
"no-extra-strict": 0,
|
||||
// Disallow fallthrough of case statements, except if there is a comment.
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../.eslintrc.mochitests"
|
||||
}
|
|
@ -3,7 +3,8 @@
|
|||
/* 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/. */
|
||||
/* globals AnimationsController, document, promise, gToolbox, gInspector */
|
||||
/* import-globals-from animation-controller.js */
|
||||
/* globals document */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from canvasdebugger.js */
|
||||
/* globals window, document */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from canvasdebugger.js */
|
||||
/* globals window, document */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
{
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../.eslintrc.mochitests"
|
||||
"extends": "../../../.eslintrc.mochitests",
|
||||
"globals": {
|
||||
"helpers": true,
|
||||
"assert": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,19 +20,6 @@ function update(state = initialState, action, emitChange) {
|
|||
emitChange('source', action.source);
|
||||
return mergeIn(state, ['sources', action.source.actor], action.source);
|
||||
|
||||
case constants.LOAD_SOURCES:
|
||||
if (action.status === 'done') {
|
||||
// We don't need to actually load the sources into the state.
|
||||
// Loading sources actually forces the server to emit several
|
||||
// individual newSources packets which will eventually fire
|
||||
// ADD_SOURCE actions.
|
||||
//
|
||||
// We still emit this event so that the UI can show an "empty
|
||||
// text" label if no sources were loaded.
|
||||
emitChange('sources', state.sources);
|
||||
}
|
||||
break;
|
||||
|
||||
case constants.SELECT_SOURCE:
|
||||
emitChange('source-selected', action.source);
|
||||
return state.merge({
|
||||
|
|
|
@ -32,7 +32,6 @@ function SourcesView(controller, DebuggerView) {
|
|||
dumpn("SourcesView was instantiated");
|
||||
|
||||
utils.onReducerEvents(controller, {
|
||||
"sources": this.renderSources,
|
||||
"source": this.renderSource,
|
||||
"blackboxed": this.renderBlackBoxed,
|
||||
"prettyprinted": this.updateToolbarButtonsState,
|
||||
|
@ -217,12 +216,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
this.sourcesDidUpdate();
|
||||
},
|
||||
|
||||
renderSources: function(sources) {
|
||||
if (Object.keys(sources).length === 0) {
|
||||
this.emptyText = L10N.getStr("noSourcesText");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds a source to this sources container.
|
||||
*
|
||||
|
|
|
@ -361,14 +361,6 @@ var DebuggerController = {
|
|||
_onNavigate: function() {
|
||||
this.ThreadState.handleTabNavigation();
|
||||
this.StackFrames.handleTabNavigation();
|
||||
|
||||
// TODO(jwl): We shouldn't need this call. We're already getting
|
||||
// `newSource` notifications because we're already connected, but
|
||||
// I'm not sure of the order those come in with regards to the
|
||||
// navigation event. Tests look for this action and it needs to
|
||||
// indicate everything is done loading, so we should figure out
|
||||
// another way to indicate that.
|
||||
this.dispatch(actions.loadSources());
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -779,8 +779,6 @@ var DebuggerView = {
|
|||
this.editor.clearHistory();
|
||||
this._editorSource = {};
|
||||
}
|
||||
|
||||
this.Sources.emptyText = L10N.getStr("loadingSourcesText");
|
||||
},
|
||||
|
||||
Toolbar: null,
|
||||
|
|
|
@ -9,6 +9,7 @@ const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
|
|||
|
||||
function test() {
|
||||
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
|
||||
let gPanel = aPanel;
|
||||
let gDebugger = aPanel.panelWin;
|
||||
let gView = gDebugger.DebuggerView;
|
||||
let gEvents = gView.EventListeners;
|
||||
|
@ -33,7 +34,7 @@ function test() {
|
|||
yield waitForSourceShown(aPanel, ".html");
|
||||
is(gEvents.itemCount, 0, "There should be no events before reloading.");
|
||||
|
||||
let reloaded = waitForSourcesAfterReload();
|
||||
let reloaded = waitForNavigation(gPanel);
|
||||
gDebugger.DebuggerController._target.activeTab.reload();
|
||||
|
||||
is(gEvents.itemCount, 0, "There should be no events while reloading.");
|
||||
|
@ -42,13 +43,5 @@ function test() {
|
|||
|
||||
yield closeDebuggerAndFinish(aPanel);
|
||||
});
|
||||
|
||||
function waitForSourcesAfterReload() {
|
||||
return promise.all([
|
||||
waitForDebuggerEvents(aPanel, gDebugger.EVENTS.NEW_SOURCE),
|
||||
waitForDispatch(aPanel, gDebugger.constants.LOAD_SOURCES),
|
||||
waitForDebuggerEvents(aPanel, gDebugger.EVENTS.SOURCE_SHOWN)
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
|
|||
|
||||
function test() {
|
||||
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
|
||||
let gPanel = aPanel;
|
||||
let gDebugger = aPanel.panelWin;
|
||||
let gView = gDebugger.DebuggerView;
|
||||
let gEvents = gView.EventListeners;
|
||||
|
@ -48,7 +49,7 @@ function test() {
|
|||
let fetched = waitForDispatch(aPanel, constants.FETCH_EVENT_LISTENERS);
|
||||
|
||||
let reloading = once(gDebugger.gTarget, "will-navigate");
|
||||
let reloaded = waitForSourcesAfterReload();
|
||||
let reloaded = waitForNavigation(gPanel);
|
||||
gDebugger.DebuggerController._target.activeTab.reload();
|
||||
|
||||
yield reloading;
|
||||
|
@ -99,7 +100,7 @@ function test() {
|
|||
"The variables tab should be selected.");
|
||||
|
||||
let reloading = once(gDebugger.gTarget, "will-navigate");
|
||||
let reloaded = waitForSourcesAfterReload();
|
||||
let reloaded = waitForNavigation(gPanel);
|
||||
gDebugger.DebuggerController._target.activeTab.reload();
|
||||
|
||||
yield reloading;
|
||||
|
@ -125,13 +126,5 @@ function test() {
|
|||
"Event listeners were not added after the target finished navigating.");
|
||||
});
|
||||
}
|
||||
|
||||
function waitForSourcesAfterReload() {
|
||||
return promise.all([
|
||||
waitForDebuggerEvents(aPanel, gDebugger.EVENTS.NEW_SOURCE),
|
||||
waitForDispatch(aPanel, constants.LOAD_SOURCES),
|
||||
waitForDebuggerEvents(aPanel, gDebugger.EVENTS.SOURCE_SHOWN)
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ function test() {
|
|||
|
||||
yield doResume(gPanel);
|
||||
navigateActiveTabTo(gPanel, "about:blank");
|
||||
yield waitForDispatch(gPanel, constants.LOAD_SOURCES);
|
||||
yield waitForDispatch(gPanel, constants.UNLOAD);
|
||||
closeDebuggerAndFinish(gPanel);
|
||||
});
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ function test() {
|
|||
yield waitForSourceAndCaretAndScopes(gPanel, ".html", 14);
|
||||
|
||||
navigateActiveTabTo(gPanel, "about:blank");
|
||||
yield waitForDispatch(gPanel, constants.LOAD_SOURCES);
|
||||
yield waitForNavigation(gPanel);
|
||||
|
||||
isnot(gDebugger.gThreadClient.state, "paused",
|
||||
"Should not be paused after a tab navigation.");
|
||||
|
|
|
@ -21,7 +21,7 @@ function test() {
|
|||
const constants = gDebugger.require('./content/constants');
|
||||
|
||||
reloadActiveTab(gPanel);
|
||||
waitForDispatch(gPanel, constants.LOAD_SOURCES)
|
||||
waitForNavigation(gPanel)
|
||||
.then(testSourcesEmptyText)
|
||||
.then(() => closeDebuggerAndFinish(gPanel))
|
||||
.then(null, aError => {
|
||||
|
|
|
@ -17,6 +17,7 @@ function test() {
|
|||
const gTab = aTab;
|
||||
const gPanel = aPanel;
|
||||
const gDebugger = aPanel.panelWin;
|
||||
const gTarget = gDebugger.gTarget;
|
||||
const gSources = gDebugger.DebuggerView.Sources;
|
||||
const queries = gDebugger.require('./content/queries');
|
||||
const actions = bindActionCreators(gPanel);
|
||||
|
@ -24,9 +25,9 @@ function test() {
|
|||
let gStep = 0;
|
||||
|
||||
function reloadPage() {
|
||||
const loaded = waitForDispatch(gPanel, gDebugger.constants.LOAD_SOURCES);
|
||||
const navigated = waitForNavigation(gPanel);
|
||||
reload(gPanel);
|
||||
return loaded;
|
||||
return navigated;
|
||||
}
|
||||
|
||||
function switchAndReload(aUrl) {
|
||||
|
|
|
@ -1200,6 +1200,18 @@ function getSplitConsole(toolbox, win) {
|
|||
});
|
||||
}
|
||||
|
||||
// navigation
|
||||
|
||||
function waitForNavigation(gPanel) {
|
||||
const target = gPanel.panelWin.gTarget;
|
||||
const deferred = promise.defer();
|
||||
target.once('navigate', () => {
|
||||
deferred.resolve();
|
||||
});
|
||||
info("Waiting for navigation...");
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
// actions
|
||||
|
||||
function bindActionCreators(panel) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* 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/. */
|
||||
/* globals document, window */
|
||||
"use strict";
|
||||
|
||||
// Maps known URLs to friendly source group names and put them at the
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document, window */
|
||||
"use strict";
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document, window */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document, window */
|
||||
"use strict";
|
||||
|
||||
// A time interval sufficient for the options popup panel to finish hiding
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document, window */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document, window */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../debugger-controller.js */
|
||||
/* import-globals-from ../debugger-view.js */
|
||||
/* import-globals-from ../utils.js */
|
||||
/* globals document */
|
||||
"use strict";
|
||||
|
||||
function WorkersView() {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../.eslintrc.mochitests"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.xpcshell"
|
||||
}
|
|
@ -3,6 +3,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from netmonitor-controller.js */
|
||||
/* globals window, document */
|
||||
"use strict";
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "HarExporter", function() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from performance-controller.js */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
/* globals window */
|
||||
"use strict";
|
||||
|
||||
const WATERFALL_RESIZE_EVENTS_DRAIN = 100; // ms
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
/* globals document */
|
||||
"use strict";
|
||||
|
||||
const URL_LABEL_TOOLTIP = L10N.getStr("table.url.tooltiptext");
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
"use strict";
|
||||
|
||||
// No sense updating the overview more often than receiving data from the
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
/* globals document, window */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../performance-controller.js */
|
||||
/* import-globals-from ../performance-view.js */
|
||||
/* globals document */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../.eslintrc.mochitests"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests"
|
||||
}
|
|
@ -77,6 +77,8 @@ GetActionCauseName(InputContextAction::Cause aCause)
|
|||
return "CAUSE_KEY";
|
||||
case InputContextAction::CAUSE_MOUSE:
|
||||
return "CAUSE_MOUSE";
|
||||
case InputContextAction::CAUSE_TOUCH:
|
||||
return "CAUSE_TOUCH";
|
||||
default:
|
||||
return "illegal value";
|
||||
}
|
||||
|
@ -657,8 +659,13 @@ IMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
|
|||
return; // should notify only first click event.
|
||||
}
|
||||
|
||||
InputContextAction action(InputContextAction::CAUSE_MOUSE,
|
||||
InputContextAction::FOCUS_NOT_CHANGED);
|
||||
uint16_t inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
|
||||
aMouseEvent->GetMozInputSource(&inputSource);
|
||||
InputContextAction::Cause cause =
|
||||
inputSource == nsIDOMMouseEvent::MOZ_SOURCE_TOUCH ?
|
||||
InputContextAction::CAUSE_TOUCH : InputContextAction::CAUSE_MOUSE;
|
||||
|
||||
InputContextAction action(cause, InputContextAction::FOCUS_NOT_CHANGED);
|
||||
IMEState newState = GetNewIMEState(aPresContext, aContent);
|
||||
SetIMEState(newState, aContent, widget, action);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "nsFrame.h"
|
||||
#include "nsFrameSelection.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIHapticFeedback.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -63,7 +64,8 @@ std::ostream& operator<<(std::ostream& aStream,
|
|||
|
||||
/*static*/ bool
|
||||
AccessibleCaretManager::sCaretsExtendedVisibility = false;
|
||||
|
||||
/*static*/ bool
|
||||
AccessibleCaretManager::sHapticFeedback = false;
|
||||
|
||||
AccessibleCaretManager::AccessibleCaretManager(nsIPresShell* aPresShell)
|
||||
: mPresShell(aPresShell)
|
||||
|
@ -81,6 +83,8 @@ AccessibleCaretManager::AccessibleCaretManager(nsIPresShell* aPresShell)
|
|||
if (!addedPrefs) {
|
||||
Preferences::AddBoolVarCache(&sCaretsExtendedVisibility,
|
||||
"layout.accessiblecaret.extendedvisibility");
|
||||
Preferences::AddBoolVarCache(&sHapticFeedback,
|
||||
"layout.accessiblecaret.hapticfeedback");
|
||||
addedPrefs = true;
|
||||
}
|
||||
}
|
||||
|
@ -366,6 +370,16 @@ AccessibleCaretManager::UpdateCaretsForTilt()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AccessibleCaretManager::ProvideHapticFeedback()
|
||||
{
|
||||
if (sHapticFeedback) {
|
||||
nsCOMPtr<nsIHapticFeedback> haptic =
|
||||
do_GetService("@mozilla.org/widget/hapticfeedback;1");
|
||||
haptic->PerformSimpleAction(haptic->LongPress);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
AccessibleCaretManager::PressCaret(const nsPoint& aPoint)
|
||||
{
|
||||
|
@ -466,6 +480,7 @@ AccessibleCaretManager::SelectWordOrShortcut(const nsPoint& aPoint)
|
|||
// We need to update carets to get correct information before dispatching
|
||||
// CaretStateChangedEvent.
|
||||
UpdateCarets();
|
||||
ProvideHapticFeedback();
|
||||
DispatchCaretStateChangedEvent(CaretChangedReason::Longpressonemptycontent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -496,6 +511,8 @@ AccessibleCaretManager::SelectWordOrShortcut(const nsPoint& aPoint)
|
|||
|
||||
nsresult rv = SelectWord(ptFrame, ptInFrame);
|
||||
UpdateCarets();
|
||||
ProvideHapticFeedback();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,9 @@ protected:
|
|||
void UpdateCaretsForCursorMode(UpdateCaretsHint aHint);
|
||||
void UpdateCaretsForSelectionMode(UpdateCaretsHint aHint);
|
||||
|
||||
// Provide haptic / touch feedback, primarily for select on longpress.
|
||||
void ProvideHapticFeedback();
|
||||
|
||||
// Get the nearest enclosing focusable frame of aFrame.
|
||||
// @return focusable frame if there is any; nullptr otherwise.
|
||||
nsIFrame* GetFocusableFrame(nsIFrame* aFrame) const;
|
||||
|
@ -248,6 +251,9 @@ protected:
|
|||
// (NO_REASON) selection change notifications generated by keyboard IME, and to
|
||||
// maintain a visible ActionBar while carets NotShown during scroll.
|
||||
static bool sCaretsExtendedVisibility;
|
||||
|
||||
// AccessibleCaret pref for haptic feedback behaviour on longPress.
|
||||
static bool sHapticFeedback;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& aStream,
|
||||
|
|
|
@ -919,6 +919,9 @@ pref("layout.accessiblecaret.use_long_tap_injector", false);
|
|||
// or misc internal events.
|
||||
pref("layout.accessiblecaret.extendedvisibility", true);
|
||||
|
||||
// Optionally provide haptic feedback on longPress selection events.
|
||||
pref("layout.accessiblecaret.hapticfeedback", true);
|
||||
|
||||
// Disable sending console to logcat on release builds.
|
||||
#ifdef RELEASE_BUILD
|
||||
pref("consoleservice.logcat", false);
|
||||
|
|
|
@ -20,6 +20,7 @@ sourceSets {
|
|||
srcDir "${topsrcdir}/mobile/android/locales"
|
||||
srcDir "${topsrcdir}/mobile/android/modules"
|
||||
srcDir "${topsrcdir}/mobile/android/themes"
|
||||
srcDir "${topsrcdir}/toolkit"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -471,17 +471,13 @@ update-generated-wrappers:
|
|||
.PHONY: update-generated-wrappers
|
||||
|
||||
# This target is only used by IDE integrations. It rebuilds resources
|
||||
# that end up in omni.ja, does most of the packaging step, and then
|
||||
# updates omni.ja in place. If you're not using an IDE, you should be
|
||||
# using |mach build mobile/android && mach package|.
|
||||
# that end up in omni.ja using the equivalent of |mach build faster|,
|
||||
# does most of the packaging step, and then updates omni.ja in
|
||||
# place. If you're not using an IDE, you should be using |mach build
|
||||
# mobile/android && mach package|.
|
||||
$(abspath $(DIST)/fennec/$(OMNIJAR_NAME)): FORCE
|
||||
$(REPORT_BUILD)
|
||||
$(MAKE) -C ../locales
|
||||
$(MAKE) -C ../chrome
|
||||
$(MAKE) -C ../components
|
||||
$(MAKE) -C ../modules
|
||||
$(MAKE) -C ../app
|
||||
$(MAKE) -C ../themes/core
|
||||
$(MAKE) -C ../../../faster
|
||||
$(MAKE) -C ../installer stage-package
|
||||
$(MKDIR) -p $(@D)
|
||||
rsync --update $(DIST)/fennec/$(notdir $(OMNIJAR_NAME)) $@
|
||||
|
|
|
@ -159,7 +159,6 @@ public class FindInPageBar extends LinearLayout implements TextWatcher, View.OnC
|
|||
|
||||
// Repeat the find after a matchcase change.
|
||||
sendRequestToFinderHelper("FindInPage:Find", mFindText.getText().toString());
|
||||
getInputMethodManager(mFindText).hideSoftInputFromWindow(mFindText.getWindowToken(), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -685,6 +685,15 @@ OnSharedPreferenceChangeListener
|
|||
}
|
||||
setupPreferences((PreferenceGroup) pref, prefs);
|
||||
} else {
|
||||
if (handlers.containsKey(key)) {
|
||||
PrefHandler handler = handlers.get(key);
|
||||
if (!handler.setupPref(this, pref)) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
pref.setOnPreferenceChangeListener(this);
|
||||
if (PREFS_UPDATER_AUTODOWNLOAD.equals(key)) {
|
||||
if (!AppConstants.MOZ_UPDATER) {
|
||||
|
@ -853,15 +862,6 @@ OnSharedPreferenceChangeListener
|
|||
|
||||
final String url = getResources().getString(R.string.faq_link, VERSION, OS, LOCALE);
|
||||
((LinkPreference) pref).setUrl(url);
|
||||
} else if (handlers.containsKey(key)) {
|
||||
// This should be the last task. We might have removed some of this preferences previously. We only
|
||||
// want to run the PrefHandler for a preference if it still exists.
|
||||
PrefHandler handler = handlers.get(key);
|
||||
if (!handler.setupPref(this, pref)) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Some Preference UI elements are not actually preferences,
|
||||
|
|
|
@ -4888,6 +4888,9 @@ pref("layout.accessiblecaret.use_long_tap_injector", true);
|
|||
// events hide AccessibleCarets by default.
|
||||
pref("layout.accessiblecaret.extendedvisibility", false);
|
||||
|
||||
// Optionally provide haptic feedback on longPress selection events.
|
||||
pref("layout.accessiblecaret.hapticfeedback", false);
|
||||
|
||||
// Wakelock is disabled by default.
|
||||
pref("dom.wakelock.enabled", false);
|
||||
|
||||
|
|
|
@ -200,11 +200,16 @@ class MachCommands(MachCommandBase):
|
|||
'--ext', ext, # This keeps ext as a single argument.
|
||||
] + args
|
||||
|
||||
return self.run_process(cmd_args,
|
||||
success = self.run_process(cmd_args,
|
||||
pass_thru=True, # Allow user to run eslint interactively.
|
||||
ensure_exit_code=False, # Don't throw on non-zero exit code.
|
||||
require_unix_environment=True # eslint is not a valid Win32 binary.
|
||||
)
|
||||
|
||||
self.log(logging.INFO, 'eslint', {'msg': ('No errors' if success == 0 else 'Errors')},
|
||||
'Finished eslint. {msg} encountered.')
|
||||
return success
|
||||
|
||||
def eslint_setup(self, update_only=False):
|
||||
"""Ensure eslint is optimally configured.
|
||||
|
||||
|
|
|
@ -26,4 +26,4 @@ sync.eol.learnMore.label = Learn more
|
|||
sync.eol.learnMore.accesskey = L
|
||||
|
||||
syncnow.label = Sync Now
|
||||
syncing.label = Syncing
|
||||
syncing2.label = Syncing…
|
||||
|
|
|
@ -18,9 +18,16 @@ def slurper = new JsonSlurper()
|
|||
def json = slurper.parseText(standardOutput.toString())
|
||||
|
||||
if (json.substs.MOZ_BUILD_APP != 'mobile/android') {
|
||||
throw new GradleException("Building with Gradle is only supported for Fennec, i.e., MOZ_BUILD_APP == 'mobile/android'.");
|
||||
throw new GradleException("Building with Gradle is only supported for Fennec, i.e., MOZ_BUILD_APP == 'mobile/android'.")
|
||||
}
|
||||
|
||||
// Set the Android SDK location. This is the *least specific* mechanism, which
|
||||
// is unfortunate: we'd prefer to use the *most specific* mechanism. That is,
|
||||
// local.properties (first 'sdk.dir', then 'android.dir') and then the
|
||||
// environment variable ANDROID_HOME will override this. That's unfortunate,
|
||||
// but it's hard to automatically arrange better.
|
||||
System.setProperty('android.home', json.substs.ANDROID_SDK_ROOT)
|
||||
|
||||
include ':app'
|
||||
include ':base'
|
||||
include ':omnijar'
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
.. _import-globals-from:
|
||||
|
||||
===================
|
||||
import-globals-from
|
||||
===================
|
||||
|
||||
Rule Details
|
||||
------------
|
||||
|
||||
When the "import-globals-from <path>" comment is found in a file, then all
|
||||
globals from the file at <path> will be imported in the current scope.
|
||||
|
||||
This is useful for tests that rely on globals defined in head.js files, or for
|
||||
scripts that are loaded as <script> tag in a window in rely on eachother's
|
||||
globals.
|
||||
|
||||
If <path> is a relative path, then it must be relative to the file being
|
||||
checked by the rule.
|
|
@ -10,6 +10,10 @@ removeEventListener (and does the same for on/off).
|
|||
``components-imports`` adds the filename of imported files e.g.
|
||||
``Cu.import("some/path/Blah.jsm")`` adds Blah to the global scope.
|
||||
|
||||
``import-globals-from`` When the "import-globals-from <path>" comment is found
|
||||
in a file, then all globals from the file at <path> will be imported in the
|
||||
current scope.
|
||||
|
||||
``import-headjs-globals`` imports globals from head.js and from any files that
|
||||
should be imported by head.js (as far as we can correctly resolve the path).
|
||||
|
||||
|
@ -47,6 +51,7 @@ Example configuration::
|
|||
"rules": {
|
||||
"mozilla/balanced-listeners": 2,
|
||||
"mozilla/components-imports": 1,
|
||||
"mozilla/import-globals-from": 1,
|
||||
"mozilla/import-headjs-globals": 1,
|
||||
"mozilla/mark-test-function-used": 1,
|
||||
"mozilla/var-only-at-top-level": 1,
|
||||
|
@ -58,6 +63,7 @@ Example configuration::
|
|||
|
||||
balanced-listeners
|
||||
components-imports
|
||||
import-globals-from
|
||||
import-headjs-globals
|
||||
mark-test-function-used
|
||||
no-aArgs
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
var escope = require("escope");
|
||||
var espree = require("espree");
|
||||
var path = require("path");
|
||||
|
||||
var regexes = [
|
||||
/^(?:Cu|Components\.utils)\.import\(".*\/(.*?)\.jsm?"\);?$/,
|
||||
|
@ -232,5 +233,33 @@ module.exports = {
|
|||
var pathAndFilename = scope.getFilename();
|
||||
|
||||
return /.*[\\/]browser_.+\.js$/.test(pathAndFilename);
|
||||
},
|
||||
|
||||
/**
|
||||
* ESLint may be executed from various places: from mach, at the root of the
|
||||
* repository, or from a directory in the repository when, for instance,
|
||||
* executed by a text editor's plugin.
|
||||
* The value returned by context.getFileName() varies because of this.
|
||||
* This helper function makes sure to return an absolute file path for the
|
||||
* current context, by looking at process.cwd().
|
||||
* @param {Context} context
|
||||
* @return {String} The absolute path
|
||||
*/
|
||||
getAbsoluteFilePath: function(context) {
|
||||
var fileName = context.getFilename();
|
||||
var cwd = process.cwd();
|
||||
|
||||
if (path.isAbsolute(fileName)) {
|
||||
// Case 2: executed from the repo's root with mach:
|
||||
// fileName: /path/to/mozilla/repo/a/b/c/d.js
|
||||
// cwd: /path/to/mozilla/repo
|
||||
return fileName;
|
||||
} else {
|
||||
// Case 1: executed form in a nested directory, e.g. from a text editor:
|
||||
// fileName: a/b/c/d.js
|
||||
// cwd: /path/to/mozilla/repo/a/b/c
|
||||
var dirName = path.dirname(fileName);
|
||||
return cwd.slice(0, cwd.length - dirName.length) + fileName;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -19,6 +19,7 @@ module.exports = {
|
|||
rules: {
|
||||
"balanced-listeners": require("../lib/rules/balanced-listeners"),
|
||||
"components-imports": require("../lib/rules/components-imports"),
|
||||
"import-globals-from": require("../lib/rules/import-globals-from"),
|
||||
"import-headjs-globals": require("../lib/rules/import-headjs-globals"),
|
||||
"mark-test-function-used": require("../lib/rules/mark-test-function-used"),
|
||||
"no-aArgs": require("../lib/rules/no-aArgs"),
|
||||
|
@ -28,6 +29,7 @@ module.exports = {
|
|||
rulesConfig: {
|
||||
"balanced-listeners": 0,
|
||||
"components-imports": 0,
|
||||
"import-globals-from": 0,
|
||||
"import-headjs-globals": 0,
|
||||
"mark-test-function-used": 0,
|
||||
"no-aArgs": 0,
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* @fileoverview When the "import-globals-from: <path>" comment is found in a
|
||||
* file, then all globals from the file at <path> will be imported in the
|
||||
* current scope.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
var fs = require("fs");
|
||||
var helpers = require("../helpers");
|
||||
var path = require("path");
|
||||
|
||||
module.exports = function(context) {
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function importGlobalsFrom(filePath) {
|
||||
// If the file can't be found, let the error go up to the caller so it can
|
||||
// be logged as an error in the current file.
|
||||
var content = fs.readFileSync(filePath, "utf8");
|
||||
|
||||
// Parse the content and get the globals from the ast.
|
||||
var ast = helpers.getAST(content);
|
||||
var globalVars = helpers.getGlobals(ast);
|
||||
|
||||
for (var i = 0; i < globalVars.length; i++) {
|
||||
var varName = globalVars[i];
|
||||
helpers.addVarToScope(varName, context);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Public
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
return {
|
||||
Program: function(node) {
|
||||
var comments = context.getSourceCode().getAllComments();
|
||||
|
||||
comments.forEach(function(comment) {
|
||||
var value = comment.value.trim();
|
||||
var match = /^import-globals-from\s+(.*)$/.exec(value);
|
||||
|
||||
if (match) {
|
||||
var currentFilePath = helpers.getAbsoluteFilePath(context);
|
||||
var filePath = match[1];
|
||||
|
||||
if (!path.isAbsolute(filePath)) {
|
||||
var dirName = path.dirname(currentFilePath);
|
||||
filePath = path.resolve(dirName, filePath);
|
||||
}
|
||||
|
||||
try {
|
||||
importGlobalsFrom(filePath);
|
||||
} catch (e) {
|
||||
context.report(
|
||||
node,
|
||||
"Could not load globals from file {{filePath}}: {{error}}",
|
||||
{
|
||||
filePath: filePath,
|
||||
error: e
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
|
@ -91,12 +91,11 @@ module.exports = function(context) {
|
|||
return;
|
||||
}
|
||||
|
||||
var testPath = this.getFilename();
|
||||
var testFilename = path.basename(testPath);
|
||||
var fullTestPath = path.resolve(testFilename);
|
||||
var fullHeadjsPath = path.resolve("head.js");
|
||||
var currentFilePath = helpers.getAbsoluteFilePath(context);
|
||||
var dirName = path.dirname(currentFilePath);
|
||||
var fullHeadjsPath = path.resolve(dirName, "head.js");
|
||||
|
||||
checkFile([fullTestPath, fullHeadjsPath]);
|
||||
checkFile([currentFilePath, fullHeadjsPath]);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1903,23 +1903,26 @@ function getAppCacheStatus(msg) {
|
|||
}
|
||||
|
||||
// emulator callbacks
|
||||
var _emu_cb_id = 0;
|
||||
var _emu_cbs = {};
|
||||
|
||||
function runEmulatorCmd(cmd, callback) {
|
||||
logger.info("listener runEmulatorCmd cmd=" + cmd);
|
||||
if (callback) {
|
||||
_emu_cbs[asyncTestCommandId] = callback;
|
||||
_emu_cbs[_emu_cb_id] = callback;
|
||||
}
|
||||
sendAsyncMessage("Marionette:runEmulatorCmd",
|
||||
{command: cmd, id: asyncTestCommandId});
|
||||
{command: cmd, id: _emu_cb_id});
|
||||
_emu_cb_id += 1;
|
||||
}
|
||||
|
||||
function runEmulatorShell(args, callback) {
|
||||
if (callback) {
|
||||
_emu_cbs[asyncTestCommandId] = callback;
|
||||
_emu_cbs[_emu_cb_id] = callback;
|
||||
}
|
||||
sendAsyncMessage("Marionette:runEmulatorShell",
|
||||
{arguments: args, id: asyncTestCommandId});
|
||||
{arguments: args, id: _emu_cb_id});
|
||||
_emu_cb_id += 1;
|
||||
}
|
||||
|
||||
function emulatorCmdResult(msg) {
|
||||
|
|
|
@ -627,6 +627,7 @@ class CIBuild(object):
|
|||
help="Run the task with the interactive feature enabled")
|
||||
def create_ci_build(self, **params):
|
||||
from taskcluster_graph.templates import Templates
|
||||
from taskcluster_graph.image_builder import docker_image
|
||||
import taskcluster_graph.build_task
|
||||
|
||||
templates = Templates(ROOT)
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче