mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Merge mozilla-central to inbound. a=merge CLOSED TREE
This commit is contained in:
commit
a851ae46ec
@ -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/. */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Utils",
|
||||
"resource://gre/modules/accessibility/Utils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Logger",
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Utils",
|
||||
|
@ -2,14 +2,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/. */
|
||||
|
||||
/* exported TraversalRules, TraversalHelper */
|
||||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["TraversalRules", "TraversalHelper"]; // jshint ignore:line
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/accessibility/Utils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Roles", // jshint ignore:line
|
||||
"resource://gre/modules/accessibility/Constants.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Filters", // jshint ignore:line
|
||||
|
@ -2,11 +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/. */
|
||||
|
||||
/* exported Utils, Logger, PivotContext, PrefCache */
|
||||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Services", // jshint ignore:line
|
||||
"resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Rect", // jshint ignore:line
|
||||
|
@ -471,7 +471,7 @@ pref("browser.tabs.showAudioPlayingIcon", true);
|
||||
// This should match Chromium's audio indicator delay.
|
||||
pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000);
|
||||
|
||||
pref("browser.ctrlTab.previews", false);
|
||||
pref("browser.ctrlTab.recentlyUsedOrder", true);
|
||||
|
||||
// By default, do not export HTML at shutdown.
|
||||
// If true, at shutdown the bookmarks in your menu and toolbar will
|
||||
@ -1147,7 +1147,7 @@ pref("services.sync.prefs.sync.addons.ignoreUserEnabledChanges", true);
|
||||
// could weaken the pref locally, install an add-on from an untrusted
|
||||
// source, and this would propagate automatically to other,
|
||||
// uncompromised Sync-connected devices.
|
||||
pref("services.sync.prefs.sync.browser.ctrlTab.previews", true);
|
||||
pref("services.sync.prefs.sync.browser.ctrlTab.recentlyUsedOrder", true);
|
||||
pref("services.sync.prefs.sync.browser.download.useDownloadDir", true);
|
||||
pref("services.sync.prefs.sync.browser.formfill.enable", true);
|
||||
pref("services.sync.prefs.sync.browser.link.open_newwindow", true);
|
||||
|
@ -220,7 +220,7 @@ var ctrlTab = {
|
||||
}
|
||||
},
|
||||
|
||||
prefName: "browser.ctrlTab.previews",
|
||||
prefName: "browser.ctrlTab.recentlyUsedOrder",
|
||||
readPref: function ctrlTab_readPref() {
|
||||
var enable =
|
||||
Services.prefs.getBoolPref(this.prefName) &&
|
||||
@ -465,48 +465,52 @@ var ctrlTab = {
|
||||
}
|
||||
},
|
||||
|
||||
onKeyPress: function ctrlTab_onKeyPress(event) {
|
||||
var isOpen = this.isOpen;
|
||||
|
||||
if (isOpen) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
onKeyDown(event) {
|
||||
if (event.keyCode != event.DOM_VK_TAB ||
|
||||
!event.ctrlKey ||
|
||||
event.altKey ||
|
||||
event.metaKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.keyCode) {
|
||||
case event.DOM_VK_TAB:
|
||||
if (event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||
if (isOpen) {
|
||||
this.advanceFocus(!event.shiftKey);
|
||||
} else if (!event.shiftKey) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
let tabs = gBrowser.visibleTabs;
|
||||
if (tabs.length > 2) {
|
||||
this.open();
|
||||
} else if (tabs.length == 2) {
|
||||
let index = tabs[0].selected ? 1 : 0;
|
||||
gBrowser.selectedTab = tabs[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if (this.isOpen) {
|
||||
this.advanceFocus(!event.shiftKey);
|
||||
} else if (!event.shiftKey) {
|
||||
let tabs = gBrowser.visibleTabs;
|
||||
if (tabs.length > 2) {
|
||||
this.open();
|
||||
} else if (tabs.length == 2) {
|
||||
let index = tabs[0].selected ? 1 : 0;
|
||||
gBrowser.selectedTab = tabs[index];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onKeyPress(event) {
|
||||
if (!this.isOpen ||
|
||||
!event.ctrlKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if (event.keyCode == event.DOM_VK_DELETE) {
|
||||
this.remove(this.selected);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.charCode) {
|
||||
case this.keys.close:
|
||||
this.remove(this.selected);
|
||||
break;
|
||||
case this.keys.find:
|
||||
case this.keys.selectAll:
|
||||
this.showAllTabs();
|
||||
break;
|
||||
default:
|
||||
if (isOpen && event.ctrlKey) {
|
||||
if (event.keyCode == event.DOM_VK_DELETE) {
|
||||
this.remove(this.selected);
|
||||
break;
|
||||
}
|
||||
switch (event.charCode) {
|
||||
case this.keys.close:
|
||||
this.remove(this.selected);
|
||||
break;
|
||||
case this.keys.find:
|
||||
case this.keys.selectAll:
|
||||
this.showAllTabs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -561,6 +565,9 @@ var ctrlTab = {
|
||||
if (this.isOpen)
|
||||
this.removeClosingTabFromUI(event.target);
|
||||
break;
|
||||
case "keydown":
|
||||
this.onKeyDown(event);
|
||||
break;
|
||||
case "keypress":
|
||||
this.onKeyPress(event);
|
||||
break;
|
||||
@ -606,6 +613,11 @@ var ctrlTab = {
|
||||
tabContainer[toggleEventListener]("TabSelect", this);
|
||||
tabContainer[toggleEventListener]("TabClose", this);
|
||||
|
||||
if (enable) {
|
||||
Services.els.addSystemEventListener(document, "keydown", this, false);
|
||||
} else {
|
||||
Services.els.removeSystemEventListener(document, "keydown", this, false);
|
||||
}
|
||||
document[toggleEventListener]("keypress", this);
|
||||
gBrowser.tabbox.handleCtrlTab = !enable;
|
||||
|
||||
|
@ -799,7 +799,6 @@
|
||||
autocompletesearchparam="enable-actions"
|
||||
autocompletepopup="PopupAutoCompleteRichResult"
|
||||
completeselectedindex="true"
|
||||
shrinkdelay="250"
|
||||
tabscrolling="true"
|
||||
newlines="stripsurroundingwhitespace"
|
||||
ontextentered="this.handleCommand(param);"
|
||||
|
@ -1277,15 +1277,17 @@ window._gBrowser = {
|
||||
return this._setTabLabel(aTab, title, { isContentTitle });
|
||||
},
|
||||
|
||||
_setTabLabel(aTab, aLabel, aOptions) {
|
||||
_setTabLabel(aTab, aLabel, {
|
||||
beforeTabOpen,
|
||||
isContentTitle,
|
||||
} = {}) {
|
||||
if (!aLabel) {
|
||||
return false;
|
||||
}
|
||||
|
||||
aTab._fullLabel = aLabel;
|
||||
|
||||
aOptions = aOptions || {};
|
||||
if (!aOptions.isContentTitle) {
|
||||
if (!isContentTitle) {
|
||||
// Remove protocol and "www."
|
||||
if (!("_regex_shortenURLForTabLabel" in this)) {
|
||||
this._regex_shortenURLForTabLabel = /^[^:]+:\/\/(?:www\.)?/;
|
||||
@ -1293,7 +1295,7 @@ window._gBrowser = {
|
||||
aLabel = aLabel.replace(this._regex_shortenURLForTabLabel, "");
|
||||
}
|
||||
|
||||
aTab._labelIsContentTitle = aOptions.isContentTitle;
|
||||
aTab._labelIsContentTitle = isContentTitle;
|
||||
|
||||
if (aTab.getAttribute("label") == aLabel) {
|
||||
return false;
|
||||
@ -1307,7 +1309,7 @@ window._gBrowser = {
|
||||
|
||||
// Dispatch TabAttrModified event unless we're setting the label
|
||||
// before the TabOpen event was dispatched.
|
||||
if (!aOptions.beforeTabOpen) {
|
||||
if (!beforeTabOpen) {
|
||||
this._tabAttrModified(aTab, ["label"]);
|
||||
}
|
||||
|
||||
@ -1512,8 +1514,12 @@ window._gBrowser = {
|
||||
}
|
||||
},
|
||||
|
||||
updateBrowserRemoteness(aBrowser, aShouldBeRemote, aOptions) {
|
||||
aOptions = aOptions || {};
|
||||
updateBrowserRemoteness(aBrowser, aShouldBeRemote, {
|
||||
newFrameloader,
|
||||
opener,
|
||||
remoteType,
|
||||
sameProcessAsFrameLoader,
|
||||
} = {}) {
|
||||
let isRemote = aBrowser.getAttribute("remote") == "true";
|
||||
|
||||
if (!gMultiProcessBrowser && aShouldBeRemote) {
|
||||
@ -1522,26 +1528,26 @@ window._gBrowser = {
|
||||
}
|
||||
|
||||
// Default values for remoteType
|
||||
if (!aOptions.remoteType) {
|
||||
aOptions.remoteType = aShouldBeRemote ? E10SUtils.DEFAULT_REMOTE_TYPE : E10SUtils.NOT_REMOTE;
|
||||
if (!remoteType) {
|
||||
remoteType = aShouldBeRemote ? E10SUtils.DEFAULT_REMOTE_TYPE : E10SUtils.NOT_REMOTE;
|
||||
}
|
||||
|
||||
// If we are passed an opener, we must be making the browser non-remote, and
|
||||
// if the browser is _currently_ non-remote, we need the openers to match,
|
||||
// because it is already too late to change it.
|
||||
if (aOptions.opener) {
|
||||
if (opener) {
|
||||
if (aShouldBeRemote) {
|
||||
throw new Error("Cannot set an opener on a browser which should be remote!");
|
||||
}
|
||||
if (!isRemote && aBrowser.contentWindow.opener != aOptions.opener) {
|
||||
if (!isRemote && aBrowser.contentWindow.opener != opener) {
|
||||
throw new Error("Cannot change opener on an already non-remote browser!");
|
||||
}
|
||||
}
|
||||
|
||||
// Abort if we're not going to change anything
|
||||
let currentRemoteType = aBrowser.getAttribute("remoteType");
|
||||
if (isRemote == aShouldBeRemote && !aOptions.newFrameloader &&
|
||||
(!isRemote || currentRemoteType == aOptions.remoteType)) {
|
||||
let oldRemoteType = aBrowser.getAttribute("remoteType");
|
||||
if (isRemote == aShouldBeRemote && !newFrameloader &&
|
||||
(!isRemote || oldRemoteType == remoteType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1567,23 +1573,20 @@ window._gBrowser = {
|
||||
// We'll be creating a new listener, so destroy the old one.
|
||||
listener.destroy();
|
||||
|
||||
let oldDroppedLinkHandler = aBrowser.droppedLinkHandler;
|
||||
let oldSameProcessAsFrameLoader = aBrowser.sameProcessAsFrameLoader;
|
||||
let oldUserTypedValue = aBrowser.userTypedValue;
|
||||
let hadStartedLoad = aBrowser.didStartLoadSinceLastUserTyping();
|
||||
|
||||
// Make sure the browser is destroyed so it unregisters from observer notifications
|
||||
aBrowser.destroy();
|
||||
|
||||
// Make sure to restore the original droppedLinkHandler and
|
||||
// sameProcessAsFrameLoader.
|
||||
let droppedLinkHandler = aBrowser.droppedLinkHandler;
|
||||
let sameProcessAsFrameLoader = aBrowser.sameProcessAsFrameLoader;
|
||||
|
||||
// Change the "remote" attribute.
|
||||
let parent = aBrowser.parentNode;
|
||||
aBrowser.remove();
|
||||
if (aShouldBeRemote) {
|
||||
aBrowser.setAttribute("remote", "true");
|
||||
aBrowser.setAttribute("remoteType", aOptions.remoteType);
|
||||
aBrowser.setAttribute("remoteType", remoteType);
|
||||
} else {
|
||||
aBrowser.setAttribute("remote", "false");
|
||||
aBrowser.removeAttribute("remoteType");
|
||||
@ -1591,19 +1594,19 @@ window._gBrowser = {
|
||||
|
||||
// NB: This works with the hack in the browser constructor that
|
||||
// turns this normal property into a field.
|
||||
if (aOptions.sameProcessAsFrameLoader) {
|
||||
// Always set sameProcessAsFrameLoader when passed in aOptions.
|
||||
aBrowser.sameProcessAsFrameLoader = aOptions.sameProcessAsFrameLoader;
|
||||
} else if (!aShouldBeRemote || currentRemoteType == aOptions.remoteType) {
|
||||
if (sameProcessAsFrameLoader) {
|
||||
// Always set sameProcessAsFrameLoader when passed in explicitly.
|
||||
aBrowser.sameProcessAsFrameLoader = sameProcessAsFrameLoader;
|
||||
} else if (!aShouldBeRemote || oldRemoteType == remoteType) {
|
||||
// Only copy existing sameProcessAsFrameLoader when not switching
|
||||
// remote type otherwise it would stop the switch.
|
||||
aBrowser.sameProcessAsFrameLoader = sameProcessAsFrameLoader;
|
||||
aBrowser.sameProcessAsFrameLoader = oldSameProcessAsFrameLoader;
|
||||
}
|
||||
|
||||
if (aOptions.opener) {
|
||||
if (opener) {
|
||||
// Set the opener window on the browser, such that when the frame
|
||||
// loader is created the opener is set correctly.
|
||||
aBrowser.presetOpenerWindow(aOptions.opener);
|
||||
aBrowser.presetOpenerWindow(opener);
|
||||
}
|
||||
|
||||
parent.appendChild(aBrowser);
|
||||
@ -1613,7 +1616,7 @@ window._gBrowser = {
|
||||
aBrowser.urlbarChangeTracker.startedLoad();
|
||||
}
|
||||
|
||||
aBrowser.droppedLinkHandler = droppedLinkHandler;
|
||||
aBrowser.droppedLinkHandler = oldDroppedLinkHandler;
|
||||
|
||||
// Switching a browser's remoteness will create a new frameLoader.
|
||||
// As frameLoaders start out with an active docShell we have to
|
||||
@ -1678,18 +1681,18 @@ window._gBrowser = {
|
||||
if (!gMultiProcessBrowser)
|
||||
return this.updateBrowserRemoteness(aBrowser, false);
|
||||
|
||||
let currentRemoteType = aBrowser.getAttribute("remoteType") || null;
|
||||
let oldRemoteType = aBrowser.getAttribute("remoteType") || null;
|
||||
|
||||
aOptions.remoteType =
|
||||
E10SUtils.getRemoteTypeForURI(aURL,
|
||||
gMultiProcessBrowser,
|
||||
currentRemoteType,
|
||||
oldRemoteType,
|
||||
aBrowser.currentURI);
|
||||
|
||||
// If this URL can't load in the current browser then flip it to the
|
||||
// correct type.
|
||||
if (currentRemoteType != aOptions.remoteType ||
|
||||
aOptions.newFrameloader) {
|
||||
if (oldRemoteType != aOptions.remoteType ||
|
||||
aOptions.newFrameloader) {
|
||||
let remote = aOptions.remoteType != E10SUtils.NOT_REMOTE;
|
||||
return this.updateBrowserRemoteness(aBrowser, remote, aOptions);
|
||||
}
|
||||
@ -1775,12 +1778,19 @@ window._gBrowser = {
|
||||
FullZoom.onLocationChange(tabURI, false, browser);
|
||||
},
|
||||
|
||||
_createBrowser(aParams) {
|
||||
// Supported parameters:
|
||||
// userContextId, remote, remoteType, isPreloadBrowser,
|
||||
// uriIsAboutBlank, sameProcessAsFrameLoader,
|
||||
// recordExecution, replayExecution
|
||||
|
||||
_createBrowser({
|
||||
isPreloadBrowser,
|
||||
name,
|
||||
nextTabParentId,
|
||||
openerWindow,
|
||||
recordExecution,
|
||||
remote,
|
||||
remoteType,
|
||||
replayExecution,
|
||||
sameProcessAsFrameLoader,
|
||||
uriIsAboutBlank,
|
||||
userContextId,
|
||||
} = {}) {
|
||||
let b = document.createElementNS(this._XUL_NS, "browser");
|
||||
b.permanentKey = {};
|
||||
|
||||
@ -1788,38 +1798,36 @@ window._gBrowser = {
|
||||
b.setAttribute(attribute, this._defaultBrowserAttributes[attribute]);
|
||||
}
|
||||
|
||||
if (aParams.userContextId) {
|
||||
b.setAttribute("usercontextid", aParams.userContextId);
|
||||
if (userContextId) {
|
||||
b.setAttribute("usercontextid", userContextId);
|
||||
}
|
||||
|
||||
// remote parameter used by some addons, use default in this case.
|
||||
if (aParams.remote && !aParams.remoteType) {
|
||||
aParams.remoteType = E10SUtils.DEFAULT_REMOTE_TYPE;
|
||||
if (remote && !remoteType) {
|
||||
remoteType = E10SUtils.DEFAULT_REMOTE_TYPE;
|
||||
}
|
||||
|
||||
if (aParams.remoteType) {
|
||||
b.setAttribute("remoteType", aParams.remoteType);
|
||||
if (remoteType) {
|
||||
b.setAttribute("remoteType", remoteType);
|
||||
b.setAttribute("remote", "true");
|
||||
}
|
||||
|
||||
let recordExecution = aParams && aParams.recordExecution;
|
||||
if (recordExecution) {
|
||||
b.setAttribute("recordExecution", recordExecution);
|
||||
}
|
||||
|
||||
let replayExecution = aParams && aParams.replayExecution;
|
||||
if (replayExecution) {
|
||||
b.setAttribute("replayExecution", replayExecution);
|
||||
}
|
||||
|
||||
if (aParams.openerWindow) {
|
||||
if (aParams.remoteType) {
|
||||
if (openerWindow) {
|
||||
if (remoteType) {
|
||||
throw new Error("Cannot set opener window on a remote browser!");
|
||||
}
|
||||
b.presetOpenerWindow(aParams.openerWindow);
|
||||
b.presetOpenerWindow(openerWindow);
|
||||
}
|
||||
|
||||
if (!aParams.isPreloadBrowser) {
|
||||
if (!isPreloadBrowser) {
|
||||
b.setAttribute("autocompletepopup", "PopupAutoComplete");
|
||||
}
|
||||
|
||||
@ -1838,28 +1846,28 @@ window._gBrowser = {
|
||||
* that browser altogether
|
||||
* See more details on Bug 1420285.
|
||||
*/
|
||||
if (aParams.isPreloadBrowser) {
|
||||
if (isPreloadBrowser) {
|
||||
b.setAttribute("preloadedState", "preloaded");
|
||||
}
|
||||
|
||||
if (aParams.nextTabParentId) {
|
||||
if (!aParams.remoteType) {
|
||||
if (nextTabParentId) {
|
||||
if (!remoteType) {
|
||||
throw new Error("Cannot have nextTabParentId without a remoteType");
|
||||
}
|
||||
// Gecko is going to read this attribute and use it.
|
||||
b.setAttribute("nextTabParentId", aParams.nextTabParentId.toString());
|
||||
b.setAttribute("nextTabParentId", nextTabParentId.toString());
|
||||
}
|
||||
|
||||
if (aParams.sameProcessAsFrameLoader) {
|
||||
b.sameProcessAsFrameLoader = aParams.sameProcessAsFrameLoader;
|
||||
if (sameProcessAsFrameLoader) {
|
||||
b.sameProcessAsFrameLoader = sameProcessAsFrameLoader;
|
||||
}
|
||||
|
||||
// This will be used by gecko to control the name of the opened
|
||||
// window.
|
||||
if (aParams.name) {
|
||||
if (name) {
|
||||
// XXX: The `name` property is special in HTML and XUL. Should
|
||||
// we use a different attribute name for this?
|
||||
b.setAttribute("name", aParams.name);
|
||||
b.setAttribute("name", name);
|
||||
}
|
||||
|
||||
// Create the browserStack container
|
||||
@ -1888,7 +1896,7 @@ window._gBrowser = {
|
||||
|
||||
// Prevent the superfluous initial load of a blank document
|
||||
// if we're going to load something other than about:blank.
|
||||
if (!aParams.uriIsAboutBlank) {
|
||||
if (!uriIsAboutBlank) {
|
||||
b.setAttribute("nodefaultsrc", "true");
|
||||
}
|
||||
|
||||
@ -2613,13 +2621,11 @@ window._gBrowser = {
|
||||
this.removeTab(this.selectedTab, aParams);
|
||||
},
|
||||
|
||||
removeTab(aTab, aParams) {
|
||||
if (aParams) {
|
||||
var animate = aParams.animate;
|
||||
var byMouse = aParams.byMouse;
|
||||
var skipPermitUnload = aParams.skipPermitUnload;
|
||||
}
|
||||
|
||||
removeTab(aTab, {
|
||||
animate,
|
||||
byMouse,
|
||||
skipPermitUnload,
|
||||
} = {}) {
|
||||
// Telemetry stopwatches may already be running if removeTab gets
|
||||
// called again for an already closing tab.
|
||||
if (!TelemetryStopwatch.running("FX_TAB_CLOSE_TIME_ANIM_MS", aTab) &&
|
||||
|
@ -1,5 +1,5 @@
|
||||
add_task(async function() {
|
||||
Services.prefs.setBoolPref("browser.ctrlTab.previews", true);
|
||||
await SpecialPowers.pushPrefEnv({"set": [["browser.ctrlTab.recentlyUsedOrder", true]]});
|
||||
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.addTab(gBrowser);
|
||||
@ -113,10 +113,6 @@ add_task(async function() {
|
||||
"Ctrl+Tab doesn't change focus if one tab is open");
|
||||
}
|
||||
|
||||
// cleanup
|
||||
if (Services.prefs.prefHasUserValue("browser.ctrlTab.previews"))
|
||||
Services.prefs.clearUserPref("browser.ctrlTab.previews");
|
||||
|
||||
/* private utility functions */
|
||||
|
||||
function pressCtrlTab(aShiftKey) {
|
||||
@ -152,7 +148,8 @@ add_task(async function() {
|
||||
}
|
||||
|
||||
function canOpen() {
|
||||
return Services.prefs.getBoolPref("browser.ctrlTab.previews") && gBrowser.tabs.length > 2;
|
||||
return Services.prefs.getBoolPref("browser.ctrlTab.recentlyUsedOrder") &&
|
||||
gBrowser.tabs.length > 2;
|
||||
}
|
||||
|
||||
function checkTabs(aTabs) {
|
||||
|
@ -12,8 +12,10 @@ add_task(async function test() {
|
||||
let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, testPage2);
|
||||
let tab3 = await BrowserTestUtils.openNewForegroundTab(gBrowser, testPage3);
|
||||
|
||||
// Kill the animation for simpler test.
|
||||
Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", false);
|
||||
await SpecialPowers.pushPrefEnv({"set": [
|
||||
["toolkit.cosmeticAnimations.enabled", false],
|
||||
["browser.ctrlTab.recentlyUsedOrder", false],
|
||||
]});
|
||||
|
||||
gBrowser.selectedTab = tab1;
|
||||
browser1.focus();
|
||||
@ -151,6 +153,4 @@ add_task(async function test() {
|
||||
while (gBrowser.tabs.length > 1) {
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
||||
|
||||
Services.prefs.clearUserPref("toolkit.cosmeticAnimations.enabled");
|
||||
});
|
||||
|
@ -3,7 +3,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
add_task(async function test() {
|
||||
Services.prefs.setBoolPref("browser.ctrlTab.previews", true);
|
||||
await SpecialPowers.pushPrefEnv({"set": [["browser.ctrlTab.recentlyUsedOrder", true]]});
|
||||
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
let tabOne = BrowserTestUtils.addTab(gBrowser);
|
||||
@ -27,9 +27,6 @@ add_task(async function test() {
|
||||
// cleanup
|
||||
gBrowser.removeTab(tabOne);
|
||||
gBrowser.removeTab(tabTwo);
|
||||
|
||||
if (Services.prefs.prefHasUserValue("browser.ctrlTab.previews"))
|
||||
Services.prefs.clearUserPref("browser.ctrlTab.previews");
|
||||
});
|
||||
|
||||
function pressCtrlTab(aShiftKey) {
|
||||
|
@ -30,22 +30,6 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
|
||||
"onxblpopupshown@chrome://global/content/bindings/autocomplete.xml"
|
||||
],
|
||||
maxCount: 5, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
|
||||
"_invalidate/this._adjustHeightTimeout<@chrome://global/content/bindings/autocomplete.xml",
|
||||
],
|
||||
maxCount: 51, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
|
||||
|
@ -30,22 +30,6 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
|
||||
"onxblpopupshown@chrome://global/content/bindings/autocomplete.xml"
|
||||
],
|
||||
maxCount: 5, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
|
||||
"_invalidate/this._adjustHeightTimeout<@chrome://global/content/bindings/autocomplete.xml",
|
||||
],
|
||||
maxCount: 6, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
|
||||
@ -83,22 +67,6 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
|
||||
|
||||
/* These reflows happen everytime the awesomebar panel opens. */
|
||||
const EXPECTED_REFLOWS_SECOND_OPEN = [
|
||||
{
|
||||
stack: [
|
||||
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
|
||||
"onxblpopupshown@chrome://global/content/bindings/autocomplete.xml"
|
||||
],
|
||||
maxCount: 3, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"adjustHeight@chrome://global/content/bindings/autocomplete.xml",
|
||||
"_invalidate/this._adjustHeightTimeout<@chrome://global/content/bindings/autocomplete.xml",
|
||||
],
|
||||
maxCount: 6, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"_handleOverflow@chrome://global/content/bindings/autocomplete.xml",
|
||||
|
@ -1911,6 +1911,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "footer");
|
||||
</field>
|
||||
|
||||
<field name="shrinkDelay" readonly="true">
|
||||
250
|
||||
</field>
|
||||
|
||||
<field name="oneOffSearchButtons" readonly="true">
|
||||
document.getAnonymousElementByAttribute(this, "anonid",
|
||||
"one-off-search-buttons");
|
||||
@ -2195,6 +2199,83 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="adjustHeight">
|
||||
<body>
|
||||
<![CDATA[
|
||||
// If we were going to shrink later, cancel that for now:
|
||||
if (this._shrinkTimeout) {
|
||||
clearTimeout(this._shrinkTimeout);
|
||||
this._shrinkTimeout = null;
|
||||
}
|
||||
let lastRowCount = this._lastRowCount;
|
||||
// Figure out how many rows to show
|
||||
let rows = this.richlistbox.childNodes;
|
||||
this._lastRowCount = rows.length;
|
||||
let numRows = Math.min(this.matchCount, this.maxRows, rows.length);
|
||||
|
||||
// If we're going from 0 to non-0 rows, we might need to remove
|
||||
// the height attribute to allow the popup to size. The attribute
|
||||
// is set from XUL popup management code.
|
||||
if (!lastRowCount && rows.length) {
|
||||
this.removeAttribute("height");
|
||||
}
|
||||
|
||||
// Default the height to 0 if we have no rows to show
|
||||
let height = 0;
|
||||
if (numRows) {
|
||||
if (!this._rowHeight) {
|
||||
window.promiseDocumentFlushed(() => {
|
||||
if (window.closed) {
|
||||
return;
|
||||
}
|
||||
this._rowHeight = rows[0].getBoundingClientRect().height;
|
||||
let style = window.getComputedStyle(this.richlistbox);
|
||||
|
||||
let paddingTop = parseInt(style.paddingTop) || 0;
|
||||
let paddingBottom = parseInt(style.paddingBottom) || 0;
|
||||
this._rlbPadding = paddingTop + paddingBottom;
|
||||
// Then re-run - but don't dirty layout from inside this callback.
|
||||
window.requestAnimationFrame(() => this.adjustHeight());
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate the height to have the first row to last row shown
|
||||
height = (this._rowHeight * numRows) + this._rlbPadding;
|
||||
}
|
||||
|
||||
let animate = this.getAttribute("dontanimate") != "true";
|
||||
let currentHeight =
|
||||
parseFloat(this.richlistbox.getAttribute("height"), 10) ||
|
||||
parseFloat(this.richlistbox.style.height, 10) ||
|
||||
0; // It's possible we get here when we haven't set height on the richlistbox
|
||||
// yet, which means parseFloat will return NaN. It should return 0 instead.
|
||||
if (height > currentHeight) {
|
||||
// Grow immediately.
|
||||
if (animate) {
|
||||
this.richlistbox.removeAttribute("height");
|
||||
this.richlistbox.style.height = height + "px";
|
||||
} else {
|
||||
this.richlistbox.style.removeProperty("height");
|
||||
this.richlistbox.height = height;
|
||||
}
|
||||
} else if (height < currentHeight) { // Don't shrink if height matches exactly
|
||||
// Delay shrinking to avoid flicker.
|
||||
this._shrinkTimeout = setTimeout(() => {
|
||||
this._collapseUnusedItems();
|
||||
if (animate) {
|
||||
this.richlistbox.removeAttribute("height");
|
||||
this.richlistbox.style.height = height + "px";
|
||||
} else {
|
||||
this.richlistbox.style.removeProperty("height");
|
||||
this.richlistbox.height = height;
|
||||
}
|
||||
}, this.shrinkDelay);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_showSearchSuggestionsNotification">
|
||||
<parameter name="whichNotification"/>
|
||||
<parameter name="popupDirection"/>
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = ["AboutPrivateBrowsingHandler"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/RemotePageManager.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var AboutPrivateBrowsingHandler = {
|
||||
_topics: [
|
||||
|
@ -4,9 +4,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource:///modules/CustomizableUI.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
var gManagers = new WeakMap();
|
||||
|
||||
const kPaletteId = "customization-palette";
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = ["ScrollbarSampler"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
var gSystemScrollbarWidth = null;
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
var EXPORTED_SYMBOLS = ["SearchWidgetTracker"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "CustomizableUI",
|
||||
"resource:///modules/CustomizableUI.jsm");
|
||||
|
@ -20,7 +20,6 @@
|
||||
var EXPORTED_SYMBOLS = ["ExtensionControlledPopup"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/ExtensionUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
|
@ -6,10 +6,8 @@
|
||||
var EXPORTED_SYMBOLS = ["ChromeMigrationUtils"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
var ChromeMigrationUtils = {
|
||||
_extensionVersionDirectoryNames: {},
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource:///modules/MigrationUtils.jsm");
|
||||
ChromeUtils.import("resource:///modules/MSMigrationUtils.jsm");
|
||||
|
@ -4,10 +4,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource:///modules/MigrationUtils.jsm");
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "OSCrypto",
|
||||
"resource://gre/modules/OSCrypto.jsm");
|
||||
|
@ -1813,7 +1813,7 @@ BrowserGlue.prototype = {
|
||||
_migrateUI: function BG__migrateUI() {
|
||||
// Use an increasing number to keep track of the current migration state.
|
||||
// Completely unrelated to the current Firefox release number.
|
||||
const UI_VERSION = 69;
|
||||
const UI_VERSION = 70;
|
||||
const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
|
||||
|
||||
let currentUIVersion;
|
||||
@ -2125,6 +2125,17 @@ BrowserGlue.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
if (currentUIVersion < 70) {
|
||||
// Migrate old ctrl-tab pref to new one in existing profiles. (This code
|
||||
// doesn't run at all in new profiles.)
|
||||
Services.prefs.setBoolPref("browser.ctrlTab.recentlyUsedOrder",
|
||||
Services.prefs.getBoolPref("browser.ctrlTab.previews", false));
|
||||
Services.prefs.clearUserPref("browser.ctrlTab.previews");
|
||||
// Remember that we migrated the pref in case we decide to flip it for
|
||||
// these users.
|
||||
Services.prefs.setBoolPref("browser.ctrlTab.migrated", true);
|
||||
}
|
||||
|
||||
// Update the migration version.
|
||||
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
|
||||
},
|
||||
|
@ -143,7 +143,7 @@ Preferences.addAll([
|
||||
{ id: "browser.tabs.warnOnClose", type: "bool" },
|
||||
{ id: "browser.tabs.warnOnOpen", type: "bool" },
|
||||
{ id: "browser.sessionstore.restore_on_demand", type: "bool" },
|
||||
{ id: "browser.ctrlTab.previews", type: "bool" },
|
||||
{ id: "browser.ctrlTab.recentlyUsedOrder", type: "bool" },
|
||||
|
||||
// Fonts
|
||||
{ id: "font.language.group", type: "wstring" },
|
||||
|
@ -77,7 +77,8 @@
|
||||
<caption><label data-l10n-id="tabs-group-header"/></caption>
|
||||
|
||||
<checkbox id="ctrlTabRecentlyUsedOrder" data-l10n-id="ctrl-tab-recently-used-order"
|
||||
preference="browser.ctrlTab.previews"/>
|
||||
preference="browser.ctrlTab.recentlyUsedOrder"
|
||||
oncommand="Services.prefs.clearUserPref('browser.ctrlTab.migrated');"/>
|
||||
|
||||
<checkbox id="linkTargeting" data-l10n-id="open-new-link-as-tabs"
|
||||
preference="browser.link.open_newwindow"
|
||||
|
@ -353,8 +353,8 @@
|
||||
class="learnMore text-link" href="https://www.mozilla.org/dnt"
|
||||
data-l10n-id="do-not-track-learn-more"></label></label>
|
||||
<radiogroup id="doNotTrackRadioGroup" aria-labelledby="doNotTrackDesc" preference="privacy.donottrackheader.enabled">
|
||||
<radio value="false" data-l10n-id="do-not-track-option-default"/>
|
||||
<radio value="true" data-l10n-id="do-not-track-option-always"/>
|
||||
<radio value="false" data-l10n-id="do-not-track-option-default"/>
|
||||
</radiogroup>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["ContentRestore"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "DocShellCapabilities",
|
||||
|
@ -6,9 +6,7 @@ var EXPORTED_SYMBOLS = ["RecentlyClosedTabsAndWindowsMenuUtils"];
|
||||
|
||||
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PluralForm",
|
||||
"resource://gre/modules/PluralForm.jsm");
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = ["SessionCookies"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PrivacyLevel",
|
||||
"resource://gre/modules/sessionstore/PrivacyLevel.jsm");
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = ["SessionStorage"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const ssu = Cc["@mozilla.org/browser/sessionstore/utils;1"]
|
||||
.createInstance(Ci.nsISessionStoreUtils);
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["StartupPerformance"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "setTimeout",
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["TabState"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PrivacyFilter",
|
||||
"resource://gre/modules/sessionstore/PrivacyFilter.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TabStateCache",
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = ["HeadlessShell"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
|
||||
// Refrences to the progress listeners to keep them from being gc'ed
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = [ "BingTranslator" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
ChromeUtils.import("resource://services-common/async.js");
|
||||
ChromeUtils.import("resource://gre/modules/Http.jsm");
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = ["LanguageDetector"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
// Since Emscripten can handle heap growth, but not heap shrinkage, we
|
||||
// need to refresh the worker after we've processed a particularly large
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = [ "TranslationContentHandler" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "LanguageDetector",
|
||||
"resource:///modules/translation/LanguageDetector.jsm");
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = [ "YandexTranslator" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
ChromeUtils.import("resource://services-common/async.js");
|
||||
ChromeUtils.import("resource://gre/modules/Http.jsm");
|
||||
|
@ -7,15 +7,12 @@
|
||||
* the doorhager UI for formautofill related features.
|
||||
*/
|
||||
|
||||
/* exported FormAutofillDoorhanger */
|
||||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["FormAutofillDoorhanger"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://formautofill/FormAutofill.jsm");
|
||||
ChromeUtils.import("resource://formautofill/FormAutofillUtils.jsm");
|
||||
|
||||
|
@ -6,14 +6,11 @@
|
||||
* Defines a handler object to represent forms that autofill can handle.
|
||||
*/
|
||||
|
||||
/* exported FormAutofillHandler */
|
||||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["FormAutofillHandler"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.import("resource://formautofill/FormAutofill.jsm");
|
||||
|
||||
|
@ -18,7 +18,6 @@ const MANAGE_CREDITCARDS_URL = "chrome://formautofill/content/manageCreditCards.
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://formautofill/FormAutofill.jsm");
|
||||
ChromeUtils.import("resource://formautofill/FormAutofillUtils.jsm");
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
var EXPORTED_SYMBOLS = ["AddressesEngine", "CreditCardsEngine"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://services-sync/engines.js");
|
||||
ChromeUtils.import("resource://services-sync/record.js");
|
||||
ChromeUtils.import("resource://services-sync/util.js");
|
||||
|
@ -2,13 +2,10 @@
|
||||
* 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/. */
|
||||
|
||||
/* exported AddressResult, CreditCardResult */
|
||||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["AddressResult", "CreditCardResult"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://formautofill/FormAutofill.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "FormAutofillUtils",
|
||||
|
1
browser/extensions/formautofill/bootstrap.js
vendored
1
browser/extensions/formautofill/bootstrap.js
vendored
@ -126,6 +126,7 @@ function startup(data) {
|
||||
Services.mm.addMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup);
|
||||
|
||||
formAutofillParent.init().catch(Cu.reportError);
|
||||
/* exported FormAutofillContent */
|
||||
Services.ppmm.loadProcessScript("data:,new " + function() {
|
||||
ChromeUtils.import("resource://formautofill/FormAutofillContent.jsm");
|
||||
}, true);
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["PhoneNumber"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "PHONE_NUMBER_META_DATA",
|
||||
"resource://formautofill/phonenumberutils/PhoneNumberMetaData.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "PhoneNumberNormalizer",
|
||||
|
@ -5,7 +5,6 @@
|
||||
"use strict";
|
||||
|
||||
let {FormAutofillParent} = ChromeUtils.import("resource://formautofill/FormAutofillParent.jsm", {});
|
||||
ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm");
|
||||
|
||||
add_task(async function test_activeStatus_init() {
|
||||
let formAutofillParent = new FormAutofillParent();
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
let {FormAutofillParent} = ChromeUtils.import("resource://formautofill/FormAutofillParent.jsm", {});
|
||||
ChromeUtils.import("resource://formautofill/MasterPassword.jsm");
|
||||
ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/CreditCard.jsm");
|
||||
|
||||
const TEST_ADDRESS_1 = {
|
||||
|
@ -5,7 +5,6 @@
|
||||
"use strict";
|
||||
|
||||
let {FormAutofillParent} = ChromeUtils.import("resource://formautofill/FormAutofillParent.jsm", {});
|
||||
ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm");
|
||||
|
||||
add_task(async function test_profileSavedFieldNames_init() {
|
||||
let formAutofillParent = new FormAutofillParent();
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["OnboardingTourType"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Pocket"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "BrowserUtils",
|
||||
|
@ -3,7 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["BlockedSiteContent"];
|
||||
|
@ -13,7 +13,6 @@ var EXPORTED_SYMBOLS = [
|
||||
];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
|
@ -5,9 +5,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["ClickEventHandler"];
|
||||
|
||||
/* eslint no-unused-vars: ["error", {args: "none"}] */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "BlockedSiteContent",
|
||||
|
@ -8,7 +8,6 @@
|
||||
var EXPORTED_SYMBOLS = [ "ContentClick" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PlacesUIUtils",
|
||||
"resource:///modules/PlacesUIUtils.jsm");
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "Feeds" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "BrowserUtils",
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "FormSubmitObserver" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
|
||||
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "FormValidationHandler" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var FormValidationHandler =
|
||||
{
|
||||
_panel: null,
|
||||
|
@ -14,7 +14,6 @@ var EXPORTED_SYMBOLS = [
|
||||
];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
|
@ -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/. */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["PageStyleHandler"];
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "ReaderParent" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "RemotePrompt" ];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "PromptUtils",
|
||||
"resource://gre/modules/SharedPromptUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Windows8WindowFrameColor"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var Registry = ChromeUtils.import("resource://gre/modules/WindowsRegistry.jsm").WindowsRegistry;
|
||||
|
||||
var Windows8WindowFrameColor = {
|
||||
|
@ -800,11 +800,6 @@
|
||||
box-shadow: inset 4px 0 var(--blue-40);
|
||||
}
|
||||
|
||||
.all-tabs-button,
|
||||
.all-tabs-secondary-button {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.all-tabs-secondary-button > label {
|
||||
display: none;
|
||||
margin: 0 5.5px;
|
||||
|
@ -14,7 +14,6 @@ ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Geometry.jsm");
|
||||
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "TestRunner",
|
||||
|
@ -200,6 +200,7 @@ module.exports = {
|
||||
"react/prop-types": "error",
|
||||
"react/sort-comp": ["error", {
|
||||
order: [
|
||||
"static-methods",
|
||||
"lifecycle",
|
||||
"everything-else",
|
||||
"render"
|
||||
|
24
devtools/client/aboutdebugging-new/aboutdebugging.css
Normal file
24
devtools/client/aboutdebugging-new/aboutdebugging.css
Normal file
@ -0,0 +1,24 @@
|
||||
/* 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 "resource://devtools/client/themes/variables.css";
|
||||
@import "resource://devtools/client/aboutdebugging-new/src/components/App.css";
|
||||
@import "resource://devtools/client/aboutdebugging-new/src/components/RuntimesPane.css";
|
||||
@import "resource://devtools/client/aboutdebugging-new/src/components/runtime/RuntimeItem.css";
|
||||
|
||||
:root {
|
||||
--runtime-item-icon-color: var(--grey-30);
|
||||
--runtime-item-selected-color: var(--blue-55);
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
65
devtools/client/aboutdebugging-new/aboutdebugging.js
Normal file
65
devtools/client/aboutdebugging-new/aboutdebugging.js
Normal file
@ -0,0 +1,65 @@
|
||||
/* 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";
|
||||
|
||||
const { BrowserLoader } =
|
||||
ChromeUtils.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
const { require } = BrowserLoader({
|
||||
baseURI: "resource://devtools/client/aboutdebugging-new/",
|
||||
window,
|
||||
});
|
||||
const Services = require("Services");
|
||||
|
||||
const { bindActionCreators } = require("devtools/client/shared/vendor/redux");
|
||||
const { createFactory } =
|
||||
require("devtools/client/shared/vendor/react");
|
||||
const { render, unmountComponentAtNode } =
|
||||
require("devtools/client/shared/vendor/react-dom");
|
||||
const Provider =
|
||||
createFactory(require("devtools/client/shared/vendor/react-redux").Provider);
|
||||
|
||||
const actions = require("./src/actions/index");
|
||||
const { configureStore } = require("./src/create-store");
|
||||
const ThisFirefox = require("./src/runtimes/this-firefox");
|
||||
|
||||
const App = createFactory(require("./src/components/App"));
|
||||
|
||||
const AboutDebugging = {
|
||||
init() {
|
||||
if (!Services.prefs.getBoolPref("devtools.enabled", true)) {
|
||||
// If DevTools are disabled, navigate to about:devtools.
|
||||
window.location = "about:devtools?reason=AboutDebugging";
|
||||
return;
|
||||
}
|
||||
|
||||
this.store = configureStore();
|
||||
this.actions = bindActionCreators(actions, this.store.dispatch);
|
||||
|
||||
const thisFirefox = new ThisFirefox();
|
||||
this.updateSelectedRuntime(thisFirefox);
|
||||
|
||||
render(Provider({ store: this.store }, App({ thisFirefox })), this.mount);
|
||||
},
|
||||
|
||||
destroy() {
|
||||
unmountComponentAtNode(this.mount);
|
||||
},
|
||||
|
||||
get mount() {
|
||||
return document.getElementById("mount");
|
||||
},
|
||||
|
||||
updateSelectedRuntime(runtime) {
|
||||
this.actions.updateSelectedRuntime(runtime);
|
||||
},
|
||||
};
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
AboutDebugging.init();
|
||||
}, { once: true });
|
||||
|
||||
window.addEventListener("unload", () => {
|
||||
AboutDebugging.destroy();
|
||||
}, {once: true});
|
14
devtools/client/aboutdebugging-new/index.html
Normal file
14
devtools/client/aboutdebugging-new/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!-- 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/. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="chrome://devtools/content/aboutdebugging-new/aboutdebugging.css"/>
|
||||
<script src="chrome://devtools/content/aboutdebugging-new/aboutdebugging.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="mount"></div>
|
||||
</body>
|
||||
</html>
|
10
devtools/client/aboutdebugging-new/moz.build
Normal file
10
devtools/client/aboutdebugging-new/moz.build
Normal file
@ -0,0 +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/.
|
||||
|
||||
DIRS += [
|
||||
'src',
|
||||
]
|
||||
|
||||
with Files('**'):
|
||||
BUG_COMPONENT = ('DevTools', 'about:debugging')
|
9
devtools/client/aboutdebugging-new/src/actions/index.js
Normal file
9
devtools/client/aboutdebugging-new/src/actions/index.js
Normal file
@ -0,0 +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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const runtimes = require("./runtimes");
|
||||
|
||||
Object.assign(exports, runtimes);
|
8
devtools/client/aboutdebugging-new/src/actions/moz.build
Normal file
8
devtools/client/aboutdebugging-new/src/actions/moz.build
Normal file
@ -0,0 +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/.
|
||||
|
||||
DevToolsModules(
|
||||
'index.js',
|
||||
'runtimes.js',
|
||||
)
|
20
devtools/client/aboutdebugging-new/src/actions/runtimes.js
Normal file
20
devtools/client/aboutdebugging-new/src/actions/runtimes.js
Normal file
@ -0,0 +1,20 @@
|
||||
/* 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";
|
||||
|
||||
const {
|
||||
UPDATE_SELECTED_RUNTIME,
|
||||
} = require("../constants");
|
||||
|
||||
function updateSelectedRuntime(runtime) {
|
||||
return {
|
||||
type: UPDATE_SELECTED_RUNTIME,
|
||||
runtime,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
updateSelectedRuntime,
|
||||
};
|
10
devtools/client/aboutdebugging-new/src/components/App.css
Normal file
10
devtools/client/aboutdebugging-new/src/components/App.css
Normal file
@ -0,0 +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/. */
|
||||
|
||||
.app {
|
||||
font-size: 15px;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
width: 100vw;
|
||||
}
|
43
devtools/client/aboutdebugging-new/src/components/App.js
Normal file
43
devtools/client/aboutdebugging-new/src/components/App.js
Normal file
@ -0,0 +1,43 @@
|
||||
/* 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";
|
||||
|
||||
const { connect } = require("devtools/client/shared/vendor/react-redux");
|
||||
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
|
||||
const dom = require("devtools/client/shared/vendor/react-dom-factories");
|
||||
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
|
||||
|
||||
const Runtime = require("../runtimes/runtime");
|
||||
const ThisFirefox = require("../runtimes/this-firefox");
|
||||
|
||||
const RuntimesPane = createFactory(require("./RuntimesPane"));
|
||||
|
||||
class App extends PureComponent {
|
||||
static get propTypes() {
|
||||
return {
|
||||
selectedRuntime: PropTypes.instanceOf(Runtime),
|
||||
thisFirefox: PropTypes.instanceOf(ThisFirefox).isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { selectedRuntime, thisFirefox } = this.props;
|
||||
|
||||
return dom.div(
|
||||
{
|
||||
className: "app",
|
||||
},
|
||||
RuntimesPane({ selectedRuntime, thisFirefox })
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
selectedRuntime: state.runtimes.selectedRuntime,
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = connect(mapStateToProps)(App);
|
@ -0,0 +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/. */
|
||||
|
||||
.runtimes-pane {
|
||||
margin-block-start: 70px;
|
||||
width: 240px;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/* 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";
|
||||
|
||||
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
|
||||
const dom = require("devtools/client/shared/vendor/react-dom-factories");
|
||||
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
|
||||
|
||||
const ThisFirefox = require("../runtimes/this-firefox");
|
||||
|
||||
const Runtime = require("../runtimes/runtime");
|
||||
const RuntimeItem = createFactory(require("./runtime/RuntimeItem"));
|
||||
|
||||
class RuntimesPane extends PureComponent {
|
||||
static get propTypes() {
|
||||
return {
|
||||
selectedRuntime: PropTypes.instanceOf(Runtime),
|
||||
thisFirefox: PropTypes.instanceOf(ThisFirefox).isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { selectedRuntime, thisFirefox } = this.props;
|
||||
|
||||
return dom.section(
|
||||
{
|
||||
className: "runtimes-pane",
|
||||
},
|
||||
dom.ul(
|
||||
{},
|
||||
RuntimeItem({
|
||||
icon: thisFirefox.getIcon(),
|
||||
isSelected: thisFirefox === selectedRuntime,
|
||||
name: thisFirefox.getName(),
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RuntimesPane;
|
14
devtools/client/aboutdebugging-new/src/components/moz.build
Normal file
14
devtools/client/aboutdebugging-new/src/components/moz.build
Normal file
@ -0,0 +1,14 @@
|
||||
# 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/.
|
||||
|
||||
DIRS += [
|
||||
'runtime',
|
||||
]
|
||||
|
||||
DevToolsModules(
|
||||
'App.css',
|
||||
'App.js',
|
||||
'RuntimesPane.css',
|
||||
'RuntimesPane.js'
|
||||
)
|
@ -0,0 +1,26 @@
|
||||
/* 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/. */
|
||||
|
||||
.runtime-item {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: 20px;
|
||||
margin-inline-start: 24px;
|
||||
}
|
||||
|
||||
.runtime-item__icon {
|
||||
fill: var(--runtime-item-icon-color);
|
||||
height: 24px;
|
||||
margin-inline-end: 9px;
|
||||
width: 24px;
|
||||
-moz-context-properties: fill;
|
||||
}
|
||||
|
||||
.runtime-item--selected {
|
||||
color: var(--runtime-item-selected-color);
|
||||
}
|
||||
|
||||
.runtime-item__icon--selected {
|
||||
fill: var(--runtime-item-selected-color);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/* 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";
|
||||
|
||||
const { PureComponent } = require("devtools/client/shared/vendor/react");
|
||||
const dom = require("devtools/client/shared/vendor/react-dom-factories");
|
||||
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
|
||||
|
||||
/**
|
||||
* This component shows the runtime as item in RuntimesPane.
|
||||
*/
|
||||
class RuntimeItem extends PureComponent {
|
||||
static get propTypes() {
|
||||
return {
|
||||
icon: PropTypes.string.isRequired,
|
||||
isSelected: PropTypes.bool.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { icon, isSelected, name } = this.props;
|
||||
|
||||
return dom.li(
|
||||
{
|
||||
className: "runtime-item" + (isSelected ? " runtime-item--selected" : ""),
|
||||
},
|
||||
dom.img({
|
||||
className: "runtime-item__icon" +
|
||||
(isSelected ? " runtime-item__icon--selected" : ""),
|
||||
src: icon,
|
||||
}),
|
||||
name
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RuntimeItem;
|
@ -0,0 +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/.
|
||||
|
||||
DevToolsModules(
|
||||
'RuntimeItem.css',
|
||||
'RuntimeItem.js',
|
||||
)
|
11
devtools/client/aboutdebugging-new/src/constants.js
Normal file
11
devtools/client/aboutdebugging-new/src/constants.js
Normal file
@ -0,0 +1,11 @@
|
||||
/* 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";
|
||||
|
||||
const actionTypes = {
|
||||
UPDATE_SELECTED_RUNTIME: "UPDATE_SELECTED_RUNTIME",
|
||||
};
|
||||
|
||||
module.exports = Object.assign({}, actionTypes);
|
18
devtools/client/aboutdebugging-new/src/create-store.js
Normal file
18
devtools/client/aboutdebugging-new/src/create-store.js
Normal file
@ -0,0 +1,18 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { createStore } = require("devtools/client/shared/vendor/redux");
|
||||
|
||||
const rootReducer = require("./reducers/index");
|
||||
const { RuntimesState } = require("./reducers/runtimes-state");
|
||||
|
||||
exports.configureStore = function() {
|
||||
const initialState = {
|
||||
runtimes: new RuntimesState(),
|
||||
};
|
||||
|
||||
return createStore(rootReducer, initialState);
|
||||
};
|
15
devtools/client/aboutdebugging-new/src/moz.build
Normal file
15
devtools/client/aboutdebugging-new/src/moz.build
Normal file
@ -0,0 +1,15 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DIRS += [
|
||||
'actions',
|
||||
'components',
|
||||
'runtimes',
|
||||
'reducers',
|
||||
]
|
||||
|
||||
DevToolsModules(
|
||||
'constants.js',
|
||||
'create-store.js'
|
||||
)
|
12
devtools/client/aboutdebugging-new/src/reducers/index.js
Normal file
12
devtools/client/aboutdebugging-new/src/reducers/index.js
Normal file
@ -0,0 +1,12 @@
|
||||
/* 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";
|
||||
|
||||
const { combineReducers } = require("devtools/client/shared/vendor/redux");
|
||||
const { runtimesReducer } = require("./runtimes-state");
|
||||
|
||||
module.exports = combineReducers({
|
||||
runtimes: runtimesReducer,
|
||||
});
|
@ -0,0 +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/.
|
||||
|
||||
DevToolsModules(
|
||||
'index.js',
|
||||
'runtimes-state.js',
|
||||
)
|
@ -0,0 +1,33 @@
|
||||
/* 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";
|
||||
|
||||
const {
|
||||
UPDATE_SELECTED_RUNTIME,
|
||||
} = require("../constants");
|
||||
|
||||
function RuntimesState() {
|
||||
return {
|
||||
selectedRuntime: null,
|
||||
};
|
||||
}
|
||||
|
||||
function runtimesReducer(state = RuntimesState(), action) {
|
||||
switch (action.type) {
|
||||
case UPDATE_SELECTED_RUNTIME: {
|
||||
return Object.assign({}, state, {
|
||||
selectedRuntime: action.runtime,
|
||||
});
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
RuntimesState,
|
||||
runtimesReducer,
|
||||
};
|
@ -0,0 +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/.
|
||||
|
||||
DevToolsModules(
|
||||
'runtime.js',
|
||||
'this-firefox.js',
|
||||
)
|
30
devtools/client/aboutdebugging-new/src/runtimes/runtime.js
Normal file
30
devtools/client/aboutdebugging-new/src/runtimes/runtime.js
Normal file
@ -0,0 +1,30 @@
|
||||
/* 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";
|
||||
|
||||
/**
|
||||
* This class represents a runtime, such as a remote Firefox.
|
||||
*/
|
||||
class Runtime {
|
||||
/**
|
||||
* Return icon of this runtime on sidebar.
|
||||
* Subclass should override this method.
|
||||
* @return {String}
|
||||
*/
|
||||
getIcon() {
|
||||
throw new Error("Subclass of Runtime should override getIcon()");
|
||||
}
|
||||
|
||||
/**
|
||||
* Return name of this runtime on sidebar.
|
||||
* Subclass should override this method.
|
||||
* @return {String}
|
||||
*/
|
||||
getName() {
|
||||
throw new Error("Subclass of Runtime should override getName()");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Runtime;
|
@ -0,0 +1,23 @@
|
||||
/* 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";
|
||||
|
||||
const Runtime = require("./runtime");
|
||||
|
||||
/**
|
||||
* This class represents the Firefox instance which runs in the same environment that
|
||||
* opened about:debugging.
|
||||
*/
|
||||
class ThisFirefox extends Runtime {
|
||||
getIcon() {
|
||||
return "chrome://devtools/skin/images/firefox-logo-glyph.svg";
|
||||
}
|
||||
|
||||
getName() {
|
||||
return "This Firefox";
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ThisFirefox;
|
@ -400,7 +400,6 @@ skip-if = (e10s && debug) || (os == 'linux' && bits == 32 && debug) # bug 132891
|
||||
uses-unsafe-cpows = true
|
||||
skip-if = e10s && debug
|
||||
[browser_dbg_target-scoped-actor-01.js]
|
||||
skip-if = e10s # TODO
|
||||
[browser_dbg_target-scoped-actor-02.js]
|
||||
skip-if = e10s # TODO
|
||||
[browser_dbg_terminate-on-tab-close.js]
|
||||
|
@ -10,58 +10,35 @@
|
||||
const ACTORS_URL = CHROME_URL + "testactors.js";
|
||||
const TAB_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
|
||||
|
||||
var gClient;
|
||||
add_task(async function test() {
|
||||
await addTab(TAB_URL);
|
||||
|
||||
function test() {
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.registerAllActors();
|
||||
|
||||
DebuggerServer.registerModule(ACTORS_URL, {
|
||||
await registerActorInContentProcess(ACTORS_URL, {
|
||||
prefix: "testOne",
|
||||
constructor: "TestActor1",
|
||||
type: { target: true },
|
||||
});
|
||||
|
||||
let transport = DebuggerServer.connectPipe();
|
||||
gClient = new DebuggerClient(transport);
|
||||
gClient.connect().then(([aType, aTraits]) => {
|
||||
is(aType, "browser",
|
||||
"Root actor should identify itself as a browser.");
|
||||
const transport = DebuggerServer.connectPipe();
|
||||
const client = new DebuggerClient(transport);
|
||||
const [ type ] = await client.connect();
|
||||
is(type, "browser", "Root actor should identify itself as a browser.");
|
||||
|
||||
addTab(TAB_URL)
|
||||
.then(() => attachTargetActorForUrl(gClient, TAB_URL))
|
||||
.then(testTargetScopedActor)
|
||||
.then(closeTab)
|
||||
.then(() => gClient.close())
|
||||
.then(finish)
|
||||
.catch(aError => {
|
||||
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
|
||||
});
|
||||
});
|
||||
}
|
||||
const [ grip ] = await attachTargetActorForUrl(client, TAB_URL);
|
||||
await testTargetScopedActor(client, grip);
|
||||
await removeTab(gBrowser.selectedTab);
|
||||
await client.close();
|
||||
});
|
||||
|
||||
function testTargetScopedActor([aGrip, aResponse]) {
|
||||
let deferred = promise.defer();
|
||||
|
||||
ok(aGrip.testOneActor,
|
||||
async function testTargetScopedActor(client, grip) {
|
||||
ok(grip.testOneActor,
|
||||
"Found the test target-scoped actor.");
|
||||
ok(aGrip.testOneActor.includes("testOne"),
|
||||
ok(grip.testOneActor.includes("testOne"),
|
||||
"testOneActor's actorPrefix should be used.");
|
||||
|
||||
gClient.request({ to: aGrip.testOneActor, type: "ping" }, aResponse => {
|
||||
is(aResponse.pong, "pong",
|
||||
"Actor should respond to requests.");
|
||||
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
const response = await client.request({ to: grip.testOneActor, type: "ping" });
|
||||
is(response.pong, "pong", "Actor should respond to requests.");
|
||||
}
|
||||
|
||||
function closeTab() {
|
||||
return removeTab(gBrowser.selectedTab);
|
||||
}
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
gClient = null;
|
||||
});
|
||||
|
@ -179,6 +179,7 @@ subsuite = clipboard
|
||||
[browser_markup_shadowdom_noslot.js]
|
||||
[browser_markup_shadowdom_open_debugger.js]
|
||||
[browser_markup_shadowdom_shadowroot_mode.js]
|
||||
[browser_markup_shadowdom_show_nodes_button.js]
|
||||
[browser_markup_shadowdom_slotupdate.js]
|
||||
[browser_markup_tag_delete_whitespace_node.js]
|
||||
[browser_markup_tag_edit_01.js]
|
||||
|
@ -0,0 +1,52 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that the "Show all 'N' nodes" button displays the proper value
|
||||
|
||||
const NODE_COUNT = 101;
|
||||
const TEST_URL = `data:text/html;charset=utf-8,
|
||||
<test-component>
|
||||
</test-component>
|
||||
|
||||
<script>
|
||||
'use strict';
|
||||
for (let i = 0; i < ${NODE_COUNT}; i++) {
|
||||
const div = document.createElement("div");
|
||||
div.innerHTML = i;
|
||||
document.querySelector('test-component').appendChild(div);
|
||||
}
|
||||
customElements.define('test-component', class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
let shadowRoot = this.attachShadow({mode: 'open'});
|
||||
shadowRoot.innerHTML = '<slot></slot>';
|
||||
}
|
||||
});
|
||||
</script>`;
|
||||
|
||||
add_task(async function() {
|
||||
await enableWebComponents();
|
||||
|
||||
const { inspector } = await openInspectorForURL(TEST_URL);
|
||||
const { markup } = inspector;
|
||||
|
||||
info("Find and expand the component shadow DOM host.");
|
||||
const hostFront = await getNodeFront("test-component", inspector);
|
||||
const hostContainer = markup.getContainer(hostFront);
|
||||
await expandContainer(inspector, hostContainer);
|
||||
const shadowRootContainer = hostContainer.getChildContainers()[0];
|
||||
await expandContainer(inspector, shadowRootContainer);
|
||||
|
||||
info("Expand the slot");
|
||||
const slotContainer = shadowRootContainer.getChildContainers()[0];
|
||||
await expandContainer(inspector, slotContainer);
|
||||
|
||||
info("Find the 'Show all nodes' button");
|
||||
const button = slotContainer.elt.querySelector("button");
|
||||
console.log(button);
|
||||
ok(button.innerText.includes(NODE_COUNT),
|
||||
"'Show all nodes' button contains correct node count");
|
||||
});
|
||||
|
@ -88,6 +88,9 @@ devtools.jar:
|
||||
content/shared/widgets/spectrum.css (shared/widgets/spectrum.css)
|
||||
content/aboutdebugging/aboutdebugging.xhtml (aboutdebugging/aboutdebugging.xhtml)
|
||||
content/aboutdebugging/aboutdebugging.css (aboutdebugging/aboutdebugging.css)
|
||||
content/aboutdebugging-new/index.html (aboutdebugging-new/index.html)
|
||||
content/aboutdebugging-new/aboutdebugging.css (aboutdebugging-new/aboutdebugging.css)
|
||||
content/aboutdebugging-new/aboutdebugging.js (aboutdebugging-new/aboutdebugging.js)
|
||||
content/responsive.html/index.xhtml (responsive.html/index.xhtml)
|
||||
content/dom/index.html (dom/index.html)
|
||||
content/dom/main.js (dom/main.js)
|
||||
@ -105,6 +108,7 @@ devtools.jar:
|
||||
skin/images/breadcrumbs-divider.svg (themes/images/breadcrumbs-divider.svg)
|
||||
skin/images/filters.svg (themes/images/filters.svg)
|
||||
skin/images/filter-swatch.svg (themes/images/filter-swatch.svg)
|
||||
skin/images/firefox-logo-glyph.svg (themes/images/firefox-logo-glyph.svg)
|
||||
skin/images/fox-smiling.svg (themes/images/fox-smiling.svg)
|
||||
skin/images/grid.svg (themes/images/grid.svg)
|
||||
skin/images/angle-swatch.svg (themes/images/angle-swatch.svg)
|
||||
|
@ -55,7 +55,21 @@ const { app: appModel } = require("./models");
|
||||
|
||||
class MemoryApp extends Component {
|
||||
static get propTypes() {
|
||||
return appModel;
|
||||
return {
|
||||
allocations: appModel.allocations,
|
||||
censusDisplay: appModel.censusDisplay,
|
||||
diffing: appModel.diffing,
|
||||
dispatch: appModel.dispatch,
|
||||
filter: appModel.filter,
|
||||
front: appModel.front,
|
||||
heapWorker: appModel.heapWorker,
|
||||
individuals: appModel.individuals,
|
||||
labelDisplay: appModel.labelDisplay,
|
||||
sizes: appModel.sizes,
|
||||
snapshots: appModel.snapshots,
|
||||
toolbox: appModel.toolbox,
|
||||
view: appModel.view,
|
||||
};
|
||||
}
|
||||
|
||||
static get childContextTypes() {
|
||||
|
@ -8,6 +8,7 @@ include('../templates.mozbuild')
|
||||
|
||||
DIRS += [
|
||||
'aboutdebugging',
|
||||
'aboutdebugging-new',
|
||||
'accessibility',
|
||||
'application',
|
||||
'canvasdebugger',
|
||||
|
@ -313,6 +313,9 @@ pref("devtools.responsive.reloadConditions.userAgent", false);
|
||||
// Whether to show the notification about reloading to apply emulation
|
||||
pref("devtools.responsive.reloadNotification.enabled", true);
|
||||
|
||||
// Enable new about:debugging.
|
||||
pref("devtools.aboutdebugging.new-enabled", false);
|
||||
|
||||
// about:debugging: only show system add-ons in local builds by default.
|
||||
#ifdef MOZILLA_OFFICIAL
|
||||
pref("devtools.aboutdebugging.showSystemAddons", false);
|
||||
|
@ -134,51 +134,6 @@ define(function(require, exports, module) {
|
||||
return defaultProps;
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
expandedNodes: props.expandedNodes,
|
||||
columns: ensureDefaultColumn(props.columns),
|
||||
selected: props.selected,
|
||||
lastSelectedIndex: 0
|
||||
};
|
||||
|
||||
this.toggle = this.toggle.bind(this);
|
||||
this.isExpanded = this.isExpanded.bind(this);
|
||||
this.onKeyDown = this.onKeyDown.bind(this);
|
||||
this.onClickRow = this.onClickRow.bind(this);
|
||||
this.getSelectedRow = this.getSelectedRow.bind(this);
|
||||
this.selectRow = this.selectRow.bind(this);
|
||||
this.isSelected = this.isSelected.bind(this);
|
||||
this.onFilter = this.onFilter.bind(this);
|
||||
this.onSort = this.onSort.bind(this);
|
||||
this.getMembers = this.getMembers.bind(this);
|
||||
this.renderRows = this.renderRows.bind(this);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { expandedNodes, selected } = nextProps;
|
||||
const state = {
|
||||
expandedNodes,
|
||||
lastSelectedIndex: this.getSelectedRowIndex()
|
||||
};
|
||||
|
||||
if (selected) {
|
||||
state.selected = selected;
|
||||
}
|
||||
|
||||
this.setState(Object.assign({}, this.state, state));
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const selected = this.getSelectedRow();
|
||||
if (!selected && this.rows.length > 0) {
|
||||
this.selectRow(this.rows[
|
||||
Math.min(this.state.lastSelectedIndex, this.rows.length - 1)]);
|
||||
}
|
||||
}
|
||||
|
||||
static subPath(path, subKey) {
|
||||
return path + "/" + String(subKey).replace(/[\\/]/g, "\\$&");
|
||||
}
|
||||
@ -226,6 +181,51 @@ define(function(require, exports, module) {
|
||||
return expandedNodes;
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
expandedNodes: props.expandedNodes,
|
||||
columns: ensureDefaultColumn(props.columns),
|
||||
selected: props.selected,
|
||||
lastSelectedIndex: 0
|
||||
};
|
||||
|
||||
this.toggle = this.toggle.bind(this);
|
||||
this.isExpanded = this.isExpanded.bind(this);
|
||||
this.onKeyDown = this.onKeyDown.bind(this);
|
||||
this.onClickRow = this.onClickRow.bind(this);
|
||||
this.getSelectedRow = this.getSelectedRow.bind(this);
|
||||
this.selectRow = this.selectRow.bind(this);
|
||||
this.isSelected = this.isSelected.bind(this);
|
||||
this.onFilter = this.onFilter.bind(this);
|
||||
this.onSort = this.onSort.bind(this);
|
||||
this.getMembers = this.getMembers.bind(this);
|
||||
this.renderRows = this.renderRows.bind(this);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { expandedNodes, selected } = nextProps;
|
||||
const state = {
|
||||
expandedNodes,
|
||||
lastSelectedIndex: this.getSelectedRowIndex()
|
||||
};
|
||||
|
||||
if (selected) {
|
||||
state.selected = selected;
|
||||
}
|
||||
|
||||
this.setState(Object.assign({}, this.state, state));
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const selected = this.getSelectedRow();
|
||||
if (!selected && this.rows.length > 0) {
|
||||
this.selectRow(this.rows[
|
||||
Math.min(this.state.lastSelectedIndex, this.rows.length - 1)]);
|
||||
}
|
||||
}
|
||||
|
||||
// Node expand/collapse
|
||||
|
||||
toggle(nodePath) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user