зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 701d67d48f5d (bug 1479050) for xpcshell failures on test_VariablesView_filtering-without-controller.js. CLOSED TREE
This commit is contained in:
Родитель
ffa75bd086
Коммит
674efd0cee
|
@ -134,15 +134,15 @@ var gXPInstallObserver = {
|
|||
addonList.firstChild.remove();
|
||||
|
||||
for (let install of installInfo.installs) {
|
||||
let container = document.createXULElement("hbox");
|
||||
let container = document.createElement("hbox");
|
||||
|
||||
let name = document.createXULElement("label");
|
||||
let name = document.createElement("label");
|
||||
name.setAttribute("value", install.addon.name);
|
||||
name.setAttribute("class", "addon-install-confirmation-name");
|
||||
container.appendChild(name);
|
||||
|
||||
if (someUnsigned && install.addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
|
||||
let unsignedLabel = document.createXULElement("label");
|
||||
let unsignedLabel = document.createElement("label");
|
||||
unsignedLabel.setAttribute("value",
|
||||
gNavigatorBundle.getString("addonInstall.unsigned"));
|
||||
unsignedLabel.setAttribute("class",
|
||||
|
@ -483,7 +483,7 @@ var gExtensionsNotifications = {
|
|||
},
|
||||
|
||||
_createAddonButton(text, icon, callback) {
|
||||
let button = document.createXULElement("toolbarbutton");
|
||||
let button = document.createElement("toolbarbutton");
|
||||
button.setAttribute("label", text);
|
||||
button.setAttribute("tooltiptext", text);
|
||||
const DEFAULT_EXTENSION_ICON =
|
||||
|
|
|
@ -75,7 +75,7 @@ var gTabsPanel = {
|
|||
let frag = document.createDocumentFragment();
|
||||
|
||||
ContextualIdentityService.getPublicIdentities().forEach(identity => {
|
||||
let menuitem = document.createXULElement("toolbarbutton");
|
||||
let menuitem = document.createElement("toolbarbutton");
|
||||
menuitem.setAttribute("class", "subviewbutton subviewbutton-iconic");
|
||||
menuitem.setAttribute("label", ContextualIdentityService.getUserContextLabel(identity.userContextId));
|
||||
// The styles depend on this.
|
||||
|
|
|
@ -236,7 +236,7 @@ var ctrlTab = {
|
|||
},
|
||||
|
||||
makePreview: function ctrlTab_makePreview(aIsShowAllButton) {
|
||||
let preview = document.createXULElement("button");
|
||||
let preview = document.createElement("button");
|
||||
preview.setAttribute("class", "ctrlTab-preview");
|
||||
preview.setAttribute("pack", "center");
|
||||
if (!aIsShowAllButton) {
|
||||
|
@ -253,7 +253,7 @@ var ctrlTab = {
|
|||
}
|
||||
});
|
||||
|
||||
let previewInner = document.createXULElement("vbox");
|
||||
let previewInner = document.createElement("vbox");
|
||||
previewInner.setAttribute("class", "ctrlTab-preview-inner");
|
||||
preview.appendChild(previewInner);
|
||||
|
||||
|
@ -261,7 +261,7 @@ var ctrlTab = {
|
|||
let canvasWidth = this.canvasWidth;
|
||||
let canvasHeight = this.canvasHeight;
|
||||
|
||||
let canvas = preview._canvas = document.createXULElement("hbox");
|
||||
let canvas = preview._canvas = document.createElement("hbox");
|
||||
canvas.setAttribute("class", "ctrlTab-canvas");
|
||||
canvas.setAttribute("width", canvasWidth);
|
||||
canvas.style.minWidth = canvasWidth + "px";
|
||||
|
@ -270,16 +270,16 @@ var ctrlTab = {
|
|||
canvas.style.maxHeight = canvasHeight + "px";
|
||||
previewInner.appendChild(canvas);
|
||||
|
||||
let faviconContainer = document.createXULElement("hbox");
|
||||
let faviconContainer = document.createElement("hbox");
|
||||
faviconContainer.setAttribute("class", "ctrlTab-favicon-container");
|
||||
previewInner.appendChild(faviconContainer);
|
||||
|
||||
let favicon = preview._favicon = document.createXULElement("image");
|
||||
let favicon = preview._favicon = document.createElement("image");
|
||||
favicon.setAttribute("class", "ctrlTab-favicon");
|
||||
faviconContainer.appendChild(favicon);
|
||||
}
|
||||
|
||||
let label = preview._label = document.createXULElement("label");
|
||||
let label = preview._label = document.createElement("label");
|
||||
label.setAttribute("class", "ctrlTab-label plain");
|
||||
label.setAttribute("crop", "end");
|
||||
previewInner.appendChild(label);
|
||||
|
|
|
@ -24,13 +24,13 @@ var DevelopmentHelpers = {
|
|||
},
|
||||
|
||||
addRestartShortcut() {
|
||||
let command = document.createXULElement("command");
|
||||
let command = document.createElement("command");
|
||||
command.setAttribute("id", "cmd_quickRestart");
|
||||
command.addEventListener("command", this.quickRestart, true);
|
||||
command.setAttribute("oncommand", "void 0;"); // Needed - bug 371900
|
||||
document.getElementById("mainCommandSet").prepend(command);
|
||||
|
||||
let key = document.createXULElement("key");
|
||||
let key = document.createElement("key");
|
||||
key.setAttribute("id", "key_quickRestart");
|
||||
key.setAttribute("key", "r");
|
||||
key.setAttribute("modifiers", "accel,alt");
|
||||
|
@ -38,7 +38,7 @@ var DevelopmentHelpers = {
|
|||
key.setAttribute("oncommand", "void 0;"); // Needed - bug 371900
|
||||
document.getElementById("mainKeyset").prepend(key);
|
||||
|
||||
let menuitem = document.createXULElement("menuitem");
|
||||
let menuitem = document.createElement("menuitem");
|
||||
menuitem.setAttribute("id", "menu_FileRestartItem");
|
||||
menuitem.setAttribute("key", "key_quickRestart");
|
||||
menuitem.setAttribute("label", "Restart (Developer)");
|
||||
|
|
|
@ -38,7 +38,7 @@ var gEMEHandler = {
|
|||
let mainMessage = gNavigatorBundle.getString("emeNotifications.drmContentDisabled.message");
|
||||
let text = gNavigatorBundle.getString("emeNotifications.drmContentDisabled.learnMoreLabel");
|
||||
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
|
||||
let link = document.createXULElement("label");
|
||||
let link = document.createElement("label");
|
||||
link.className = "text-link";
|
||||
link.setAttribute("href", baseURL + "drm-content");
|
||||
link.textContent = text;
|
||||
|
|
|
@ -230,10 +230,10 @@ var BrowserPageActions = {
|
|||
|
||||
_makePanelButtonNodeForAction(action) {
|
||||
if (action.__isSeparator) {
|
||||
let node = document.createXULElement("toolbarseparator");
|
||||
let node = document.createElement("toolbarseparator");
|
||||
return node;
|
||||
}
|
||||
let buttonNode = document.createXULElement("toolbarbutton");
|
||||
let buttonNode = document.createElement("toolbarbutton");
|
||||
buttonNode.classList.add(
|
||||
"subviewbutton",
|
||||
"subviewbutton-iconic",
|
||||
|
@ -252,10 +252,10 @@ var BrowserPageActions = {
|
|||
},
|
||||
|
||||
_makePanelViewNodeForAction(action, forUrlbar) {
|
||||
let panelViewNode = document.createXULElement("panelview");
|
||||
let panelViewNode = document.createElement("panelview");
|
||||
panelViewNode.id = this._panelViewNodeIDForActionID(action.id, forUrlbar);
|
||||
panelViewNode.classList.add("PanelUI-subView");
|
||||
let bodyNode = document.createXULElement("vbox");
|
||||
let bodyNode = document.createElement("vbox");
|
||||
bodyNode.id = panelViewNode.id + "-body";
|
||||
bodyNode.classList.add("panel-subview-body");
|
||||
panelViewNode.appendChild(bodyNode);
|
||||
|
@ -308,7 +308,7 @@ var BrowserPageActions = {
|
|||
},
|
||||
|
||||
_makeActivatedActionPanelForAction(action) {
|
||||
let panelNode = document.createXULElement("panel");
|
||||
let panelNode = document.createElement("panel");
|
||||
panelNode.id = this._activatedActionPanelID;
|
||||
panelNode.classList.add("cui-widget-panel");
|
||||
panelNode.setAttribute("actionID", action.id);
|
||||
|
@ -323,13 +323,13 @@ var BrowserPageActions = {
|
|||
let iframeNode = null;
|
||||
|
||||
if (action.getWantsSubview(window)) {
|
||||
let multiViewNode = document.createXULElement("panelmultiview");
|
||||
let multiViewNode = document.createElement("panelmultiview");
|
||||
panelViewNode = this._makePanelViewNodeForAction(action, true);
|
||||
multiViewNode.setAttribute("mainViewId", panelViewNode.id);
|
||||
multiViewNode.appendChild(panelViewNode);
|
||||
panelNode.appendChild(multiViewNode);
|
||||
} else if (action.wantsIframe) {
|
||||
iframeNode = document.createXULElement("iframe");
|
||||
iframeNode = document.createElement("iframe");
|
||||
iframeNode.setAttribute("type", "content");
|
||||
panelNode.appendChild(iframeNode);
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ var BrowserPageActions = {
|
|||
},
|
||||
|
||||
_makeUrlbarButtonNode(action) {
|
||||
let buttonNode = document.createXULElement("image");
|
||||
let buttonNode = document.createElement("image");
|
||||
buttonNode.classList.add("urlbar-icon", "urlbar-page-action");
|
||||
buttonNode.setAttribute("actionid", action.id);
|
||||
buttonNode.setAttribute("role", "button");
|
||||
|
@ -1014,7 +1014,7 @@ BrowserPageActions.sendToDevice = {
|
|||
|
||||
onSubviewPlaced(panelViewNode) {
|
||||
let bodyNode = panelViewNode.querySelector(".panel-subview-body");
|
||||
let notReady = document.createXULElement("toolbarbutton");
|
||||
let notReady = document.createElement("toolbarbutton");
|
||||
notReady.classList.add(
|
||||
"subviewbutton",
|
||||
"subviewbutton-iconic",
|
||||
|
@ -1048,9 +1048,9 @@ BrowserPageActions.sendToDevice = {
|
|||
// changes.
|
||||
gSync.populateSendTabToDevicesMenu(bodyNode, url, title, (clientId, name, clientType, lastModified) => {
|
||||
if (!name) {
|
||||
return document.createXULElement("toolbarseparator");
|
||||
return document.createElement("toolbarseparator");
|
||||
}
|
||||
let item = document.createXULElement("toolbarbutton");
|
||||
let item = document.createElement("toolbarbutton");
|
||||
item.classList.add("pageAction-sendToDevice-device", "subviewbutton");
|
||||
if (clientId) {
|
||||
item.classList.add("subviewbutton-iconic");
|
||||
|
@ -1141,7 +1141,7 @@ BrowserPageActions.addSearchEngine = {
|
|||
body.firstChild.remove();
|
||||
}
|
||||
for (let engine of this.engines) {
|
||||
let button = document.createXULElement("toolbarbutton");
|
||||
let button = document.createElement("toolbarbutton");
|
||||
button.classList.add("subviewbutton", "subviewbutton-iconic");
|
||||
button.setAttribute("label", engine.title);
|
||||
button.setAttribute("image", engine.icon);
|
||||
|
@ -1241,7 +1241,7 @@ BrowserPageActions.shareURL = {
|
|||
};
|
||||
|
||||
shareProviders.forEach(function(share) {
|
||||
let item = document.createXULElement("toolbarbutton");
|
||||
let item = document.createElement("toolbarbutton");
|
||||
item.setAttribute("label", share.menuItemTitle);
|
||||
item.setAttribute("share-name", share.name);
|
||||
item.setAttribute("image", share.image);
|
||||
|
|
|
@ -976,12 +976,12 @@ var gIdentityHandler = {
|
|||
},
|
||||
|
||||
_createPermissionItem(aPermission) {
|
||||
let container = document.createXULElement("hbox");
|
||||
let container = document.createElement("hbox");
|
||||
container.setAttribute("class", "identity-popup-permission-item");
|
||||
container.setAttribute("align", "center");
|
||||
container.setAttribute("role", "group");
|
||||
|
||||
let img = document.createXULElement("image");
|
||||
let img = document.createElement("image");
|
||||
img.classList.add("identity-popup-permission-icon");
|
||||
if (aPermission.id == "plugin:flash") {
|
||||
img.classList.add("plugin-icon");
|
||||
|
@ -1008,7 +1008,7 @@ var gIdentityHandler = {
|
|||
});
|
||||
}
|
||||
|
||||
let nameLabel = document.createXULElement("label");
|
||||
let nameLabel = document.createElement("label");
|
||||
nameLabel.setAttribute("flex", "1");
|
||||
nameLabel.setAttribute("class", "identity-popup-permission-label");
|
||||
nameLabel.textContent = SitePermissions.getPermissionLabel(aPermission.id);
|
||||
|
@ -1018,16 +1018,16 @@ var gIdentityHandler = {
|
|||
let isPolicyPermission = aPermission.scope == SitePermissions.SCOPE_POLICY;
|
||||
|
||||
if (aPermission.id == "popup" && !isPolicyPermission) {
|
||||
let menulist = document.createXULElement("menulist");
|
||||
let menupopup = document.createXULElement("menupopup");
|
||||
let block = document.createXULElement("vbox");
|
||||
let menulist = document.createElement("menulist");
|
||||
let menupopup = document.createElement("menupopup");
|
||||
let block = document.createElement("vbox");
|
||||
block.setAttribute("id", "identity-popup-popup-container");
|
||||
menulist.setAttribute("sizetopopup", "none");
|
||||
menulist.setAttribute("class", "identity-popup-popup-menulist");
|
||||
menulist.setAttribute("id", "identity-popup-popup-menulist");
|
||||
|
||||
for (let state of SitePermissions.getAvailableStates(aPermission.id)) {
|
||||
let menuitem = document.createXULElement("menuitem");
|
||||
let menuitem = document.createElement("menuitem");
|
||||
// We need to correctly display the default/unknown state, which has its
|
||||
// own integer value (0) but represents one of the other states.
|
||||
if (state == SitePermissions.getDefault(aPermission.id)) {
|
||||
|
@ -1063,7 +1063,7 @@ var gIdentityHandler = {
|
|||
return block;
|
||||
}
|
||||
|
||||
let stateLabel = document.createXULElement("label");
|
||||
let stateLabel = document.createElement("label");
|
||||
stateLabel.setAttribute("flex", "1");
|
||||
stateLabel.setAttribute("class", "identity-popup-permission-state-label");
|
||||
let stateLabelId = "identity-popup-permission-state-label-" + aPermission.id;
|
||||
|
@ -1089,7 +1089,7 @@ var gIdentityHandler = {
|
|||
return container;
|
||||
}
|
||||
|
||||
let button = document.createXULElement("button");
|
||||
let button = document.createElement("button");
|
||||
button.setAttribute("class", "identity-popup-permission-remove-button");
|
||||
let tooltiptext = gNavigatorBundle.getString("permissions.remove.tooltip");
|
||||
button.setAttribute("tooltiptext", tooltiptext);
|
||||
|
@ -1136,15 +1136,15 @@ var gIdentityHandler = {
|
|||
},
|
||||
|
||||
_createBlockedPopupIndicator() {
|
||||
let indicator = document.createXULElement("hbox");
|
||||
let indicator = document.createElement("hbox");
|
||||
indicator.setAttribute("class", "identity-popup-permission-item");
|
||||
indicator.setAttribute("align", "center");
|
||||
indicator.setAttribute("id", "blocked-popup-indicator-item");
|
||||
|
||||
let icon = document.createXULElement("image");
|
||||
let icon = document.createElement("image");
|
||||
icon.setAttribute("class", "popup-subitem identity-popup-permission-icon");
|
||||
|
||||
let text = document.createXULElement("label");
|
||||
let text = document.createElement("label");
|
||||
text.setAttribute("flex", "1");
|
||||
text.setAttribute("class", "identity-popup-permission-label text-link");
|
||||
|
||||
|
|
|
@ -368,7 +368,7 @@ var gSync = {
|
|||
if (!createDeviceNodeFn) {
|
||||
createDeviceNodeFn = (clientId, name, clientType, lastModified) => {
|
||||
let eltName = name ? "menuitem" : "menuseparator";
|
||||
return document.createXULElement(eltName);
|
||||
return document.createElement(eltName);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -735,7 +735,7 @@ var gPopupBlockerObserver = {
|
|||
// one usable popup URI and thus we'll turn on the separator later.
|
||||
foundUsablePopupURI = true;
|
||||
|
||||
var menuitem = document.createXULElement("menuitem");
|
||||
var menuitem = document.createElement("menuitem");
|
||||
var label = gNavigatorBundle.getFormattedString("popupShowPopupPrefix",
|
||||
[popupURIspec]);
|
||||
menuitem.setAttribute("label", label);
|
||||
|
@ -2807,7 +2807,7 @@ function UpdateUrlbarSearchSplitterState() {
|
|||
|
||||
if (ibefore) {
|
||||
if (!splitter) {
|
||||
splitter = document.createXULElement("splitter");
|
||||
splitter = document.createElement("splitter");
|
||||
splitter.id = "urlbar-search-splitter";
|
||||
splitter.setAttribute("resizebefore", "flex");
|
||||
splitter.setAttribute("resizeafter", "flex");
|
||||
|
@ -4191,7 +4191,7 @@ function FillHistoryMenu(aParent) {
|
|||
let uri = entry.url;
|
||||
|
||||
let item = existingIndex < children.length ?
|
||||
children[existingIndex] : document.createXULElement("menuitem");
|
||||
children[existingIndex] : document.createElement("menuitem");
|
||||
|
||||
item.setAttribute("uri", uri);
|
||||
item.setAttribute("label", entry.title || uri);
|
||||
|
@ -5551,7 +5551,7 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
|||
continue;
|
||||
}
|
||||
|
||||
let menuItem = document.createXULElement("menuitem");
|
||||
let menuItem = document.createElement("menuitem");
|
||||
let hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
|
||||
"autohide" : "collapsed";
|
||||
menuItem.setAttribute("id", "toggle_" + toolbar.id);
|
||||
|
@ -6383,7 +6383,7 @@ var gPageStyleMenu = {
|
|||
lastWithSameTitle = currentStyleSheets[currentStyleSheet.title];
|
||||
|
||||
if (!lastWithSameTitle) {
|
||||
let menuItem = document.createXULElement("menuitem");
|
||||
let menuItem = document.createElement("menuitem");
|
||||
menuItem.setAttribute("type", "radio");
|
||||
menuItem.setAttribute("label", currentStyleSheet.title);
|
||||
menuItem.setAttribute("data", currentStyleSheet.title);
|
||||
|
|
|
@ -115,7 +115,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
insertLocation.getAttribute("cmd") != "cmd_paste")
|
||||
insertLocation = insertLocation.nextSibling;
|
||||
if (insertLocation) {
|
||||
pasteAndGo = document.createXULElement("menuitem");
|
||||
pasteAndGo = document.createElement("menuitem");
|
||||
let label = Services.strings.createBundle("chrome://browser/locale/browser.properties").
|
||||
GetStringFromName("pasteAndGo.label");
|
||||
pasteAndGo.setAttribute("label", label);
|
||||
|
|
|
@ -64,7 +64,7 @@ function setDefaultPrefs() {
|
|||
}
|
||||
|
||||
function createElementWithAttrs(document, type, attrs) {
|
||||
let element = document.createXULElement(type);
|
||||
let element = document.createElement(type);
|
||||
Object.keys(attrs).forEach(function(attr) {
|
||||
element.setAttribute(attr, attrs[attr]);
|
||||
});
|
||||
|
@ -104,18 +104,18 @@ var PocketPageAction = {
|
|||
return;
|
||||
}
|
||||
|
||||
let wrapper = doc.createXULElement("hbox");
|
||||
let wrapper = doc.createElement("hbox");
|
||||
wrapper.id = "pocket-button-box";
|
||||
wrapper.classList.add("urlbar-icon-wrapper", "urlbar-page-action");
|
||||
let animatableBox = doc.createXULElement("hbox");
|
||||
let animatableBox = doc.createElement("hbox");
|
||||
animatableBox.id = "pocket-animatable-box";
|
||||
let animatableImage = doc.createXULElement("image");
|
||||
let animatableImage = doc.createElement("image");
|
||||
animatableImage.id = "pocket-animatable-image";
|
||||
animatableImage.setAttribute("role", "presentation");
|
||||
let tooltip =
|
||||
gPocketBundle.GetStringFromName("pocket-button.tooltiptext");
|
||||
animatableImage.setAttribute("tooltiptext", tooltip);
|
||||
let pocketButton = doc.createXULElement("image");
|
||||
let pocketButton = doc.createElement("image");
|
||||
pocketButton.id = "pocket-button";
|
||||
pocketButton.classList.add("urlbar-icon");
|
||||
pocketButton.setAttribute("role", "button");
|
||||
|
|
|
@ -104,7 +104,7 @@ const LibraryButton = {
|
|||
}
|
||||
const parent = libraryViewInsertionPoint.parentNode;
|
||||
const {nextSibling} = libraryViewInsertionPoint;
|
||||
const item = win.document.createXULElement("toolbarbutton");
|
||||
const item = win.document.createElement("toolbarbutton");
|
||||
item.className = "subviewbutton subviewbutton-iconic";
|
||||
item.addEventListener("command", () => win.openWebLinkIn(this.PAGE_TO_OPEN, "tab"));
|
||||
item.id = this.ITEM_ID;
|
||||
|
|
|
@ -311,12 +311,12 @@ class Tooltip {
|
|||
messagesClass = messagesClass || "default-tooltip-simple-text-colors";
|
||||
containerClass = containerClass || "default-tooltip-simple-text-colors";
|
||||
|
||||
const vbox = this.doc.createXULElement("vbox");
|
||||
const vbox = this.doc.createElement("vbox");
|
||||
vbox.className = "devtools-tooltip-simple-text-container " + containerClass;
|
||||
vbox.setAttribute("flex", "1");
|
||||
|
||||
for (const text of messages) {
|
||||
const description = this.doc.createXULElement("description");
|
||||
const description = this.doc.createElement("description");
|
||||
description.setAttribute("flex", "1");
|
||||
description.className = "devtools-tooltip-simple-text " + messagesClass;
|
||||
description.textContent = text;
|
||||
|
@ -324,7 +324,7 @@ class Tooltip {
|
|||
}
|
||||
|
||||
for (const { label, className, command } of extraButtons) {
|
||||
const button = this.doc.createXULElement("button");
|
||||
const button = this.doc.createElement("button");
|
||||
button.className = className;
|
||||
button.setAttribute("label", label);
|
||||
button.addEventListener("command", command);
|
||||
|
@ -390,7 +390,7 @@ class Tooltip {
|
|||
* Create the tooltip panel
|
||||
*/
|
||||
_createPanel() {
|
||||
const panel = this.doc.createXULElement("panel");
|
||||
const panel = this.doc.createElement("panel");
|
||||
panel.setAttribute("hidden", true);
|
||||
panel.setAttribute("ignorekeys", true);
|
||||
panel.setAttribute("animate", false);
|
||||
|
|
|
@ -41,17 +41,17 @@ function setTooltipVariableContent(tooltip, objectActor,
|
|||
relayEvents = {}, extraButtons = [],
|
||||
toolbox = null) {
|
||||
const doc = tooltip.doc;
|
||||
const vbox = doc.createXULElement("vbox");
|
||||
const vbox = doc.createElement("vbox");
|
||||
vbox.className = "devtools-tooltip-variables-view-box";
|
||||
vbox.setAttribute("flex", "1");
|
||||
|
||||
const innerbox = doc.createXULElement("vbox");
|
||||
const innerbox = doc.createElement("vbox");
|
||||
innerbox.className = "devtools-tooltip-variables-view-innerbox";
|
||||
innerbox.setAttribute("flex", "1");
|
||||
vbox.appendChild(innerbox);
|
||||
|
||||
for (const { label, className, command } of extraButtons) {
|
||||
const button = doc.createXULElement("button");
|
||||
const button = doc.createElement("button");
|
||||
button.className = className;
|
||||
button.setAttribute("label", label);
|
||||
button.addEventListener("command", command);
|
||||
|
|
|
@ -76,7 +76,7 @@ this.VariablesView = function VariablesView(aParentNode, aFlags = {}) {
|
|||
this._onViewKeyDown = this._onViewKeyDown.bind(this);
|
||||
|
||||
// Create an internal scrollbox container.
|
||||
this._list = this.document.createXULElement("scrollbox");
|
||||
this._list = this.document.createElement("scrollbox");
|
||||
this._list.setAttribute("orient", "vertical");
|
||||
this._list.addEventListener("keydown", this._onViewKeyDown);
|
||||
this._parent.appendChild(this._list);
|
||||
|
@ -178,7 +178,7 @@ VariablesView.prototype = {
|
|||
*/
|
||||
_emptySoon: function(aTimeout) {
|
||||
const prevList = this._list;
|
||||
const currList = this._list = this.document.createXULElement("scrollbox");
|
||||
const currList = this._list = this.document.createElement("scrollbox");
|
||||
|
||||
this.window.setTimeout(() => {
|
||||
prevList.removeEventListener("keydown", this._onViewKeyDown);
|
||||
|
@ -431,14 +431,14 @@ VariablesView.prototype = {
|
|||
const document = this.document;
|
||||
const ownerNode = this._parent.parentNode;
|
||||
|
||||
const container = this._searchboxContainer = document.createXULElement("hbox");
|
||||
const container = this._searchboxContainer = document.createElement("hbox");
|
||||
container.className = "devtools-toolbar";
|
||||
|
||||
// Hide the variables searchbox container if there are no variables or
|
||||
// properties to display.
|
||||
container.hidden = !this._store.length;
|
||||
|
||||
const searchbox = this._searchboxNode = document.createXULElement("textbox");
|
||||
const searchbox = this._searchboxNode = document.createElement("textbox");
|
||||
searchbox.className = "variables-view-searchinput devtools-filterinput";
|
||||
searchbox.setAttribute("placeholder", this._searchboxPlaceholder);
|
||||
searchbox.setAttribute("type", "search");
|
||||
|
@ -913,7 +913,7 @@ VariablesView.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
const label = this.document.createXULElement("label");
|
||||
const label = this.document.createElement("label");
|
||||
label.className = "variables-view-empty-notice";
|
||||
label.setAttribute("value", this._emptyTextValue);
|
||||
|
||||
|
@ -1783,24 +1783,24 @@ Scope.prototype = {
|
|||
_displayScope: function(aName = "", aTargetClassName, aTitleClassName = "") {
|
||||
const document = this.document;
|
||||
|
||||
const element = this._target = document.createXULElement("vbox");
|
||||
const element = this._target = document.createElement("vbox");
|
||||
element.id = this._idString;
|
||||
element.className = aTargetClassName;
|
||||
|
||||
const arrow = this._arrow = document.createXULElement("hbox");
|
||||
const arrow = this._arrow = document.createElement("hbox");
|
||||
arrow.className = "arrow theme-twisty";
|
||||
|
||||
const name = this._name = document.createXULElement("label");
|
||||
const name = this._name = document.createElement("label");
|
||||
name.className = "plain name";
|
||||
name.setAttribute("value", aName.trim());
|
||||
name.setAttribute("crop", "end");
|
||||
|
||||
const title = this._title = document.createXULElement("hbox");
|
||||
const title = this._title = document.createElement("hbox");
|
||||
title.className = "title " + aTitleClassName;
|
||||
title.setAttribute("align", "center");
|
||||
|
||||
const enumerable = this._enum = document.createXULElement("vbox");
|
||||
const nonenum = this._nonenum = document.createXULElement("vbox");
|
||||
const enumerable = this._enum = document.createElement("vbox");
|
||||
const nonenum = this._nonenum = document.createElement("vbox");
|
||||
enumerable.className = "variables-view-element-details enum";
|
||||
nonenum.className = "variables-view-element-details nonenum";
|
||||
|
||||
|
@ -2522,11 +2522,11 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
const document = this.document;
|
||||
const descriptor = this._initialDescriptor;
|
||||
|
||||
const separatorLabel = this._separatorLabel = document.createXULElement("label");
|
||||
const separatorLabel = this._separatorLabel = document.createElement("label");
|
||||
separatorLabel.className = "plain separator";
|
||||
separatorLabel.setAttribute("value", this.separatorStr + " ");
|
||||
|
||||
const valueLabel = this._valueLabel = document.createXULElement("label");
|
||||
const valueLabel = this._valueLabel = document.createElement("label");
|
||||
valueLabel.className = "plain value";
|
||||
valueLabel.setAttribute("flex", "1");
|
||||
valueLabel.setAttribute("crop", "center");
|
||||
|
@ -2583,21 +2583,21 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
const descriptor = this._initialDescriptor;
|
||||
|
||||
if (ownerView.eval && this.getter || this.setter) {
|
||||
const editNode = this._editNode = this.document.createXULElement("toolbarbutton");
|
||||
const editNode = this._editNode = this.document.createElement("toolbarbutton");
|
||||
editNode.className = "plain variables-view-edit";
|
||||
editNode.addEventListener("mousedown", this._onEdit.bind(this));
|
||||
this._title.insertBefore(editNode, this._spacer);
|
||||
}
|
||||
|
||||
if (ownerView.delete) {
|
||||
const deleteNode = this._deleteNode = this.document.createXULElement("toolbarbutton");
|
||||
const deleteNode = this._deleteNode = this.document.createElement("toolbarbutton");
|
||||
deleteNode.className = "plain variables-view-delete";
|
||||
deleteNode.addEventListener("click", this._onDelete.bind(this));
|
||||
this._title.appendChild(deleteNode);
|
||||
}
|
||||
|
||||
if (ownerView.new) {
|
||||
const addPropertyNode = this._addPropertyNode = this.document.createXULElement("toolbarbutton");
|
||||
const addPropertyNode = this._addPropertyNode = this.document.createElement("toolbarbutton");
|
||||
addPropertyNode.className = "plain variables-view-add-property";
|
||||
addPropertyNode.addEventListener("mousedown", this._onAddProperty.bind(this));
|
||||
this._title.appendChild(addPropertyNode);
|
||||
|
@ -2617,28 +2617,28 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
}
|
||||
|
||||
if (!descriptor.writable && !ownerView.getter && !ownerView.setter) {
|
||||
const nonWritableIcon = this.document.createXULElement("hbox");
|
||||
const nonWritableIcon = this.document.createElement("hbox");
|
||||
nonWritableIcon.className = "plain variable-or-property-non-writable-icon";
|
||||
nonWritableIcon.setAttribute("optional-visibility", "");
|
||||
this._title.appendChild(nonWritableIcon);
|
||||
}
|
||||
if (descriptor.value && typeof descriptor.value == "object") {
|
||||
if (descriptor.value.frozen) {
|
||||
const frozenLabel = this.document.createXULElement("label");
|
||||
const frozenLabel = this.document.createElement("label");
|
||||
frozenLabel.className = "plain variable-or-property-frozen-label";
|
||||
frozenLabel.setAttribute("optional-visibility", "");
|
||||
frozenLabel.setAttribute("value", "F");
|
||||
this._title.appendChild(frozenLabel);
|
||||
}
|
||||
if (descriptor.value.sealed) {
|
||||
const sealedLabel = this.document.createXULElement("label");
|
||||
const sealedLabel = this.document.createElement("label");
|
||||
sealedLabel.className = "plain variable-or-property-sealed-label";
|
||||
sealedLabel.setAttribute("optional-visibility", "");
|
||||
sealedLabel.setAttribute("value", "S");
|
||||
this._title.appendChild(sealedLabel);
|
||||
}
|
||||
if (!descriptor.value.extensible) {
|
||||
const nonExtensibleLabel = this.document.createXULElement("label");
|
||||
const nonExtensibleLabel = this.document.createElement("label");
|
||||
nonExtensibleLabel.className = "plain variable-or-property-non-extensible-label";
|
||||
nonExtensibleLabel.setAttribute("optional-visibility", "");
|
||||
nonExtensibleLabel.setAttribute("value", "N");
|
||||
|
@ -2665,7 +2665,7 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
return;
|
||||
}
|
||||
|
||||
const tooltip = this.document.createXULElement("tooltip");
|
||||
const tooltip = this.document.createElement("tooltip");
|
||||
tooltip.id = "tooltip-" + this._idString;
|
||||
tooltip.setAttribute("orient", "horizontal");
|
||||
|
||||
|
@ -2674,7 +2674,7 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
"frozen", "sealed", "extensible", "overridden", "WebIDL"];
|
||||
|
||||
for (const type of labels) {
|
||||
const labelElement = this.document.createXULElement("label");
|
||||
const labelElement = this.document.createElement("label");
|
||||
labelElement.className = type;
|
||||
labelElement.setAttribute("value", L10N.getStr(type + "Tooltip"));
|
||||
tooltip.appendChild(labelElement);
|
||||
|
@ -2734,7 +2734,7 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
this._valueLabel.addEventListener("mouseout", this.unhighlightDomNode);
|
||||
|
||||
// Add a button to open the node in the inspector
|
||||
this._openInspectorNode = this.document.createXULElement("toolbarbutton");
|
||||
this._openInspectorNode = this.document.createElement("toolbarbutton");
|
||||
this._openInspectorNode.className = "plain variables-view-open-inspector";
|
||||
this._openInspectorNode.addEventListener("mousedown", this.openNodeInInspector);
|
||||
this._title.appendChild(this._openInspectorNode);
|
||||
|
@ -3968,7 +3968,7 @@ Editable.prototype = {
|
|||
|
||||
// Create a texbox input element which will be shown in the current
|
||||
// element's specified label location.
|
||||
const input = this._input = this._variable.document.createXULElement("textbox");
|
||||
const input = this._input = this._variable.document.createElement("textbox");
|
||||
input.className = "plain " + this.className;
|
||||
input.setAttribute("value", initialString);
|
||||
input.setAttribute("flex", "1");
|
||||
|
|
|
@ -86,7 +86,7 @@ var AutomationView = {
|
|||
_createParamButtons: function(params) {
|
||||
this._buttons.innerHTML = "";
|
||||
params.forEach((param, i) => {
|
||||
const button = document.createXULElement("toolbarbutton");
|
||||
const button = document.createElement("toolbarbutton");
|
||||
button.setAttribute("class", "devtools-toolbarbutton automation-param-button");
|
||||
button.setAttribute("data-param", param.param);
|
||||
// Set label to the parameter name, should not be L10N'd
|
||||
|
|
|
@ -432,9 +432,9 @@ DevToolsStartup.prototype = {
|
|||
if (doc.getElementById("PanelUI-developerItems")) {
|
||||
return;
|
||||
}
|
||||
const view = doc.createXULElement("panelview");
|
||||
const view = doc.createElement("panelview");
|
||||
view.id = "PanelUI-developerItems";
|
||||
const panel = doc.createXULElement("vbox");
|
||||
const panel = doc.createElement("vbox");
|
||||
panel.setAttribute("class", "panel-subview-body");
|
||||
view.appendChild(panel);
|
||||
doc.getElementById("PanelUI-multiView").appendChild(view);
|
||||
|
@ -471,7 +471,7 @@ DevToolsStartup.prototype = {
|
|||
const {document} = window;
|
||||
|
||||
// Create the menu item.
|
||||
const item = document.createXULElement("menuitem");
|
||||
const item = document.createElement("menuitem");
|
||||
item.id = "enableDeveloperTools";
|
||||
item.setAttribute("label", StartupBundle.GetStringFromName("enableDevTools.label"));
|
||||
item.setAttribute("accesskey",
|
||||
|
@ -569,7 +569,7 @@ DevToolsStartup.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
const keyset = doc.createXULElement("keyset");
|
||||
const keyset = doc.createElement("keyset");
|
||||
keyset.setAttribute("id", "devtoolsKeyset");
|
||||
|
||||
for (const key of KeyShortcuts) {
|
||||
|
@ -601,7 +601,7 @@ DevToolsStartup.prototype = {
|
|||
|
||||
// Create a <xul:key> DOM Element
|
||||
createKey(doc, { id, toolId, shortcut, modifiers: mod }, oncommand) {
|
||||
const k = doc.createXULElement("key");
|
||||
const k = doc.createElement("key");
|
||||
k.id = "key_" + (id || toolId);
|
||||
|
||||
if (shortcut.startsWith("VK_")) {
|
||||
|
|
|
@ -1125,7 +1125,7 @@ class HiddenXULWindow {
|
|||
|
||||
const chromeDoc = this.chromeDocument;
|
||||
|
||||
const browser = chromeDoc.createXULElement("browser");
|
||||
const browser = chromeDoc.createElement("browser");
|
||||
browser.setAttribute("type", "content");
|
||||
browser.setAttribute("disableglobalhistory", "true");
|
||||
browser.sameProcessAsFrameLoader = groupFrameLoader;
|
||||
|
|
|
@ -39,7 +39,7 @@ class MozDropmarker extends MozXULElement {
|
|||
connectedCallback() {
|
||||
// Only create the image the first time we are connected
|
||||
if (!this.firstChild) {
|
||||
let image = document.createXULElement("image");
|
||||
let image = document.createElement("image");
|
||||
image.classList.add("dropmarker-icon");
|
||||
this.appendChild(image);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче