mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1485426 - Use createXULElement instead of createElement in XUL docs. r=bgrins
Preparing for transitioning to XHTML. MozReview-Commit-ID: JLlmUxsvhIB Differential Revision: https://phabricator.services.mozilla.com/D4265 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c02103611a
commit
f6923ccc24
@ -1236,7 +1236,7 @@ BrowserPageActions.shareURL = {
|
||||
fragment.appendChild(item);
|
||||
});
|
||||
|
||||
let item = document.createElement("toolbarbutton");
|
||||
let item = document.createXULElement("toolbarbutton");
|
||||
item.setAttribute("label", BrowserPageActions.panelNode.getAttribute("shareMore-label"));
|
||||
item.classList.add("subviewbutton", "subviewbutton-iconic", "share-more-button");
|
||||
item.addEventListener("command", onCommand);
|
||||
|
@ -17,38 +17,38 @@ function initFeedTab(feeds) {
|
||||
}
|
||||
|
||||
function addRow(name, type, url) {
|
||||
const item = document.createElement("richlistitem");
|
||||
const item = document.createXULElement("richlistitem");
|
||||
|
||||
const top = document.createElement("hbox");
|
||||
const top = document.createXULElement("hbox");
|
||||
top.setAttribute("flex", "1");
|
||||
item.appendChild(top);
|
||||
|
||||
const bottom = document.createElement("hbox");
|
||||
const bottom = document.createXULElement("hbox");
|
||||
bottom.setAttribute("flex", "1");
|
||||
item.appendChild(bottom);
|
||||
|
||||
const nameLabel = document.createElement("label");
|
||||
const nameLabel = document.createXULElement("label");
|
||||
nameLabel.className = "feedTitle";
|
||||
nameLabel.textContent = name;
|
||||
nameLabel.setAttribute("flex", "1");
|
||||
top.appendChild(nameLabel);
|
||||
|
||||
const typeLabel = document.createElement("label");
|
||||
const typeLabel = document.createXULElement("label");
|
||||
typeLabel.textContent = type;
|
||||
top.appendChild(typeLabel);
|
||||
|
||||
const urlContainer = document.createElement("hbox");
|
||||
const urlContainer = document.createXULElement("hbox");
|
||||
urlContainer.setAttribute("flex", "1");
|
||||
bottom.appendChild(urlContainer);
|
||||
|
||||
const urlLabel = document.createElement("label");
|
||||
const urlLabel = document.createXULElement("label");
|
||||
urlLabel.className = "text-link";
|
||||
urlLabel.textContent = url;
|
||||
urlLabel.setAttribute("tooltiptext", url);
|
||||
urlLabel.addEventListener("click", ev => openUILink(this.value, ev, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})}));
|
||||
urlContainer.appendChild(urlLabel);
|
||||
|
||||
const subscribeButton = document.createElement("button");
|
||||
const subscribeButton = document.createXULElement("button");
|
||||
subscribeButton.className = "feed-subscribe";
|
||||
subscribeButton.addEventListener("click",
|
||||
() => openWebLinkIn(url, "current", { ignoreAlt: true }));
|
||||
|
@ -114,41 +114,41 @@ function createRow(aPartId) {
|
||||
let labelId = "perm-" + aPartId + "-label";
|
||||
let radiogroupId = aPartId + "RadioGroup";
|
||||
|
||||
let command = document.createElement("command");
|
||||
let command = document.createXULElement("command");
|
||||
command.setAttribute("id", commandId);
|
||||
command.setAttribute("oncommand", "onRadioClick('" + aPartId + "');");
|
||||
document.getElementById("pageInfoCommandSet").appendChild(command);
|
||||
|
||||
let row = document.createElement("vbox");
|
||||
let row = document.createXULElement("vbox");
|
||||
row.setAttribute("id", rowId);
|
||||
row.setAttribute("class", "permission");
|
||||
|
||||
let label = document.createElement("label");
|
||||
let label = document.createXULElement("label");
|
||||
label.setAttribute("id", labelId);
|
||||
label.setAttribute("control", radiogroupId);
|
||||
label.setAttribute("value", SitePermissions.getPermissionLabel(aPartId));
|
||||
label.setAttribute("class", "permissionLabel");
|
||||
row.appendChild(label);
|
||||
|
||||
let controls = document.createElement("hbox");
|
||||
let controls = document.createXULElement("hbox");
|
||||
controls.setAttribute("role", "group");
|
||||
controls.setAttribute("aria-labelledby", labelId);
|
||||
|
||||
let checkbox = document.createElement("checkbox");
|
||||
let checkbox = document.createXULElement("checkbox");
|
||||
checkbox.setAttribute("id", aPartId + "Def");
|
||||
checkbox.setAttribute("oncommand", "onCheckboxClick('" + aPartId + "');");
|
||||
checkbox.setAttribute("label", gBundle.getString("permissions.useDefault"));
|
||||
controls.appendChild(checkbox);
|
||||
|
||||
let spacer = document.createElement("spacer");
|
||||
let spacer = document.createXULElement("spacer");
|
||||
spacer.setAttribute("flex", "1");
|
||||
controls.appendChild(spacer);
|
||||
|
||||
let radiogroup = document.createElement("radiogroup");
|
||||
let radiogroup = document.createXULElement("radiogroup");
|
||||
radiogroup.setAttribute("id", radiogroupId);
|
||||
radiogroup.setAttribute("orient", "horizontal");
|
||||
for (let state of SitePermissions.getAvailableStates(aPartId)) {
|
||||
let radio = document.createElement("radio");
|
||||
let radio = document.createXULElement("radio");
|
||||
radio.setAttribute("id", aPartId + "#" + state);
|
||||
radio.setAttribute("label", SitePermissions.getMultichoiceStateLabel(state));
|
||||
radio.setAttribute("command", commandId);
|
||||
|
@ -1275,7 +1275,7 @@
|
||||
// the pointer while a dnd session is on.
|
||||
if (!this._dndPanel) {
|
||||
this._dndCanvas = canvas;
|
||||
this._dndPanel = document.createElement("panel");
|
||||
this._dndPanel = document.createXULElement("panel");
|
||||
this._dndPanel.className = "dragfeedback-tab";
|
||||
this._dndPanel.setAttribute("type", "drag");
|
||||
let wrapper = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
|
||||
|
@ -36,7 +36,7 @@ function test_eventMatchesKey() {
|
||||
document.addEventListener("keypress", checkEvent);
|
||||
|
||||
try {
|
||||
key = document.createElement("key");
|
||||
key = document.createXULElement("key");
|
||||
let keyset = document.getElementById("mainKeyset");
|
||||
key.setAttribute("key", "t");
|
||||
key.setAttribute("modifiers", "accel");
|
||||
@ -45,7 +45,7 @@ function test_eventMatchesKey() {
|
||||
is(eventMatchResult, true, "eventMatchesKey: one modifier");
|
||||
keyset.removeChild(key);
|
||||
|
||||
key = document.createElement("key");
|
||||
key = document.createXULElement("key");
|
||||
key.setAttribute("key", "g");
|
||||
key.setAttribute("modifiers", "accel,shift");
|
||||
keyset.appendChild(key);
|
||||
@ -53,7 +53,7 @@ function test_eventMatchesKey() {
|
||||
is(eventMatchResult, true, "eventMatchesKey: combination modifiers");
|
||||
keyset.removeChild(key);
|
||||
|
||||
key = document.createElement("key");
|
||||
key = document.createXULElement("key");
|
||||
key.setAttribute("key", "w");
|
||||
key.setAttribute("modifiers", "accel");
|
||||
keyset.appendChild(key);
|
||||
@ -61,7 +61,7 @@ function test_eventMatchesKey() {
|
||||
is(eventMatchResult, false, "eventMatchesKey: mismatch keys");
|
||||
keyset.removeChild(key);
|
||||
|
||||
key = document.createElement("key");
|
||||
key = document.createXULElement("key");
|
||||
key.setAttribute("keycode", "VK_DELETE");
|
||||
keyset.appendChild(key);
|
||||
EventUtils.synthesizeKey("VK_DELETE", {accelKey: true});
|
||||
|
@ -21,7 +21,7 @@ add_task(async function() {
|
||||
is(focusedId, "checkbox", "checkbox accesskey");
|
||||
|
||||
// Add an element with an accesskey to the chrome and press its accesskey while the chrome is focused.
|
||||
let newButton = document.createElement("button");
|
||||
let newButton = document.createXULElement("button");
|
||||
newButton.id = "chromebutton";
|
||||
newButton.setAttribute("accesskey", "z");
|
||||
document.documentElement.appendChild(newButton);
|
||||
|
@ -81,12 +81,12 @@ function popupShown(event)
|
||||
|
||||
function createPanel(attrs)
|
||||
{
|
||||
var panel = document.createElement("panel");
|
||||
var panel = document.createXULElement("panel");
|
||||
for (var a in attrs) {
|
||||
panel.setAttribute(a, attrs[a]);
|
||||
}
|
||||
|
||||
var button = document.createElement("button");
|
||||
var button = document.createXULElement("button");
|
||||
panel.appendChild(button);
|
||||
button.label = "OK";
|
||||
button.width = 120;
|
||||
|
@ -8,7 +8,7 @@ function test() {
|
||||
registerCleanupFunction(cleanup);
|
||||
let titlebar = document.getElementById("titlebar");
|
||||
let originalHeight = titlebar.getBoundingClientRect().height;
|
||||
let button = document.createElement("toolbarbutton");
|
||||
let button = document.createXULElement("toolbarbutton");
|
||||
button.id = kButtonId;
|
||||
button.setAttribute("style", "min-height: 100px");
|
||||
gNavToolbox.palette.appendChild(button);
|
||||
|
@ -1,6 +1,6 @@
|
||||
add_task(async function test_reserved_shortcuts() {
|
||||
let keyset = document.createElement("keyset");
|
||||
let key1 = document.createElement("key");
|
||||
let keyset = document.createXULElement("keyset");
|
||||
let key1 = document.createXULElement("key");
|
||||
key1.setAttribute("id", "kt_reserved");
|
||||
key1.setAttribute("modifiers", "shift");
|
||||
key1.setAttribute("key", "O");
|
||||
@ -13,7 +13,7 @@ add_task(async function test_reserved_shortcuts() {
|
||||
key1.setAttribute("count", Number(attribute) + 1);
|
||||
});
|
||||
|
||||
let key2 = document.createElement("key");
|
||||
let key2 = document.createXULElement("key");
|
||||
key2.setAttribute("id", "kt_notreserved");
|
||||
key2.setAttribute("modifiers", "shift");
|
||||
key2.setAttribute("key", "P");
|
||||
@ -26,7 +26,7 @@ add_task(async function test_reserved_shortcuts() {
|
||||
key2.setAttribute("count", Number(attribute) + 1);
|
||||
});
|
||||
|
||||
let key3 = document.createElement("key");
|
||||
let key3 = document.createXULElement("key");
|
||||
key3.setAttribute("id", "kt_reserveddefault");
|
||||
key3.setAttribute("modifiers", "shift");
|
||||
key3.setAttribute("key", "Q");
|
||||
@ -41,7 +41,7 @@ add_task(async function test_reserved_shortcuts() {
|
||||
keyset.appendChild(key1);
|
||||
keyset.appendChild(key2);
|
||||
keyset.appendChild(key3);
|
||||
let container = document.createElement("box");
|
||||
let container = document.createXULElement("box");
|
||||
container.appendChild(keyset);
|
||||
document.documentElement.appendChild(container);
|
||||
|
||||
|
@ -140,10 +140,10 @@ var tests = [
|
||||
{ id: "Test#6",
|
||||
run() {
|
||||
// Add a temporary box as the anchor with a button
|
||||
this.box = document.createElement("box");
|
||||
this.box = document.createXULElement("box");
|
||||
PopupNotifications.iconBox.appendChild(this.box);
|
||||
|
||||
let button = document.createElement("button");
|
||||
let button = document.createXULElement("button");
|
||||
button.setAttribute("label", "Please click me!");
|
||||
this.box.appendChild(button);
|
||||
|
||||
|
@ -197,7 +197,7 @@ var tests = [
|
||||
await promiseTabLoadEvent(gBrowser.selectedTab, "http://example.com/");
|
||||
let originalTab = gBrowser.selectedTab;
|
||||
let bgTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/");
|
||||
let anchor = document.createElement("box");
|
||||
let anchor = document.createXULElement("box");
|
||||
anchor.id = "test26-anchor";
|
||||
anchor.className = "notification-anchor-icon";
|
||||
PopupNotifications.iconBox.appendChild(anchor);
|
||||
|
@ -10,9 +10,9 @@
|
||||
add_task(async function() {
|
||||
let tab1 = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/#0");
|
||||
let tab2 = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/#1");
|
||||
let specificPanel = document.createElement("panel");
|
||||
let specificPanel = document.createXULElement("panel");
|
||||
specificPanel.setAttribute("tabspecific", "true");
|
||||
let generalPanel = document.createElement("panel");
|
||||
let generalPanel = document.createXULElement("panel");
|
||||
let anchor = document.getElementById(CustomizableUI.AREA_NAVBAR);
|
||||
|
||||
anchor.appendChild(specificPanel);
|
||||
|
@ -621,7 +621,7 @@ function createUserContextMenu(event, {
|
||||
|
||||
// If we are excluding a userContextId, we want to add a 'no-container' item.
|
||||
if (excludeUserContextId || showDefaultTab) {
|
||||
let menuitem = document.createElement("menuitem");
|
||||
let menuitem = document.createXULElement("menuitem");
|
||||
menuitem.setAttribute("data-usercontextid", "0");
|
||||
menuitem.setAttribute("label", bundle.GetStringFromName("userContextNone.label"));
|
||||
menuitem.setAttribute("accesskey", bundle.GetStringFromName("userContextNone.accesskey"));
|
||||
@ -632,7 +632,7 @@ function createUserContextMenu(event, {
|
||||
|
||||
docfrag.appendChild(menuitem);
|
||||
|
||||
let menuseparator = document.createElement("menuseparator");
|
||||
let menuseparator = document.createXULElement("menuseparator");
|
||||
docfrag.appendChild(menuseparator);
|
||||
}
|
||||
|
||||
@ -641,7 +641,7 @@ function createUserContextMenu(event, {
|
||||
return;
|
||||
}
|
||||
|
||||
let menuitem = document.createElement("menuitem");
|
||||
let menuitem = document.createXULElement("menuitem");
|
||||
menuitem.setAttribute("data-usercontextid", identity.userContextId);
|
||||
menuitem.setAttribute("label", ContextualIdentityService.getUserContextLabel(identity.userContextId));
|
||||
|
||||
@ -662,9 +662,9 @@ function createUserContextMenu(event, {
|
||||
});
|
||||
|
||||
if (!isContextMenu) {
|
||||
docfrag.appendChild(document.createElement("menuseparator"));
|
||||
docfrag.appendChild(document.createXULElement("menuseparator"));
|
||||
|
||||
let menuitem = document.createElement("menuitem");
|
||||
let menuitem = document.createXULElement("menuitem");
|
||||
menuitem.setAttribute("label",
|
||||
bundle.GetStringFromName("userContext.aboutPage.label"));
|
||||
if (useAccessKeys) {
|
||||
|
@ -816,7 +816,7 @@ CustomizeMode.prototype = {
|
||||
wrapper = aNode.parentNode;
|
||||
aPlace = wrapper.getAttribute("place");
|
||||
} else {
|
||||
wrapper = this.document.createElement("toolbarpaletteitem");
|
||||
wrapper = this.document.createXULElement("toolbarpaletteitem");
|
||||
// "place" is used to show the label when it's sitting in the palette.
|
||||
wrapper.setAttribute("place", aPlace);
|
||||
}
|
||||
@ -1361,7 +1361,7 @@ CustomizeMode.prototype = {
|
||||
let doc = this.window.document;
|
||||
|
||||
function buildToolbarButton(aTheme) {
|
||||
let tbb = doc.createElement("toolbarbutton");
|
||||
let tbb = doc.createXULElement("toolbarbutton");
|
||||
tbb.theme = aTheme;
|
||||
tbb.setAttribute("label", aTheme.name);
|
||||
tbb.setAttribute("image", aTheme.iconURL);
|
||||
@ -2650,7 +2650,7 @@ CustomizeMode.prototype = {
|
||||
document.addEventListener("keyup", onkeyup);
|
||||
|
||||
for (let id of ["player1", "player2", "ball", "score", "lives"]) {
|
||||
let el = document.createElement("box");
|
||||
let el = document.createXULElement("box");
|
||||
el.id = "wp-" + id;
|
||||
elements[el.id] = elements.arena.appendChild(el);
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ const PanelUI = {
|
||||
} else if (!aAnchor.open) {
|
||||
aAnchor.open = true;
|
||||
|
||||
let tempPanel = document.createElement("panel");
|
||||
let tempPanel = document.createXULElement("panel");
|
||||
tempPanel.setAttribute("type", "arrow");
|
||||
tempPanel.setAttribute("id", "customizationui-widget-panel");
|
||||
tempPanel.setAttribute("class", "cui-widget-panel");
|
||||
@ -394,7 +394,7 @@ const PanelUI = {
|
||||
tempPanel.classList.toggle("cui-widget-panelWithFooter",
|
||||
viewNode.querySelector(".panel-subview-footer"));
|
||||
|
||||
let multiView = document.createElement("panelmultiview");
|
||||
let multiView = document.createXULElement("panelmultiview");
|
||||
multiView.setAttribute("id", "customizationui-widget-multiview");
|
||||
multiView.setAttribute("viewCacheId", "appMenu-viewCache");
|
||||
multiView.setAttribute("mainViewId", viewNode.id);
|
||||
@ -512,7 +512,7 @@ const PanelUI = {
|
||||
container.previousElementSibling.previousElementSibling.hidden = false;
|
||||
let fragment = document.createDocumentFragment();
|
||||
for (let highlight of highlights) {
|
||||
let button = document.createElement("toolbarbutton");
|
||||
let button = document.createXULElement("toolbarbutton");
|
||||
button.classList.add("subviewbutton", "highlight", "subviewbutton-iconic", "bookmark-item");
|
||||
let title = highlight.title || highlight.url;
|
||||
button.setAttribute("label", title);
|
||||
|
@ -10,7 +10,7 @@ var skippedItem;
|
||||
// Attempting to drag a skipintoolbarset item should work.
|
||||
add_task(async function() {
|
||||
navbar = document.getElementById("nav-bar");
|
||||
skippedItem = document.createElement("toolbarbutton");
|
||||
skippedItem = document.createXULElement("toolbarbutton");
|
||||
skippedItem.id = "test-skipintoolbarset-item";
|
||||
skippedItem.setAttribute("label", "Test");
|
||||
skippedItem.setAttribute("skipintoolbarset", "true");
|
||||
|
@ -12,7 +12,7 @@ registerCleanupFunction(cleanup);
|
||||
add_task(async function() {
|
||||
ok(CustomizableUI.inDefaultState, "Everything should be in its default state.");
|
||||
let btn = createDummyXULButton(kButtonId);
|
||||
let toolbar = document.createElement("toolbar");
|
||||
let toolbar = document.createXULElement("toolbar");
|
||||
toolbar.id = kToolbarId;
|
||||
toolbar.setAttribute("customizable", true);
|
||||
toolbar.setAttribute("defaultset", kButtonId);
|
||||
@ -34,7 +34,7 @@ add_task(async function() {
|
||||
add_task(async function() {
|
||||
ok(CustomizableUI.inDefaultState, "Everything should be in its default state.");
|
||||
let btn = createDummyXULButton(kButtonId);
|
||||
let toolbar = document.createElement("toolbar");
|
||||
let toolbar = document.createXULElement("toolbar");
|
||||
toolbar.id = kToolbarId;
|
||||
toolbar.setAttribute("customizable", true);
|
||||
gNavToolbox.appendChild(toolbar);
|
||||
|
@ -7,7 +7,7 @@
|
||||
var button, menuButton;
|
||||
/* Clicking a button should close the panel */
|
||||
add_task(async function plain_button() {
|
||||
button = document.createElement("toolbarbutton");
|
||||
button = document.createXULElement("toolbarbutton");
|
||||
button.id = "browser_940307_button";
|
||||
button.setAttribute("label", "Button");
|
||||
gNavToolbox.palette.appendChild(button);
|
||||
@ -75,7 +75,7 @@ add_task(async function searchbar_in_panel() {
|
||||
});
|
||||
|
||||
add_task(async function disabled_button_in_panel() {
|
||||
button = document.createElement("toolbarbutton");
|
||||
button = document.createXULElement("toolbarbutton");
|
||||
button.id = "browser_946166_button_disabled";
|
||||
button.setAttribute("disabled", "true");
|
||||
button.setAttribute("label", "Button");
|
||||
|
@ -9,7 +9,7 @@ const kToolbar = "test-toolbar-963639-non-customizable-customizing-attribute";
|
||||
add_task(async function() {
|
||||
info("Test for Bug 963639 - CustomizeMode _onToolbarVisibilityChange sets @customizing on non-customizable toolbars");
|
||||
|
||||
let toolbar = document.createElement("toolbar");
|
||||
let toolbar = document.createXULElement("toolbar");
|
||||
toolbar.id = kToolbar;
|
||||
gNavToolbox.appendChild(toolbar);
|
||||
|
||||
|
@ -11,7 +11,7 @@ var draggedItem;
|
||||
|
||||
// Drop on the palette
|
||||
add_task(async function() {
|
||||
draggedItem = document.createElement("toolbarbutton");
|
||||
draggedItem = document.createXULElement("toolbarbutton");
|
||||
draggedItem.id = "test-dragEnd-after-move1";
|
||||
draggedItem.setAttribute("label", "Test");
|
||||
draggedItem.setAttribute("removable", "true");
|
||||
@ -26,7 +26,7 @@ add_task(async function() {
|
||||
|
||||
// Drop on a customization target itself
|
||||
add_task(async function() {
|
||||
draggedItem = document.createElement("toolbarbutton");
|
||||
draggedItem = document.createXULElement("toolbarbutton");
|
||||
draggedItem.id = "test-dragEnd-after-move2";
|
||||
draggedItem.setAttribute("label", "Test");
|
||||
draggedItem.setAttribute("removable", "true");
|
||||
|
@ -10,14 +10,14 @@ function insertTempItemsIntoMenu(parentMenu) {
|
||||
// Last element is null to insert at the end:
|
||||
let beforeEls = [parentMenu.firstElementChild, parentMenu.lastElementChild, null];
|
||||
for (let i = 0; i < beforeEls.length; i++) {
|
||||
let sep = document.createElement("menuseparator");
|
||||
let sep = document.createXULElement("menuseparator");
|
||||
tempElements.push(sep);
|
||||
parentMenu.insertBefore(sep, beforeEls[i]);
|
||||
let menu = document.createElement("menu");
|
||||
let menu = document.createXULElement("menu");
|
||||
tempElements.push(menu);
|
||||
parentMenu.insertBefore(menu, beforeEls[i]);
|
||||
// And another separator for good measure:
|
||||
sep = document.createElement("menuseparator");
|
||||
sep = document.createXULElement("menuseparator");
|
||||
tempElements.push(sep);
|
||||
parentMenu.insertBefore(sep, beforeEls[i]);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ add_task(async function testAddOnBeforeCreatedWidget() {
|
||||
type: "view",
|
||||
viewId: kWidgetId + "idontexistyet",
|
||||
onBeforeCreated(doc) {
|
||||
let view = doc.createElement("panelview");
|
||||
let view = doc.createXULElement("panelview");
|
||||
view.id = kWidgetId + "idontexistyet";
|
||||
document.getElementById("appMenu-viewCache").appendChild(view);
|
||||
onBeforeCreatedCalled = true;
|
||||
|
@ -11,7 +11,7 @@ function test() {
|
||||
// but not in the customizable part of it (the customization target) but
|
||||
// next to the main (hamburger) menu button.
|
||||
const buttonID = "Test-non-widget-non-removable-button";
|
||||
let btn = document.createElement("toolbarbutton");
|
||||
let btn = document.createXULElement("toolbarbutton");
|
||||
btn.id = buttonID;
|
||||
btn.label = "Hi";
|
||||
btn.setAttribute("style", "width: 20px; height: 20px; background-color: red");
|
||||
|
@ -166,28 +166,28 @@ add_task(async function test_setup() {
|
||||
let navBar = document.getElementById("nav-bar");
|
||||
|
||||
for (let i = 0; i < PANELS_COUNT; i++) {
|
||||
gPanelAnchors[i] = document.createElement("toolbarbutton");
|
||||
gPanelAnchors[i] = document.createXULElement("toolbarbutton");
|
||||
gPanelAnchors[i].classList.add("toolbarbutton-1",
|
||||
"chromeclass-toolbar-additional");
|
||||
navBar.appendChild(gPanelAnchors[i]);
|
||||
|
||||
gPanels[i] = document.createElement("panel");
|
||||
gPanels[i] = document.createXULElement("panel");
|
||||
gPanels[i].id = "panel-" + i;
|
||||
gPanels[i].setAttribute("type", "arrow");
|
||||
gPanels[i].setAttribute("photon", true);
|
||||
navBar.appendChild(gPanels[i]);
|
||||
|
||||
gPanelMultiViews[i] = document.createElement("panelmultiview");
|
||||
gPanelMultiViews[i] = document.createXULElement("panelmultiview");
|
||||
gPanelMultiViews[i].id = "panelmultiview-" + i;
|
||||
gPanels[i].appendChild(gPanelMultiViews[i]);
|
||||
}
|
||||
|
||||
for (let i = 0; i < PANELVIEWS_COUNT; i++) {
|
||||
gPanelViews[i] = document.createElement("panelview");
|
||||
gPanelViews[i] = document.createXULElement("panelview");
|
||||
gPanelViews[i].id = "panelview-" + i;
|
||||
navBar.appendChild(gPanelViews[i]);
|
||||
|
||||
gPanelViewLabels[i] = document.createElement("label");
|
||||
gPanelViewLabels[i] = document.createXULElement("label");
|
||||
gPanelViewLabels[i].setAttribute("value", "PanelView " + i);
|
||||
gPanelViews[i].appendChild(gPanelViewLabels[i]);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ const kTestBarID = "testBar";
|
||||
const kWidgetID = "characterencoding-button";
|
||||
|
||||
function createTestBar(aLegacy) {
|
||||
let testBar = document.createElement("toolbar");
|
||||
let testBar = document.createXULElement("toolbar");
|
||||
testBar.id = kTestBarID;
|
||||
testBar.setAttribute("customizable", "true");
|
||||
CustomizableUI.registerArea(kTestBarID, {
|
||||
|
@ -12,7 +12,7 @@ add_task(async function() {
|
||||
let placements = CustomizableUI.getWidgetIdsInArea(toolbar);
|
||||
Assert.deepEqual(placements.slice(-2), ["real-button", "moved-button-not-here"],
|
||||
"Should have correct placements");
|
||||
let otherButton = document.createElement("toolbarbutton");
|
||||
let otherButton = document.createXULElement("toolbarbutton");
|
||||
otherButton.id = "moved-button-not-here";
|
||||
if (toolbar == "nav-bar") {
|
||||
gURLBar.parentNode.appendChild(otherButton);
|
||||
|
@ -38,7 +38,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
function HistoryDownloadElementShell(download) {
|
||||
this._download = download;
|
||||
|
||||
this.element = document.createElement("richlistitem");
|
||||
this.element = document.createXULElement("richlistitem");
|
||||
this.element._shell = this;
|
||||
|
||||
this.element.classList.add("download");
|
||||
|
@ -723,7 +723,7 @@ var DownloadsView = {
|
||||
DownloadsCommon.log("Adding a new DownloadsViewItem to the downloads list.",
|
||||
"aNewest =", aNewest);
|
||||
|
||||
let element = document.createElement("richlistitem");
|
||||
let element = document.createXULElement("richlistitem");
|
||||
let viewItem = new DownloadsViewItem(download, element);
|
||||
this._visibleViewItems.set(download, viewItem);
|
||||
this._itemsForElements.set(element, viewItem);
|
||||
|
@ -270,7 +270,7 @@ class ExtensionControlledPopup {
|
||||
getAddonDetails(doc, addon) {
|
||||
const defaultIcon = "chrome://mozapps/skin/extensions/extensionGeneric.svg";
|
||||
|
||||
let image = doc.createElement("image");
|
||||
let image = doc.createXULElement("image");
|
||||
image.setAttribute("src", addon.iconURL || defaultIcon);
|
||||
image.classList.add("extension-controlled-icon");
|
||||
|
||||
@ -295,7 +295,7 @@ class ExtensionControlledPopup {
|
||||
BrowserUtils.getLocalizedFragment(doc, message, addonDetails));
|
||||
}
|
||||
|
||||
let link = doc.createElement("label");
|
||||
let link = doc.createXULElement("label");
|
||||
link.setAttribute("class", "learnMore text-link");
|
||||
link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + this.learnMoreLink;
|
||||
link.textContent = strBundle.GetStringFromName(this.learnMoreMessageId);
|
||||
|
@ -386,7 +386,7 @@ BasePopup.instances = new DefaultWeakMap(() => new WeakMap());
|
||||
|
||||
class PanelPopup extends BasePopup {
|
||||
constructor(extension, document, popupURL, browserStyle) {
|
||||
let panel = document.createElement("panel");
|
||||
let panel = document.createXULElement("panel");
|
||||
panel.setAttribute("id", makeWidgetId(extension.id) + "-panel");
|
||||
panel.setAttribute("class", "browser-extension-panel");
|
||||
panel.setAttribute("tabspecific", "true");
|
||||
@ -434,7 +434,7 @@ class ViewPopup extends BasePopup {
|
||||
let document = window.document;
|
||||
|
||||
let createPanel = remote => {
|
||||
let panel = document.createElement("panel");
|
||||
let panel = document.createXULElement("panel");
|
||||
panel.setAttribute("type", "arrow");
|
||||
if (remote) {
|
||||
panel.setAttribute("remote", "true");
|
||||
|
@ -75,7 +75,7 @@ var gMenuBuilder = {
|
||||
menu.addEventListener("popuphidden", this);
|
||||
|
||||
if (visible.length) {
|
||||
const separator = menu.ownerDocument.createElement("menuseparator");
|
||||
const separator = menu.ownerDocument.createXULElement("menuseparator");
|
||||
menu.insertBefore(separator, menu.firstElementChild);
|
||||
this.itemsToCleanUp.add(separator);
|
||||
|
||||
@ -139,7 +139,7 @@ var gMenuBuilder = {
|
||||
|
||||
appendTopLevelElement(rootElement) {
|
||||
if (this.itemsToCleanUp.size === 0) {
|
||||
const separator = this.xulMenu.ownerDocument.createElement("menuseparator");
|
||||
const separator = this.xulMenu.ownerDocument.createXULElement("menuseparator");
|
||||
this.itemsToCleanUp.add(separator);
|
||||
this.xulMenu.append(separator);
|
||||
}
|
||||
@ -183,18 +183,18 @@ var gMenuBuilder = {
|
||||
if (item.children.length > 0) {
|
||||
element = this.createMenuElement(doc, item);
|
||||
} else if (item.type == "separator") {
|
||||
element = doc.createElement("menuseparator");
|
||||
element = doc.createXULElement("menuseparator");
|
||||
} else {
|
||||
element = doc.createElement("menuitem");
|
||||
element = doc.createXULElement("menuitem");
|
||||
}
|
||||
|
||||
return this.customizeElement(element, item, contextData);
|
||||
},
|
||||
|
||||
createMenuElement(doc, item) {
|
||||
let element = doc.createElement("menu");
|
||||
let element = doc.createXULElement("menu");
|
||||
// Menu elements need to have a menupopup child for its menu items.
|
||||
let menupopup = doc.createElement("menupopup");
|
||||
let menupopup = doc.createXULElement("menupopup");
|
||||
element.appendChild(menupopup);
|
||||
return element;
|
||||
},
|
||||
|
@ -40,7 +40,7 @@ XPCOMUtils.defineLazyGetter(this, "tabHidePopup", () => {
|
||||
descriptionId: "extension-tab-hide-notification-description",
|
||||
descriptionMessageId: "tabHideControlled.message",
|
||||
getLocalizedDescription: (doc, message, addonDetails) => {
|
||||
let image = doc.createElement("image");
|
||||
let image = doc.createXULElement("image");
|
||||
image.setAttribute("class", "extension-controlled-icon alltabs-icon");
|
||||
return BrowserUtils.getLocalizedFragment(doc, message, addonDetails, image);
|
||||
},
|
||||
|
@ -16,7 +16,7 @@ ChromeUtils.defineModuleGetter(this, "ExtensionControlledPopup",
|
||||
|
||||
function createMarkup(doc) {
|
||||
let panel = doc.getElementById("extension-notification-panel");
|
||||
let popupnotification = doc.createElement("popupnotification");
|
||||
let popupnotification = doc.createXULElement("popupnotification");
|
||||
let attributes = {
|
||||
id: "extension-controlled-notification",
|
||||
class: "extension-controlled-notification",
|
||||
@ -34,9 +34,9 @@ function createMarkup(doc) {
|
||||
Object.entries(attributes).forEach(([key, value]) => {
|
||||
popupnotification.setAttribute(key, value);
|
||||
});
|
||||
let content = doc.createElement("popupnotificationcontent");
|
||||
let content = doc.createXULElement("popupnotificationcontent");
|
||||
content.setAttribute("orient", "vertical");
|
||||
let description = doc.createElement("description");
|
||||
let description = doc.createXULElement("description");
|
||||
description.setAttribute("id", "extension-controlled-description");
|
||||
content.appendChild(description);
|
||||
popupnotification.appendChild(content);
|
||||
|
@ -311,7 +311,7 @@ PlacesViewBase.prototype = {
|
||||
function PVB__setEmptyPopupStatus(aPopup, aEmpty) {
|
||||
if (!aPopup._emptyMenuitem) {
|
||||
let label = PlacesUIUtils.getString("bookmarksMenuEmptyFolder");
|
||||
aPopup._emptyMenuitem = document.createElement("menuitem");
|
||||
aPopup._emptyMenuitem = document.createXULElement("menuitem");
|
||||
aPopup._emptyMenuitem.setAttribute("label", label);
|
||||
aPopup._emptyMenuitem.setAttribute("disabled", true);
|
||||
aPopup._emptyMenuitem.className = "bookmark-item";
|
||||
@ -340,17 +340,17 @@ PlacesViewBase.prototype = {
|
||||
let element;
|
||||
let type = aPlacesNode.type;
|
||||
if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR) {
|
||||
element = document.createElement("menuseparator");
|
||||
element = document.createXULElement("menuseparator");
|
||||
element.setAttribute("class", "small-separator");
|
||||
} else {
|
||||
let itemId = aPlacesNode.itemId;
|
||||
if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_URI) {
|
||||
element = document.createElement("menuitem");
|
||||
element = document.createXULElement("menuitem");
|
||||
element.className = "menuitem-iconic bookmark-item menuitem-with-favicon";
|
||||
element.setAttribute("scheme",
|
||||
PlacesUIUtils.guessUrlSchemeForUI(aPlacesNode.uri));
|
||||
} else if (PlacesUtils.containerTypes.includes(type)) {
|
||||
element = document.createElement("menu");
|
||||
element = document.createXULElement("menu");
|
||||
element.setAttribute("container", "true");
|
||||
|
||||
if (aPlacesNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY) {
|
||||
@ -375,7 +375,7 @@ PlacesViewBase.prototype = {
|
||||
}, () => undefined);
|
||||
}
|
||||
|
||||
let popup = document.createElement("menupopup");
|
||||
let popup = document.createXULElement("menupopup");
|
||||
popup._placesNode = PlacesUtils.asContainer(aPlacesNode);
|
||||
|
||||
if (!this._nativeView) {
|
||||
@ -431,7 +431,7 @@ PlacesViewBase.prototype = {
|
||||
aPopup._siteURIMenuseparator = null;
|
||||
} else if (siteUrl && !aPopup._siteURIMenuitem) {
|
||||
// Add "Open (Feed Name)" menuitem.
|
||||
aPopup._siteURIMenuitem = document.createElement("menuitem");
|
||||
aPopup._siteURIMenuitem = document.createXULElement("menuitem");
|
||||
aPopup._siteURIMenuitem.className = "openlivemarksite-menuitem";
|
||||
if (typeof this.options.extraClasses.entry == "string") {
|
||||
aPopup._siteURIMenuitem.classList.add(this.options.extraClasses.entry);
|
||||
@ -453,7 +453,7 @@ PlacesViewBase.prototype = {
|
||||
aPopup._siteURIMenuitem.setAttribute("label", label);
|
||||
aPopup.insertBefore(aPopup._siteURIMenuitem, aPopup._startMarker);
|
||||
|
||||
aPopup._siteURIMenuseparator = document.createElement("menuseparator");
|
||||
aPopup._siteURIMenuseparator = document.createXULElement("menuseparator");
|
||||
aPopup.insertBefore(aPopup._siteURIMenuseparator, aPopup._startMarker);
|
||||
}
|
||||
},
|
||||
@ -470,7 +470,7 @@ PlacesViewBase.prototype = {
|
||||
let statusMenuitem = aPopup._statusMenuitem;
|
||||
if (!statusMenuitem) {
|
||||
// Create the status menuitem and cache it in the popup object.
|
||||
statusMenuitem = document.createElement("menuitem");
|
||||
statusMenuitem = document.createXULElement("menuitem");
|
||||
statusMenuitem.className = "livemarkstatus-menuitem";
|
||||
if (typeof this.options.extraClasses.entry == "string") {
|
||||
statusMenuitem.classList.add(this.options.extraClasses.entry);
|
||||
@ -845,12 +845,12 @@ PlacesViewBase.prototype = {
|
||||
}
|
||||
} else if (!aPopup._endOptOpenAllInTabs) {
|
||||
// Create a separator before options.
|
||||
aPopup._endOptSeparator = document.createElement("menuseparator");
|
||||
aPopup._endOptSeparator = document.createXULElement("menuseparator");
|
||||
aPopup._endOptSeparator.className = "bookmarks-actions-menuseparator";
|
||||
aPopup.appendChild(aPopup._endOptSeparator);
|
||||
|
||||
// Add the "Open All in Tabs" menuitem.
|
||||
aPopup._endOptOpenAllInTabs = document.createElement("menuitem");
|
||||
aPopup._endOptOpenAllInTabs = document.createXULElement("menuitem");
|
||||
aPopup._endOptOpenAllInTabs.className = "openintabs-menuitem";
|
||||
|
||||
if (typeof this.options.extraClasses.entry == "string")
|
||||
@ -880,7 +880,7 @@ PlacesViewBase.prototype = {
|
||||
return;
|
||||
|
||||
// _startMarker is an hidden menuseparator that lives before places nodes.
|
||||
aPopup._startMarker = document.createElement("menuseparator");
|
||||
aPopup._startMarker = document.createXULElement("menuseparator");
|
||||
aPopup._startMarker.hidden = true;
|
||||
aPopup.insertBefore(aPopup._startMarker, aPopup.firstElementChild);
|
||||
|
||||
@ -891,7 +891,7 @@ PlacesViewBase.prototype = {
|
||||
if (node) {
|
||||
aPopup._endMarker = node;
|
||||
} else {
|
||||
aPopup._endMarker = document.createElement("menuseparator");
|
||||
aPopup._endMarker = document.createXULElement("menuseparator");
|
||||
aPopup._endMarker.hidden = true;
|
||||
}
|
||||
aPopup.appendChild(aPopup._endMarker);
|
||||
@ -1109,9 +1109,9 @@ PlacesToolbar.prototype = {
|
||||
let type = aChild.type;
|
||||
let button;
|
||||
if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR) {
|
||||
button = document.createElement("toolbarseparator");
|
||||
button = document.createXULElement("toolbarseparator");
|
||||
} else {
|
||||
button = document.createElement("toolbarbutton");
|
||||
button = document.createXULElement("toolbarbutton");
|
||||
button.className = "bookmark-item";
|
||||
button.setAttribute("label", aChild.title || "");
|
||||
|
||||
@ -1131,7 +1131,7 @@ PlacesToolbar.prototype = {
|
||||
}, () => undefined);
|
||||
}
|
||||
|
||||
let popup = document.createElement("menupopup");
|
||||
let popup = document.createXULElement("menupopup");
|
||||
popup.setAttribute("placespopup", "true");
|
||||
button.appendChild(popup);
|
||||
popup._placesNode = PlacesUtils.asContainer(aChild);
|
||||
@ -2007,10 +2007,10 @@ PlacesPanelMenuView.prototype = {
|
||||
let type = aChild.type;
|
||||
let button;
|
||||
if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR) {
|
||||
button = document.createElement("toolbarseparator");
|
||||
button = document.createXULElement("toolbarseparator");
|
||||
button.setAttribute("class", "small-separator");
|
||||
} else {
|
||||
button = document.createElement("toolbarbutton");
|
||||
button = document.createXULElement("toolbarbutton");
|
||||
button.className = "bookmark-item";
|
||||
if (typeof this.options.extraClasses.entry == "string")
|
||||
button.classList.add(this.options.extraClasses.entry);
|
||||
@ -2231,12 +2231,12 @@ this.PlacesPanelview = class extends PlacesViewBase {
|
||||
let element;
|
||||
let type = placesNode.type;
|
||||
if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR) {
|
||||
element = document.createElement("toolbarseparator");
|
||||
element = document.createXULElement("toolbarseparator");
|
||||
} else {
|
||||
if (type != Ci.nsINavHistoryResultNode.RESULT_TYPE_URI)
|
||||
throw "Unexpected node";
|
||||
|
||||
element = document.createElement("toolbarbutton");
|
||||
element = document.createXULElement("toolbarbutton");
|
||||
element.classList.add("subviewbutton", "subviewbutton-iconic", "bookmark-item");
|
||||
element.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(placesNode.uri));
|
||||
element.setAttribute("label", PlacesUIUtils.getBestTitle(placesNode));
|
||||
@ -2256,7 +2256,7 @@ this.PlacesPanelview = class extends PlacesViewBase {
|
||||
_setEmptyPopupStatus(panelview, empty = false) {
|
||||
if (!panelview._emptyMenuitem) {
|
||||
let label = PlacesUIUtils.getString("bookmarksMenuEmptyFolder");
|
||||
panelview._emptyMenuitem = document.createElement("toolbarbutton");
|
||||
panelview._emptyMenuitem = document.createXULElement("toolbarbutton");
|
||||
panelview._emptyMenuitem.setAttribute("label", label);
|
||||
panelview._emptyMenuitem.setAttribute("disabled", true);
|
||||
panelview._emptyMenuitem.className = "subviewbutton";
|
||||
|
@ -349,7 +349,7 @@ var gEditItemOverlay = {
|
||||
// First make sure the folders-separator is visible
|
||||
this._element("foldersSeparator").hidden = false;
|
||||
|
||||
var folderMenuItem = document.createElement("menuitem");
|
||||
var folderMenuItem = document.createXULElement("menuitem");
|
||||
folderMenuItem.folderGuid = aFolderGuid;
|
||||
folderMenuItem.setAttribute("label", aTitle);
|
||||
folderMenuItem.className = "menuitem-iconic folder-icon";
|
||||
@ -760,9 +760,9 @@ var gEditItemOverlay = {
|
||||
let fragment = document.createDocumentFragment();
|
||||
for (let i = 0; i < allTags.length; i++) {
|
||||
let tag = allTags[i].name;
|
||||
let elt = document.createElement("richlistitem");
|
||||
elt.appendChild(document.createElement("image"));
|
||||
let label = document.createElement("label");
|
||||
let elt = document.createXULElement("richlistitem");
|
||||
elt.appendChild(document.createXULElement("image"));
|
||||
let label = document.createXULElement("label");
|
||||
label.setAttribute("value", tag);
|
||||
elt.appendChild(label);
|
||||
if (tagsInField.includes(tag))
|
||||
|
@ -137,7 +137,7 @@ function setSort(aOrganizerWin, aTree, aUnsortFirst, aShouldFail, aCol, aDir) {
|
||||
*/
|
||||
function testInvalid(aOrganizerWin, aPlaceContentTree) {
|
||||
// Invalid column should fail by throwing an exception.
|
||||
let bogusCol = document.createElement("treecol");
|
||||
let bogusCol = document.createXULElement("treecol");
|
||||
bogusCol.setAttribute("anonid", "bogusColumn");
|
||||
setSort(aOrganizerWin, aPlaceContentTree, true, true, bogusCol, "ascending");
|
||||
|
||||
|
@ -40,11 +40,11 @@ var gAppManagerDialog = {
|
||||
var item = list.lastChild;
|
||||
item.app = app;
|
||||
|
||||
var image = document.createElement("image");
|
||||
var image = document.createXULElement("image");
|
||||
image.setAttribute("src", gMainPane._getIconURLForHandlerApp(app));
|
||||
item.appendChild(image);
|
||||
|
||||
var label = document.createElement("label");
|
||||
var label = document.createXULElement("label");
|
||||
label.setAttribute("value", app.name);
|
||||
item.appendChild(label);
|
||||
}
|
||||
|
@ -89,12 +89,12 @@ let gContainersManager = {
|
||||
},
|
||||
|
||||
createIconButtons(defaultIcon) {
|
||||
let radiogroup = document.createElement("radiogroup");
|
||||
let radiogroup = document.createXULElement("radiogroup");
|
||||
radiogroup.setAttribute("id", "icon");
|
||||
radiogroup.className = "icon-buttons radio-buttons";
|
||||
|
||||
for (let icon of this.icons) {
|
||||
let iconSwatch = document.createElement("radio");
|
||||
let iconSwatch = document.createXULElement("radio");
|
||||
iconSwatch.id = "iconbutton-" + icon;
|
||||
iconSwatch.name = "icon";
|
||||
iconSwatch.type = "radio";
|
||||
@ -105,7 +105,7 @@ let gContainersManager = {
|
||||
}
|
||||
|
||||
document.l10n.setAttributes(iconSwatch, `containers-icon-${icon}`);
|
||||
let iconElement = document.createElement("hbox");
|
||||
let iconElement = document.createXULElement("hbox");
|
||||
iconElement.className = "userContext-icon";
|
||||
iconElement.setAttribute("data-identity-icon", icon);
|
||||
|
||||
@ -117,12 +117,12 @@ let gContainersManager = {
|
||||
},
|
||||
|
||||
createColorSwatches(defaultColor) {
|
||||
let radiogroup = document.createElement("radiogroup");
|
||||
let radiogroup = document.createXULElement("radiogroup");
|
||||
radiogroup.setAttribute("id", "color");
|
||||
radiogroup.className = "radio-buttons";
|
||||
|
||||
for (let color of this.colors) {
|
||||
let colorSwatch = document.createElement("radio");
|
||||
let colorSwatch = document.createXULElement("radio");
|
||||
colorSwatch.id = "colorswatch-" + color;
|
||||
colorSwatch.name = "color";
|
||||
colorSwatch.type = "radio";
|
||||
@ -133,7 +133,7 @@ let gContainersManager = {
|
||||
}
|
||||
|
||||
document.l10n.setAttributes(colorSwatch, `containers-color-${color}`);
|
||||
let iconElement = document.createElement("hbox");
|
||||
let iconElement = document.createXULElement("hbox");
|
||||
iconElement.className = "userContext-icon";
|
||||
iconElement.setAttribute("data-identity-icon", "circle");
|
||||
iconElement.setAttribute("data-identity-color", color);
|
||||
|
@ -30,14 +30,14 @@ let gContainersPane = {
|
||||
this._list.firstChild.remove();
|
||||
}
|
||||
for (let container of containers) {
|
||||
let item = document.createElement("richlistitem");
|
||||
let item = document.createXULElement("richlistitem");
|
||||
|
||||
let outer = document.createElement("hbox");
|
||||
let outer = document.createXULElement("hbox");
|
||||
outer.setAttribute("flex", 1);
|
||||
outer.setAttribute("align", "center");
|
||||
item.appendChild(outer);
|
||||
|
||||
let userContextIcon = document.createElement("hbox");
|
||||
let userContextIcon = document.createXULElement("hbox");
|
||||
userContextIcon.className = "userContext-icon";
|
||||
userContextIcon.setAttribute("width", 24);
|
||||
userContextIcon.setAttribute("height", 24);
|
||||
@ -45,25 +45,25 @@ let gContainersPane = {
|
||||
userContextIcon.setAttribute("data-identity-color", container.color);
|
||||
outer.appendChild(userContextIcon);
|
||||
|
||||
let label = document.createElement("label");
|
||||
let label = document.createXULElement("label");
|
||||
label.setAttribute("flex", 1);
|
||||
label.setAttribute("crop", "end");
|
||||
label.textContent = ContextualIdentityService.getUserContextLabel(container.userContextId);
|
||||
outer.appendChild(label);
|
||||
|
||||
let containerButtons = document.createElement("hbox");
|
||||
let containerButtons = document.createXULElement("hbox");
|
||||
containerButtons.className = "container-buttons";
|
||||
containerButtons.setAttribute("flex", 1);
|
||||
containerButtons.setAttribute("align", "right");
|
||||
item.appendChild(containerButtons);
|
||||
|
||||
let prefsButton = document.createElement("button");
|
||||
let prefsButton = document.createXULElement("button");
|
||||
prefsButton.setAttribute("oncommand", "gContainersPane.onPreferenceCommand(event.originalTarget)");
|
||||
prefsButton.setAttribute("value", container.userContextId);
|
||||
document.l10n.setAttributes(prefsButton, "containers-preferences-button");
|
||||
containerButtons.appendChild(prefsButton);
|
||||
|
||||
let removeButton = document.createElement("button");
|
||||
let removeButton = document.createXULElement("button");
|
||||
removeButton.setAttribute("oncommand", "gContainersPane.onRemoveCommand(event.originalTarget)");
|
||||
removeButton.setAttribute("value", container.userContextId);
|
||||
document.l10n.setAttributes(removeButton, "containers-remove-button");
|
||||
|
@ -223,14 +223,14 @@ function showEnableExtensionMessage(settingName) {
|
||||
img.className = "extension-controlled-icon";
|
||||
return img;
|
||||
};
|
||||
let label = document.createElement("label");
|
||||
let label = document.createXULElement("label");
|
||||
let addonIcon = icon("chrome://mozapps/skin/extensions/extensionGeneric-16.svg", "addons-icon");
|
||||
let toolbarIcon = icon("chrome://browser/skin/menu.svg", "menu-icon");
|
||||
label.appendChild(addonIcon);
|
||||
label.appendChild(toolbarIcon);
|
||||
document.l10n.setAttributes(label, "extension-controlled-enable");
|
||||
elements.description.appendChild(label);
|
||||
let dismissButton = document.createElement("image");
|
||||
let dismissButton = document.createXULElement("image");
|
||||
dismissButton.setAttribute("class", "extension-controlled-icon close-icon");
|
||||
dismissButton.addEventListener("click", function dismissHandler() {
|
||||
hideControllingExtension(settingName);
|
||||
|
@ -518,8 +518,8 @@ var gSearchResultsPane = {
|
||||
if (anchorNode.tooltipNode) {
|
||||
return;
|
||||
}
|
||||
let searchTooltip = anchorNode.ownerDocument.createElement("span");
|
||||
let searchTooltipText = anchorNode.ownerDocument.createElement("span");
|
||||
let searchTooltip = anchorNode.ownerDocument.createXULElement("span");
|
||||
let searchTooltipText = anchorNode.ownerDocument.createXULElement("span");
|
||||
searchTooltip.className = "search-tooltip";
|
||||
searchTooltipText.textContent = query;
|
||||
searchTooltip.appendChild(searchTooltipText);
|
||||
|
@ -793,7 +793,7 @@ var gMainPane = {
|
||||
|
||||
let fragment = document.createDocumentFragment();
|
||||
for (let {code, name} of locales) {
|
||||
let menuitem = document.createElement("menuitem");
|
||||
let menuitem = document.createXULElement("menuitem");
|
||||
menuitem.setAttribute("value", code);
|
||||
menuitem.setAttribute("label", name);
|
||||
fragment.appendChild(menuitem);
|
||||
@ -1586,7 +1586,7 @@ var gMainPane = {
|
||||
let internalMenuItem;
|
||||
// Add the "Preview in Firefox" option for optional internal handlers.
|
||||
if (handlerInfo instanceof InternalHandlerInfoWrapper) {
|
||||
internalMenuItem = document.createElement("menuitem");
|
||||
internalMenuItem = document.createXULElement("menuitem");
|
||||
internalMenuItem.setAttribute("action", Ci.nsIHandlerInfo.handleInternally);
|
||||
let label = gMainPane._prefsBundle.getFormattedString("previewInApp",
|
||||
[this._brandShortName]);
|
||||
@ -1597,7 +1597,7 @@ var gMainPane = {
|
||||
}
|
||||
|
||||
{
|
||||
var askMenuItem = document.createElement("menuitem");
|
||||
var askMenuItem = document.createXULElement("menuitem");
|
||||
askMenuItem.setAttribute("action", Ci.nsIHandlerInfo.alwaysAsk);
|
||||
let label;
|
||||
if (isFeedType(handlerInfo.type))
|
||||
@ -1617,7 +1617,7 @@ var gMainPane = {
|
||||
// available to feeds, since the feed code doesn't implement the capability.
|
||||
if ((handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) &&
|
||||
!isFeedType(handlerInfo.type)) {
|
||||
var saveMenuItem = document.createElement("menuitem");
|
||||
var saveMenuItem = document.createXULElement("menuitem");
|
||||
saveMenuItem.setAttribute("action", Ci.nsIHandlerInfo.saveToDisk);
|
||||
let label = gMainPane._prefsBundle.getString("saveFile");
|
||||
saveMenuItem.setAttribute("label", label);
|
||||
@ -1628,7 +1628,7 @@ var gMainPane = {
|
||||
|
||||
// If this is the feed type, add a Live Bookmarks item.
|
||||
if (isFeedType(handlerInfo.type)) {
|
||||
internalMenuItem = document.createElement("menuitem");
|
||||
internalMenuItem = document.createXULElement("menuitem");
|
||||
internalMenuItem.setAttribute("action", Ci.nsIHandlerInfo.handleInternally);
|
||||
let label = gMainPane._prefsBundle.getFormattedString("addLiveBookmarksInApp",
|
||||
[this._brandShortName]);
|
||||
@ -1640,12 +1640,12 @@ var gMainPane = {
|
||||
|
||||
// Add a separator to distinguish these items from the helper app items
|
||||
// that follow them.
|
||||
let menuseparator = document.createElement("menuseparator");
|
||||
let menuseparator = document.createXULElement("menuseparator");
|
||||
menuPopup.appendChild(menuseparator);
|
||||
|
||||
// Create a menu item for the OS default application, if any.
|
||||
if (handlerInfo.hasDefaultHandler) {
|
||||
var defaultMenuItem = document.createElement("menuitem");
|
||||
var defaultMenuItem = document.createXULElement("menuitem");
|
||||
defaultMenuItem.setAttribute("action", Ci.nsIHandlerInfo.useSystemDefault);
|
||||
let label = gMainPane._prefsBundle.getFormattedString("useDefault",
|
||||
[handlerInfo.defaultDescription]);
|
||||
@ -1663,7 +1663,7 @@ var gMainPane = {
|
||||
if (!this.isValidHandlerApp(possibleApp))
|
||||
continue;
|
||||
|
||||
let menuItem = document.createElement("menuitem");
|
||||
let menuItem = document.createXULElement("menuitem");
|
||||
menuItem.setAttribute("action", Ci.nsIHandlerInfo.useHelperApp);
|
||||
let label;
|
||||
if (possibleApp instanceof Ci.nsILocalHandlerApp)
|
||||
@ -1704,7 +1704,7 @@ var gMainPane = {
|
||||
}
|
||||
}
|
||||
if (!appAlreadyInHandlers) {
|
||||
let menuItem = document.createElement("menuitem");
|
||||
let menuItem = document.createXULElement("menuitem");
|
||||
menuItem.setAttribute("action", Ci.nsIHandlerInfo.useHelperApp);
|
||||
let label = gMainPane._prefsBundle.getFormattedString("useApp", [handler.name]);
|
||||
menuItem.setAttribute("label", label);
|
||||
@ -1723,7 +1723,7 @@ var gMainPane = {
|
||||
|
||||
// Create a menu item for the plugin.
|
||||
if (handlerInfo.pluginName) {
|
||||
var pluginMenuItem = document.createElement("menuitem");
|
||||
var pluginMenuItem = document.createXULElement("menuitem");
|
||||
pluginMenuItem.setAttribute("action", kActionUsePlugin);
|
||||
let label = gMainPane._prefsBundle.getFormattedString("usePluginIn",
|
||||
[handlerInfo.pluginName,
|
||||
@ -1744,7 +1744,7 @@ var gMainPane = {
|
||||
canOpenWithOtherApp = handlerInfo.type != executableType;
|
||||
}
|
||||
if (canOpenWithOtherApp) {
|
||||
let menuItem = document.createElement("menuitem");
|
||||
let menuItem = document.createXULElement("menuitem");
|
||||
menuItem.className = "choose-app-item";
|
||||
menuItem.addEventListener("command", function(e) {
|
||||
gMainPane.chooseApp(e);
|
||||
@ -1757,9 +1757,9 @@ var gMainPane = {
|
||||
|
||||
// Create a menu item for managing applications.
|
||||
if (possibleAppMenuItems.length) {
|
||||
let menuItem = document.createElement("menuseparator");
|
||||
let menuItem = document.createXULElement("menuseparator");
|
||||
menuPopup.appendChild(menuItem);
|
||||
menuItem = document.createElement("menuitem");
|
||||
menuItem = document.createXULElement("menuitem");
|
||||
menuItem.className = "manage-app-item";
|
||||
menuItem.addEventListener("command", function(e) {
|
||||
gMainPane.manageApp(e);
|
||||
|
@ -92,7 +92,7 @@ var gLanguagesDialog = {
|
||||
let localeCode = locale.code;
|
||||
if (locale.isVisible &&
|
||||
(!(localeCode in this._acceptLanguages) || !this._acceptLanguages[localeCode])) {
|
||||
var menuitem = document.createElement("menuitem");
|
||||
var menuitem = document.createXULElement("menuitem");
|
||||
menuitem.id = localeCode;
|
||||
document.l10n.setAttributes(menuitem, "languages-code-format", {
|
||||
locale: locale.name,
|
||||
@ -133,8 +133,8 @@ var gLanguagesDialog = {
|
||||
return;
|
||||
var languages = preference.value.toLowerCase().split(/\s*,\s*/);
|
||||
for (var i = 0; i < languages.length; ++i) {
|
||||
var listitem = document.createElement("richlistitem");
|
||||
var label = document.createElement("label");
|
||||
var listitem = document.createXULElement("richlistitem");
|
||||
var label = document.createXULElement("label");
|
||||
listitem.appendChild(label);
|
||||
listitem.id = languages[i];
|
||||
if (languages[i] == this._selectedItemID)
|
||||
|
@ -266,13 +266,13 @@ var gPermissionManager = {
|
||||
},
|
||||
|
||||
_createPermissionListItem(permission) {
|
||||
let richlistitem = document.createElement("richlistitem");
|
||||
let richlistitem = document.createXULElement("richlistitem");
|
||||
richlistitem.setAttribute("origin", permission.origin);
|
||||
let row = document.createElement("hbox");
|
||||
let row = document.createXULElement("hbox");
|
||||
row.setAttribute("flex", "1");
|
||||
|
||||
let hbox = document.createElement("hbox");
|
||||
let website = document.createElement("label");
|
||||
let hbox = document.createXULElement("hbox");
|
||||
let website = document.createXULElement("label");
|
||||
website.setAttribute("value", permission.origin);
|
||||
hbox.setAttribute("width", "0");
|
||||
hbox.setAttribute("class", "website-name");
|
||||
@ -281,8 +281,8 @@ var gPermissionManager = {
|
||||
row.appendChild(hbox);
|
||||
|
||||
if (!this._hideStatusColumn) {
|
||||
hbox = document.createElement("hbox");
|
||||
let capability = document.createElement("label");
|
||||
hbox = document.createXULElement("hbox");
|
||||
let capability = document.createXULElement("label");
|
||||
capability.setAttribute("class", "website-capability-value");
|
||||
capability.setAttribute("value", permission.capability);
|
||||
hbox.setAttribute("width", "0");
|
||||
|
@ -13,8 +13,8 @@ let gSiteDataRemoveSelected = {
|
||||
let list = document.getElementById("removalList");
|
||||
let fragment = document.createDocumentFragment();
|
||||
for (let host of hosts) {
|
||||
let listItem = document.createElement("richlistitem");
|
||||
let label = document.createElement("label");
|
||||
let listItem = document.createXULElement("richlistitem");
|
||||
let label = document.createXULElement("label");
|
||||
label.setAttribute("value", host);
|
||||
listItem.appendChild(label);
|
||||
fragment.appendChild(listItem);
|
||||
|
@ -26,16 +26,16 @@ let gSiteDataSettings = {
|
||||
_searchBox: null,
|
||||
|
||||
_createSiteListItem(site) {
|
||||
let item = document.createElement("richlistitem");
|
||||
let item = document.createXULElement("richlistitem");
|
||||
item.setAttribute("host", site.host);
|
||||
let container = document.createElement("hbox");
|
||||
let container = document.createXULElement("hbox");
|
||||
|
||||
// Creates a new column item with the specified relative width.
|
||||
function addColumnItem(l10n, flexWidth, tooltipText) {
|
||||
let box = document.createElement("hbox");
|
||||
let box = document.createXULElement("hbox");
|
||||
box.className = "item-box";
|
||||
box.setAttribute("flex", flexWidth);
|
||||
let label = document.createElement("label");
|
||||
let label = document.createXULElement("label");
|
||||
label.setAttribute("crop", "end");
|
||||
if (l10n) {
|
||||
if (l10n.hasOwnProperty("raw")) {
|
||||
|
@ -198,21 +198,21 @@ var gSitePermissionsManager = {
|
||||
},
|
||||
|
||||
_createPermissionListItem(permission) {
|
||||
let richlistitem = document.createElement("richlistitem");
|
||||
let richlistitem = document.createXULElement("richlistitem");
|
||||
richlistitem.setAttribute("origin", permission.origin);
|
||||
let row = document.createElement("hbox");
|
||||
let row = document.createXULElement("hbox");
|
||||
row.setAttribute("flex", "1");
|
||||
|
||||
let hbox = document.createElement("hbox");
|
||||
let website = document.createElement("label");
|
||||
let hbox = document.createXULElement("hbox");
|
||||
let website = document.createXULElement("label");
|
||||
website.setAttribute("value", permission.origin);
|
||||
website.setAttribute("width", "50");
|
||||
hbox.setAttribute("class", "website-name");
|
||||
hbox.setAttribute("flex", "3");
|
||||
hbox.appendChild(website);
|
||||
|
||||
let menulist = document.createElement("menulist");
|
||||
let menupopup = document.createElement("menupopup");
|
||||
let menulist = document.createXULElement("menulist");
|
||||
let menupopup = document.createXULElement("menupopup");
|
||||
menulist.setAttribute("flex", "1");
|
||||
menulist.setAttribute("width", "50");
|
||||
menulist.setAttribute("class", "website-status");
|
||||
@ -228,7 +228,7 @@ var gSitePermissionsManager = {
|
||||
} else if (state == SitePermissions.UNKNOWN) {
|
||||
continue;
|
||||
}
|
||||
let m = document.createElement("menuitem");
|
||||
let m = document.createXULElement("menuitem");
|
||||
document.l10n.setAttributes(m, this._getCapabilityString(state));
|
||||
m.setAttribute("value", state);
|
||||
menupopup.appendChild(m);
|
||||
|
@ -1140,7 +1140,7 @@ var UITour = {
|
||||
|
||||
for (let button of aButtons) {
|
||||
let isButton = button.style != "text";
|
||||
let el = document.createElement(isButton ? "button" : "label");
|
||||
let el = document.createXULElement(isButton ? "button" : "label");
|
||||
el.setAttribute(isButton ? "label" : "value", button.label);
|
||||
|
||||
if (isButton) {
|
||||
|
@ -236,7 +236,7 @@ let FormAutofillDoorhanger = {
|
||||
*/
|
||||
_appendPrivacyPanelLink(content, message, link) {
|
||||
let chromeDoc = content.ownerDocument;
|
||||
let privacyLinkElement = chromeDoc.createElement("label");
|
||||
let privacyLinkElement = chromeDoc.createXULElement("label");
|
||||
privacyLinkElement.className = "text-link";
|
||||
privacyLinkElement.setAttribute("useoriginprincipal", true);
|
||||
privacyLinkElement.setAttribute("href", link || "about:preferences#privacy");
|
||||
@ -257,19 +257,19 @@ let FormAutofillDoorhanger = {
|
||||
let chromeDoc = content.ownerDocument;
|
||||
let docFragment = chromeDoc.createDocumentFragment();
|
||||
|
||||
let descriptionLabelElement = chromeDoc.createElement("label");
|
||||
let descriptionLabelElement = chromeDoc.createXULElement("label");
|
||||
descriptionLabelElement.setAttribute("value", descriptionLabel);
|
||||
docFragment.appendChild(descriptionLabelElement);
|
||||
|
||||
let descriptionWrapper = chromeDoc.createElement("hbox");
|
||||
let descriptionWrapper = chromeDoc.createXULElement("hbox");
|
||||
descriptionWrapper.className = "desc-message-box";
|
||||
|
||||
if (descriptionIcon) {
|
||||
let descriptionIconElement = chromeDoc.createElement("image");
|
||||
let descriptionIconElement = chromeDoc.createXULElement("image");
|
||||
descriptionWrapper.appendChild(descriptionIconElement);
|
||||
}
|
||||
|
||||
let descriptionElement = chromeDoc.createElement("description");
|
||||
let descriptionElement = chromeDoc.createXULElement("description");
|
||||
descriptionWrapper.appendChild(descriptionElement);
|
||||
docFragment.appendChild(descriptionWrapper);
|
||||
|
||||
@ -301,7 +301,7 @@ let FormAutofillDoorhanger = {
|
||||
let notificationPopupBox =
|
||||
chromeDoc.getElementById("notification-popup-box");
|
||||
// Icon shown on URL bar
|
||||
let anchorElement = chromeDoc.createElement("image");
|
||||
let anchorElement = chromeDoc.createXULElement("image");
|
||||
anchorElement.id = id;
|
||||
anchorElement.setAttribute("src", URL);
|
||||
anchorElement.classList.add("notification-anchor-icon");
|
||||
@ -383,7 +383,7 @@ let FormAutofillDoorhanger = {
|
||||
const notificationElementId = notificationId + "-notification";
|
||||
const notification = chromeDoc.getElementById(notificationElementId);
|
||||
const notificationContent = notification.querySelector("popupnotificationcontent") ||
|
||||
chromeDoc.createElement("popupnotificationcontent");
|
||||
chromeDoc.createXULElement("popupnotificationcontent");
|
||||
if (!notification.contains(notificationContent)) {
|
||||
notificationContent.setAttribute("orient", "vertical");
|
||||
this._appendDescription(notificationContent, descriptionLabel, descriptionIcon);
|
||||
|
@ -458,7 +458,7 @@ var ProcessHangMonitor = {
|
||||
let linkText = bundle.getString("processHang.add-on.learn-more.text");
|
||||
let linkURL = "https://support.mozilla.org/kb/warning-unresponsive-script#w_other-causes";
|
||||
|
||||
let link = doc.createElement("label");
|
||||
let link = doc.createXULElement("label");
|
||||
link.setAttribute("class", "text-link");
|
||||
link.setAttribute("role", "link");
|
||||
link.setAttribute("onclick", `openTrustedLinkIn(${JSON.stringify(linkURL)}, "tab")`);
|
||||
|
@ -569,7 +569,7 @@ function prompt(aBrowser, aRequest) {
|
||||
addDeviceToList(menupopup,
|
||||
stringBundle.getString("getUserMedia.pick" + typeName + ".label"),
|
||||
"-1");
|
||||
menupopup.appendChild(doc.createElement("menuseparator"));
|
||||
menupopup.appendChild(doc.createXULElement("menuseparator"));
|
||||
|
||||
// Build the list of 'devices'.
|
||||
let monitorIndex = 1;
|
||||
@ -638,7 +638,7 @@ function prompt(aBrowser, aRequest) {
|
||||
let baseURL =
|
||||
Services.urlFormatter.formatURLPref("app.support.baseURL");
|
||||
|
||||
let learnMore = chromeWin.document.createElement("label");
|
||||
let learnMore = chromeWin.document.createXULElement("label");
|
||||
learnMore.className = "text-link";
|
||||
learnMore.setAttribute("href", baseURL + "screenshare-safety");
|
||||
learnMore.textContent = learnMoreText;
|
||||
@ -685,7 +685,7 @@ function prompt(aBrowser, aRequest) {
|
||||
}
|
||||
|
||||
function addDeviceToList(menupopup, deviceName, deviceIndex, type) {
|
||||
let menuitem = doc.createElement("menuitem");
|
||||
let menuitem = doc.createXULElement("menuitem");
|
||||
menuitem.setAttribute("value", deviceIndex);
|
||||
menuitem.setAttribute("label", deviceName);
|
||||
menuitem.setAttribute("tooltiptext", deviceName);
|
||||
@ -910,14 +910,14 @@ function getGlobalIndicator() {
|
||||
if (activeStreams.length == 1) {
|
||||
let stream = activeStreams[0];
|
||||
|
||||
let menuitem = this.ownerDocument.createElement("menuitem");
|
||||
let menuitem = this.ownerDocument.createXULElement("menuitem");
|
||||
let labelId = "webrtcIndicator.sharing" + type + "With.menuitem";
|
||||
let label = stream.browser.contentTitle || stream.uri;
|
||||
menuitem.setAttribute("label", bundle.formatStringFromName(labelId, [label], 1));
|
||||
menuitem.setAttribute("disabled", "true");
|
||||
this.appendChild(menuitem);
|
||||
|
||||
menuitem = this.ownerDocument.createElement("menuitem");
|
||||
menuitem = this.ownerDocument.createXULElement("menuitem");
|
||||
menuitem.setAttribute("label",
|
||||
bundle.GetStringFromName("webrtcIndicator.controlSharing.menuitem"));
|
||||
menuitem.stream = stream;
|
||||
@ -928,7 +928,7 @@ function getGlobalIndicator() {
|
||||
}
|
||||
|
||||
// We show a different menu when there are several active streams.
|
||||
let menuitem = this.ownerDocument.createElement("menuitem");
|
||||
let menuitem = this.ownerDocument.createXULElement("menuitem");
|
||||
let labelId = "webrtcIndicator.sharing" + type + "WithNTabs.menuitem";
|
||||
let count = activeStreams.length;
|
||||
let label = PluralForm.get(count, bundle.GetStringFromName(labelId)).replace("#1", count);
|
||||
@ -937,7 +937,7 @@ function getGlobalIndicator() {
|
||||
this.appendChild(menuitem);
|
||||
|
||||
for (let stream of activeStreams) {
|
||||
let item = this.ownerDocument.createElement("menuitem");
|
||||
let item = this.ownerDocument.createXULElement("menuitem");
|
||||
labelId = "webrtcIndicator.controlSharingOn.menuitem";
|
||||
label = stream.browser.contentTitle || stream.uri;
|
||||
item.setAttribute("label", bundle.formatStringFromName(labelId, [label], 1));
|
||||
@ -957,7 +957,7 @@ function getGlobalIndicator() {
|
||||
_setIndicatorState(aName, aState) {
|
||||
let field = "_" + aName.toLowerCase();
|
||||
if (aState && !this[field]) {
|
||||
let menu = this._hiddenDoc.createElement("menu");
|
||||
let menu = this._hiddenDoc.createXULElement("menu");
|
||||
menu.setAttribute("id", "webRTC-sharing" + aName + "-menu");
|
||||
|
||||
// The CSS will only be applied if the menu is actually inserted in the DOM.
|
||||
@ -965,7 +965,7 @@ function getGlobalIndicator() {
|
||||
|
||||
this._statusBar.addItem(menu);
|
||||
|
||||
let menupopup = this._hiddenDoc.createElement("menupopup");
|
||||
let menupopup = this._hiddenDoc.createXULElement("menupopup");
|
||||
menupopup.setAttribute("type", aName);
|
||||
menupopup.addEventListener("popupshowing", this._popupShowing);
|
||||
menupopup.addEventListener("popuphiding", this._popupHiding);
|
||||
@ -1011,7 +1011,7 @@ function onTabSharingMenuPopupShowing(e) {
|
||||
let bundle = doc.defaultView.gNavigatorBundle;
|
||||
|
||||
let origin = getHostOrExtensionName(null, streamInfo.uri);
|
||||
let menuitem = doc.createElement("menuitem");
|
||||
let menuitem = doc.createXULElement("menuitem");
|
||||
menuitem.setAttribute("label", bundle.getFormattedString(stringName, [origin]));
|
||||
menuitem.stream = streamInfo;
|
||||
menuitem.addEventListener("command", onTabSharingMenuPopupCommand);
|
||||
@ -1033,7 +1033,7 @@ function showOrCreateMenuForWindow(aWindow) {
|
||||
let menu = document.getElementById("tabSharingMenu");
|
||||
if (!menu) {
|
||||
let stringBundle = aWindow.gNavigatorBundle;
|
||||
menu = document.createElement("menu");
|
||||
menu = document.createXULElement("menu");
|
||||
menu.id = "tabSharingMenu";
|
||||
let labelStringId = "getUserMedia.sharingMenu.label";
|
||||
menu.setAttribute("label", stringBundle.getString(labelStringId));
|
||||
@ -1042,7 +1042,7 @@ function showOrCreateMenuForWindow(aWindow) {
|
||||
if (AppConstants.platform == "macosx") {
|
||||
container = document.getElementById("windowPopup");
|
||||
insertionPoint = document.getElementById("sep-window-list");
|
||||
let separator = document.createElement("menuseparator");
|
||||
let separator = document.createXULElement("menuseparator");
|
||||
separator.id = "tabSharingSeparator";
|
||||
container.insertBefore(separator, insertionPoint);
|
||||
} else {
|
||||
@ -1051,7 +1051,7 @@ function showOrCreateMenuForWindow(aWindow) {
|
||||
container = document.getElementById("main-menubar");
|
||||
insertionPoint = document.getElementById("helpMenu");
|
||||
}
|
||||
let popup = document.createElement("menupopup");
|
||||
let popup = document.createXULElement("menupopup");
|
||||
popup.id = "tabSharingMenuPopup";
|
||||
popup.addEventListener("popupshowing", onTabSharingMenuPopupShowing);
|
||||
popup.addEventListener("popuphiding", onTabSharingMenuPopupHiding);
|
||||
|
@ -48,7 +48,7 @@ function l10n(key) {
|
||||
* @return XULMenuItemElement
|
||||
*/
|
||||
function createMenuItem({ doc, id, label, accesskey, isCheckbox }) {
|
||||
const menuitem = doc.createElement("menuitem");
|
||||
const menuitem = doc.createXULElement("menuitem");
|
||||
menuitem.id = id;
|
||||
menuitem.setAttribute("label", label);
|
||||
if (accesskey) {
|
||||
@ -214,7 +214,7 @@ function addTopLevelItems(doc) {
|
||||
const { menuitems } = require("../menus");
|
||||
for (const item of menuitems) {
|
||||
if (item.separator) {
|
||||
const separator = doc.createElement("menuseparator");
|
||||
const separator = doc.createXULElement("menuseparator");
|
||||
separator.id = item.id;
|
||||
menuItems.appendChild(separator);
|
||||
} else {
|
||||
|
@ -53,12 +53,12 @@ BottomHost.prototype = {
|
||||
const ownerDocument = gBrowser.ownerDocument;
|
||||
this._nbox = gBrowser.getNotificationBox(this.hostTab.linkedBrowser);
|
||||
|
||||
this._splitter = ownerDocument.createElement("splitter");
|
||||
this._splitter = ownerDocument.createXULElement("splitter");
|
||||
this._splitter.setAttribute("class", "devtools-horizontal-splitter");
|
||||
// Avoid resizing notification containers
|
||||
this._splitter.setAttribute("resizebefore", "flex");
|
||||
|
||||
this.frame = ownerDocument.createElement("iframe");
|
||||
this.frame = ownerDocument.createXULElement("iframe");
|
||||
this.frame.flex = 1; // Required to be able to shrink when the window shrinks
|
||||
this.frame.className = "devtools-toolbox-bottom-iframe";
|
||||
this.frame.height = Math.min(
|
||||
@ -141,10 +141,10 @@ class SidebarHost {
|
||||
this._browser = gBrowser.getBrowserContainer(this.hostTab.linkedBrowser);
|
||||
this._sidebar = gBrowser.getSidebarContainer(this.hostTab.linkedBrowser);
|
||||
|
||||
this._splitter = ownerDocument.createElement("splitter");
|
||||
this._splitter = ownerDocument.createXULElement("splitter");
|
||||
this._splitter.setAttribute("class", "devtools-side-splitter");
|
||||
|
||||
this.frame = ownerDocument.createElement("iframe");
|
||||
this.frame = ownerDocument.createXULElement("iframe");
|
||||
this.frame.flex = 1; // Required to be able to shrink when the window shrinks
|
||||
this.frame.className = "devtools-toolbox-side-iframe";
|
||||
|
||||
|
@ -999,7 +999,7 @@ Toolbox.prototype = {
|
||||
}
|
||||
const { toolId, shortcut, modifiers } = item;
|
||||
|
||||
const key = doc.createElement("key");
|
||||
const key = doc.createXULElement("key");
|
||||
|
||||
key.id = "key_" + toolId;
|
||||
|
||||
@ -1020,7 +1020,7 @@ Toolbox.prototype = {
|
||||
|
||||
// Add key for toggling the browser console from the detached window
|
||||
if (!doc.getElementById("key_browserconsole")) {
|
||||
const key = doc.createElement("key");
|
||||
const key = doc.createXULElement("key");
|
||||
key.id = "key_browserconsole";
|
||||
|
||||
key.setAttribute("key", L10N.getStr("browserConsoleCmd.commandkey"));
|
||||
@ -1440,7 +1440,7 @@ Toolbox.prototype = {
|
||||
if (!toolDefinition.bgTheme) {
|
||||
toolDefinition.bgTheme = "theme-toolbar";
|
||||
}
|
||||
const panel = this.doc.createElement("vbox");
|
||||
const panel = this.doc.createXULElement("vbox");
|
||||
panel.className = "toolbox-panel " + toolDefinition.bgTheme;
|
||||
|
||||
// There is already a container for the webconsole frame.
|
||||
@ -1650,7 +1650,7 @@ Toolbox.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
iframe = this.doc.createElement("iframe");
|
||||
iframe = this.doc.createXULElement("iframe");
|
||||
iframe.className = "toolbox-panel-iframe";
|
||||
iframe.id = "toolbox-panel-iframe-" + id;
|
||||
iframe.setAttribute("flex", 1);
|
||||
|
@ -2,7 +2,7 @@
|
||||
// addon-scope paths here.
|
||||
var ifr;
|
||||
function test() {
|
||||
ifr = document.createElement('iframe');
|
||||
ifr = document.createXULElement('iframe');
|
||||
document.getElementById('main-window').appendChild(ifr);
|
||||
is(ifr.contentDocument.nodePrincipal.origin, "[System Principal]");
|
||||
ifr.contentDocument.open();
|
||||
|
@ -59,7 +59,7 @@ function AddCertChain(node, chain) {
|
||||
*/
|
||||
function AddUsage(usage) {
|
||||
let verifyInfoBox = document.getElementById("verify_info_box");
|
||||
let text = document.createElement("textbox");
|
||||
let text = document.createXULElement("textbox");
|
||||
text.setAttribute("value", usage);
|
||||
text.setAttribute("style", "margin: 2px 5px");
|
||||
text.setAttribute("readonly", "true");
|
||||
@ -177,7 +177,7 @@ function displayUsages(results) {
|
||||
}
|
||||
|
||||
function addChildrenToTree(parentTree, label, value, addTwistie) {
|
||||
let treeChild1 = document.createElement("treechildren");
|
||||
let treeChild1 = document.createXULElement("treechildren");
|
||||
let treeElement = addTreeItemToTreeChild(treeChild1, label, value,
|
||||
addTwistie);
|
||||
parentTree.appendChild(treeChild1);
|
||||
@ -185,13 +185,13 @@ function addChildrenToTree(parentTree, label, value, addTwistie) {
|
||||
}
|
||||
|
||||
function addTreeItemToTreeChild(treeChild, label, value, addTwistie) {
|
||||
let treeElem1 = document.createElement("treeitem");
|
||||
let treeElem1 = document.createXULElement("treeitem");
|
||||
if (addTwistie) {
|
||||
treeElem1.setAttribute("container", "true");
|
||||
treeElem1.setAttribute("open", "true");
|
||||
}
|
||||
let treeRow = document.createElement("treerow");
|
||||
let treeCell = document.createElement("treecell");
|
||||
let treeRow = document.createXULElement("treerow");
|
||||
let treeCell = document.createXULElement("treecell");
|
||||
treeCell.setAttribute("label", label);
|
||||
if (value) {
|
||||
treeCell.setAttribute("display", value);
|
||||
|
@ -81,7 +81,7 @@ function onLoad() {
|
||||
let selectElement = document.getElementById("nicknames");
|
||||
certArray = window.arguments[4].QueryInterface(Ci.nsIArray);
|
||||
for (let i = 0; i < certArray.length; i++) {
|
||||
let menuItemNode = document.createElement("menuitem");
|
||||
let menuItemNode = document.createXULElement("menuitem");
|
||||
let cert = certArray.queryElementAt(i, Ci.nsIX509Cert);
|
||||
let nickAndSerial =
|
||||
bundle.getFormattedString("clientAuthNickAndSerial",
|
||||
|
@ -94,8 +94,8 @@ function onLoad() {
|
||||
let box = document.getElementById("certlist");
|
||||
let certTreeItems = window.arguments[1];
|
||||
for (let certTreeItem of certTreeItems) {
|
||||
let listItem = document.createElement("richlistitem");
|
||||
let label = document.createElement("label");
|
||||
let listItem = document.createXULElement("richlistitem");
|
||||
let label = document.createXULElement("label");
|
||||
label.setAttribute("value", certTreeItemToString(certTreeItem));
|
||||
listItem.appendChild(label);
|
||||
box.appendChild(listItem);
|
||||
|
@ -72,17 +72,17 @@ function SetFIPSButton() {
|
||||
*/
|
||||
function AddModule(module, slots) {
|
||||
var tree = document.getElementById("device_list");
|
||||
var item = document.createElement("treeitem");
|
||||
var row = document.createElement("treerow");
|
||||
var cell = document.createElement("treecell");
|
||||
var item = document.createXULElement("treeitem");
|
||||
var row = document.createXULElement("treerow");
|
||||
var cell = document.createXULElement("treecell");
|
||||
cell.setAttribute("label", module.name);
|
||||
row.appendChild(cell);
|
||||
item.appendChild(row);
|
||||
var parent = document.createElement("treechildren");
|
||||
var parent = document.createXULElement("treechildren");
|
||||
for (let slot of slots) {
|
||||
var child_item = document.createElement("treeitem");
|
||||
var child_row = document.createElement("treerow");
|
||||
var child_cell = document.createElement("treecell");
|
||||
var child_item = document.createXULElement("treeitem");
|
||||
var child_row = document.createXULElement("treerow");
|
||||
var child_cell = document.createXULElement("treecell");
|
||||
child_cell.setAttribute("label", slot.name);
|
||||
child_row.appendChild(child_cell);
|
||||
child_item.appendChild(child_row);
|
||||
@ -257,13 +257,13 @@ function showModuleInfo() {
|
||||
// add a row to the info list, as [col1 col2] (ex.: ["status" "logged in"])
|
||||
function AddInfoRow(col1, col2, cell_id) {
|
||||
var tree = document.getElementById("info_list");
|
||||
var item = document.createElement("treeitem");
|
||||
var row = document.createElement("treerow");
|
||||
var cell1 = document.createElement("treecell");
|
||||
var item = document.createXULElement("treeitem");
|
||||
var row = document.createXULElement("treerow");
|
||||
var cell1 = document.createXULElement("treecell");
|
||||
cell1.setAttribute("label", col1);
|
||||
cell1.setAttribute("crop", "never");
|
||||
row.appendChild(cell1);
|
||||
var cell2 = document.createElement("treecell");
|
||||
var cell2 = document.createXULElement("treecell");
|
||||
cell2.setAttribute("label", col2);
|
||||
cell2.setAttribute("crop", "never");
|
||||
cell2.setAttribute("id", cell_id);
|
||||
|
@ -77,15 +77,15 @@ AppPicker.prototype =
|
||||
continue;
|
||||
}
|
||||
|
||||
var item = document.createElement("richlistitem");
|
||||
var item = document.createXULElement("richlistitem");
|
||||
item.handlerApp = file;
|
||||
list.appendChild(item);
|
||||
|
||||
var image = document.createElement("image");
|
||||
var image = document.createXULElement("image");
|
||||
image.setAttribute("src", this.getFileIconURL(file.executable));
|
||||
item.appendChild(image);
|
||||
|
||||
var label = document.createElement("label");
|
||||
var label = document.createXULElement("label");
|
||||
label.setAttribute("value", this.getFileDisplayName(file.executable));
|
||||
item.appendChild(label);
|
||||
|
||||
|
@ -239,7 +239,7 @@ add_task(async function test_popup_url() {
|
||||
"darktext should not be set!");
|
||||
|
||||
// Calculate what GrayText should be. May differ between platforms.
|
||||
let span = document.createElement("span");
|
||||
let span = document.createXULElement("span");
|
||||
span.style.color = "GrayText";
|
||||
let GRAY_TEXT = window.getComputedStyle(span).color;
|
||||
|
||||
|
@ -173,12 +173,12 @@ var Heartbeat = class {
|
||||
// Build the heartbeat stars
|
||||
if (!this.options.engagementButtonLabel) {
|
||||
const numStars = this.options.engagementButtonLabel ? 0 : 5;
|
||||
const ratingContainer = this.chromeWindow.document.createElement("hbox");
|
||||
const ratingContainer = this.chromeWindow.document.createXULElement("hbox");
|
||||
ratingContainer.id = "star-rating-container";
|
||||
|
||||
for (let i = 0; i < numStars; i++) {
|
||||
// create a star rating element
|
||||
const ratingElement = this.chromeWindow.document.createElement("toolbarbutton");
|
||||
const ratingElement = this.chromeWindow.document.createXULElement("toolbarbutton");
|
||||
|
||||
// style it
|
||||
const starIndex = numStars - i;
|
||||
@ -209,7 +209,7 @@ var Heartbeat = class {
|
||||
this.messageText.classList.add("heartbeat");
|
||||
|
||||
// Make sure the stars are not pushed to the right by the spacer.
|
||||
const rightSpacer = this.chromeWindow.document.createElement("spacer");
|
||||
const rightSpacer = this.chromeWindow.document.createXULElement("spacer");
|
||||
rightSpacer.flex = 20;
|
||||
frag.appendChild(rightSpacer);
|
||||
|
||||
@ -220,7 +220,7 @@ var Heartbeat = class {
|
||||
|
||||
// Add Learn More Link
|
||||
if (this.options.learnMoreMessage && this.options.learnMoreUrl) {
|
||||
const learnMore = this.chromeWindow.document.createElement("label");
|
||||
const learnMore = this.chromeWindow.document.createXULElement("label");
|
||||
learnMore.className = "text-link";
|
||||
learnMore.href = this.options.learnMoreUrl.toString();
|
||||
learnMore.setAttribute("value", this.options.learnMoreMessage);
|
||||
|
@ -41,7 +41,7 @@ var LoginManagerContextMenu = {
|
||||
let fragment = browser.ownerDocument.createDocumentFragment();
|
||||
let duplicateUsernames = this._findDuplicates(foundLogins);
|
||||
for (let login of foundLogins) {
|
||||
let item = fragment.ownerDocument.createElement("menuitem");
|
||||
let item = fragment.ownerDocument.createXULElement("menuitem");
|
||||
|
||||
let username = login.username;
|
||||
// If login is empty or duplicated we want to append a modification date to it.
|
||||
|
@ -73,6 +73,7 @@ function createLoginsFragment(url, content, elementQuery) {
|
||||
MockDocument.mockOwnerDocumentProperty(inputElement, document, url);
|
||||
|
||||
// We also need a simple mock Browser object for this test.
|
||||
document.createXULElement = document.createElement.bind(document);
|
||||
let browser = {
|
||||
ownerDocument: document
|
||||
};
|
||||
|
@ -71,7 +71,7 @@
|
||||
popup = document.getElementById(popupId);
|
||||
}
|
||||
if (!popup) {
|
||||
popup = document.createElement("panel");
|
||||
popup = document.createXULElement("panel");
|
||||
popup.setAttribute("type", "autocomplete-richlistbox");
|
||||
popup.setAttribute("noautofocus", "true");
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
<getter>
|
||||
let frame = this.querySelector("#dateTimePopupFrame");
|
||||
if (!frame) {
|
||||
frame = this.ownerDocument.createElement("iframe");
|
||||
frame = this.ownerDocument.createXULElement("iframe");
|
||||
frame.id = "dateTimePopupFrame";
|
||||
this.appendChild(frame);
|
||||
}
|
||||
|
@ -1618,7 +1618,7 @@
|
||||
|
||||
const label = tt.label || "";
|
||||
const ttText = document.createTextNode(label);
|
||||
const ttBtn = document.createElement("button");
|
||||
const ttBtn = document.createXULElement("button");
|
||||
|
||||
ttBtn.classList.add("textTrackItem");
|
||||
ttBtn.setAttribute("index", tt.index);
|
||||
|
@ -143,7 +143,7 @@ InlineSpellChecker.prototype = {
|
||||
break;
|
||||
this.mSpellSuggestions.push(suggestion);
|
||||
|
||||
var item = menu.ownerDocument.createElement("menuitem");
|
||||
var item = menu.ownerDocument.createXULElement("menuitem");
|
||||
this.mSuggestionItems.push(item);
|
||||
item.setAttribute("label", suggestion);
|
||||
item.setAttribute("value", suggestion);
|
||||
@ -213,7 +213,7 @@ InlineSpellChecker.prototype = {
|
||||
|
||||
for (var i = 0; i < sortedList.length; i++) {
|
||||
this.mDictionaryNames.push(sortedList[i].id);
|
||||
var item = menu.ownerDocument.createElement("menuitem");
|
||||
var item = menu.ownerDocument.createXULElement("menuitem");
|
||||
item.setAttribute("id", "spell-check-dictionary-" + sortedList[i].id);
|
||||
item.setAttribute("label", sortedList[i].label);
|
||||
item.setAttribute("type", "radio");
|
||||
|
@ -105,7 +105,7 @@ PageMenu.prototype = {
|
||||
continue; // Ignore children without ids
|
||||
}
|
||||
|
||||
menuitem = document.createElement("menuitem");
|
||||
menuitem = document.createXULElement("menuitem");
|
||||
if (child.checkbox) {
|
||||
menuitem.setAttribute("type", "checkbox");
|
||||
if (child.checked) {
|
||||
@ -127,16 +127,16 @@ PageMenu.prototype = {
|
||||
break;
|
||||
|
||||
case "separator":
|
||||
menuitem = document.createElement("menuseparator");
|
||||
menuitem = document.createXULElement("menuseparator");
|
||||
break;
|
||||
|
||||
case "menu":
|
||||
menuitem = document.createElement("menu");
|
||||
menuitem = document.createXULElement("menu");
|
||||
if (child.label) {
|
||||
menuitem.setAttribute("label", child.label);
|
||||
}
|
||||
|
||||
let menupopup = document.createElement("menupopup");
|
||||
let menupopup = document.createXULElement("menupopup");
|
||||
menuitem.appendChild(menupopup);
|
||||
|
||||
this.buildXULMenu(child, menupopup);
|
||||
|
@ -342,7 +342,7 @@ function populateChildren(menulist, options, selectedIndex, zoom,
|
||||
|
||||
for (let option of options) {
|
||||
let isOptGroup = (option.tagName == "OPTGROUP");
|
||||
let item = element.ownerDocument.createElement(isOptGroup ? "menucaption" : "menuitem");
|
||||
let item = element.ownerDocument.createXULElement(isOptGroup ? "menucaption" : "menuitem");
|
||||
|
||||
item.setAttribute("label", option.textContent);
|
||||
item.style.direction = option.textDirection;
|
||||
@ -449,7 +449,7 @@ function populateChildren(menulist, options, selectedIndex, zoom,
|
||||
&& element.childElementCount > SEARCH_MINIMUM_ELEMENTS) {
|
||||
|
||||
// Add a search text field as the first element of the dropdown
|
||||
let searchbox = element.ownerDocument.createElement("textbox");
|
||||
let searchbox = element.ownerDocument.createXULElement("textbox");
|
||||
searchbox.setAttribute("type", "search");
|
||||
searchbox.addEventListener("input", onSearchInput);
|
||||
searchbox.addEventListener("focus", onSearchFocus);
|
||||
|
@ -30,7 +30,7 @@ function init() {
|
||||
var list = gArgs.list;
|
||||
list.sort((a, b) => String(a.name).localeCompare(b.name));
|
||||
for (let listItem of list) {
|
||||
let item = document.createElement("richlistitem");
|
||||
let item = document.createXULElement("richlistitem");
|
||||
item.setAttribute("name", listItem.name);
|
||||
item.setAttribute("version", listItem.version);
|
||||
item.setAttribute("icon", listItem.icon);
|
||||
|
@ -1446,7 +1446,7 @@ function shouldShowVersionNumber(aAddon) {
|
||||
}
|
||||
|
||||
function createItem(aObj, aIsInstall) {
|
||||
let item = document.createElement("richlistitem");
|
||||
let item = document.createXULElement("richlistitem");
|
||||
|
||||
item.setAttribute("class", "addon addon-view");
|
||||
item.setAttribute("name", aObj.name);
|
||||
@ -1704,7 +1704,7 @@ var gCategories = {
|
||||
if (document.getElementById("category-" + aId))
|
||||
return;
|
||||
|
||||
var category = document.createElement("richlistitem");
|
||||
var category = document.createXULElement("richlistitem");
|
||||
category.setAttribute("id", "category-" + aId);
|
||||
category.setAttribute("value", aView);
|
||||
category.setAttribute("class", "category");
|
||||
@ -3019,10 +3019,10 @@ var gDetailView = {
|
||||
stack.remove();
|
||||
}
|
||||
|
||||
stack = document.createElement("stack");
|
||||
stack = document.createXULElement("stack");
|
||||
stack.setAttribute("id", containerId);
|
||||
|
||||
let browser = document.createElement("browser");
|
||||
let browser = document.createXULElement("browser");
|
||||
browser.setAttribute("type", "content");
|
||||
browser.setAttribute("disableglobalhistory", "true");
|
||||
browser.setAttribute("id", "addon-options");
|
||||
|
@ -38,10 +38,10 @@ var FontBuilder = {
|
||||
this._allFonts = await this.enumerator.EnumerateAllFontsAsync({});
|
||||
|
||||
// Build the UI for the Default Font and Fonts for this CSS type.
|
||||
const popup = document.createElement("menupopup");
|
||||
const popup = document.createXULElement("menupopup");
|
||||
let separator;
|
||||
if (fonts.length > 0) {
|
||||
let menuitem = document.createElement("menuitem");
|
||||
let menuitem = document.createXULElement("menuitem");
|
||||
if (defaultFont) {
|
||||
document.l10n.setAttributes(menuitem, "fonts-label-default", {
|
||||
name: defaultFont
|
||||
@ -52,11 +52,11 @@ var FontBuilder = {
|
||||
menuitem.setAttribute("value", ""); // Default Font has a blank value
|
||||
popup.appendChild(menuitem);
|
||||
|
||||
separator = document.createElement("menuseparator");
|
||||
separator = document.createXULElement("menuseparator");
|
||||
popup.appendChild(separator);
|
||||
|
||||
for (let font of fonts) {
|
||||
menuitem = document.createElement("menuitem");
|
||||
menuitem = document.createXULElement("menuitem");
|
||||
menuitem.setAttribute("value", font);
|
||||
menuitem.setAttribute("label", font);
|
||||
popup.appendChild(menuitem);
|
||||
@ -72,12 +72,12 @@ var FontBuilder = {
|
||||
let builtItem = separator ? separator.nextSibling : popup.firstChild;
|
||||
let builtItemValue = builtItem ? builtItem.getAttribute("value") : null;
|
||||
|
||||
separator = document.createElement("menuseparator");
|
||||
separator = document.createXULElement("menuseparator");
|
||||
popup.appendChild(separator);
|
||||
|
||||
for (let font of this._allFonts) {
|
||||
if (font != builtItemValue) {
|
||||
const menuitem = document.createElement("menuitem");
|
||||
const menuitem = document.createXULElement("menuitem");
|
||||
menuitem.setAttribute("value", font);
|
||||
menuitem.setAttribute("label", font);
|
||||
popup.appendChild(menuitem);
|
||||
|
Loading…
Reference in New Issue
Block a user