Bug 1403593 - Change containers preference page to use command instead of click r?jaws
MozReview-Commit-ID: 95f9yOLVof5
--- a/browser/components/preferences/handlers.xml
+++ b/browser/components/preferences/handlers.xml
@@ -77,22 +77,22 @@
<xul:hbox flex="1" align="center">
<xul:hbox xbl:inherits="data-identity-icon=containerIcon,data-identity-color=containerColor" height="24" width="24" class="userContext-icon"/>
<xul:label flex="1" crop="end" xbl:inherits="xbl:text=containerName,highlightable"/>
</xul:hbox>
<xul:hbox flex="1" align="right">
<xul:button anonid="preferencesButton"
label="&preferencesButton.label;"
xbl:inherits="value=userContextId"
- onclick="gContainersPane.onPreferenceClick(event.originalTarget)">
+ oncommand="gContainersPane.onPreferenceCommand(event.originalTarget)">
</xul:button>
<xul:button anonid="removeButton"
label="&removeButton.label;"
xbl:inherits="value=userContextId"
- onclick="gContainersPane.onRemoveClick(event.originalTarget)">
+ oncommand="gContainersPane.onRemoveCommand(event.originalTarget)">
</xul:button>
</xul:hbox>
</xul:hbox>
</content>
</binding>
<binding id="offlineapp"
extends="chrome://global/content/bindings/listbox.xml#listitem">
--- a/browser/components/preferences/in-content/containers.js
+++ b/browser/components/preferences/in-content/containers.js
@@ -35,17 +35,17 @@ let gContainersPane = {
item.setAttribute("containerIcon", container.icon);
item.setAttribute("containerColor", container.color);
item.setAttribute("userContextId", container.userContextId);
this._list.appendChild(item);
}
},
- async onRemoveClick(button) {
+ async onRemoveCommand(button) {
let userContextId = parseInt(button.getAttribute("value"), 10);
let count = ContextualIdentityService.countContainerTabs(userContextId);
if (count > 0) {
let bundlePreferences = document.getElementById("bundlePreferences");
let title = bundlePreferences.getString("removeContainerAlertTitle");
let message = PluralForm.get(count, bundlePreferences.getString("removeContainerMsg"))
@@ -64,21 +64,21 @@ let gContainersPane = {
await ContextualIdentityService.closeContainerTabs(userContextId);
}
ContextualIdentityService.remove(userContextId);
this._rebuildView();
},
- onPreferenceClick(button) {
+ onPreferenceCommand(button) {
this.openPreferenceDialog(button.getAttribute("value"));
},
- onAddButtonClick(button) {
+ onAddButtonCommand(button) {
this.openPreferenceDialog(null);
},
openPreferenceDialog(userContextId) {
let identity = {
name: "",
icon: defaultContainerIcon,
color: defaultContainerColor
--- a/browser/components/preferences/in-content/containers.xul
+++ b/browser/components/preferences/in-content/containers.xul
@@ -34,12 +34,12 @@
<vbox id="browserContainersbox">
<richlistbox id="containersView" orient="vertical" persist="lastSelectedType"
flex="1">
</richlistbox>
</vbox>
<vbox>
<hbox flex="1">
- <button id="containersAdd" onclick="gContainersPane.onAddButtonClick();" accesskey="&addButton.accesskey;" label="&addButton.label;"/>
+ <button id="containersAdd" oncommand="gContainersPane.onAddButtonCommand();" accesskey="&addButton.accesskey;" label="&addButton.label;"/>
</hbox>
</vbox>
</groupbox>
--- a/browser/components/preferences/in-content/tests/browser_containers_name_input.js
+++ b/browser/components/preferences/in-content/tests/browser_containers_name_input.js
@@ -9,17 +9,17 @@ add_task(async function setup() {
add_task(async function() {
async function openDialog() {
let doc = gBrowser.selectedBrowser.contentDocument;
let dialogPromise = promiseLoadSubDialog(CONTAINERS_URL);
let addButton = doc.getElementById("containersAdd");
- addButton.click();
+ addButton.doCommand();
let dialog = await dialogPromise;
return dialog.document;
}
let doc = await openDialog();