mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1802411 - Set disabled state on the action button for extension widgets. r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D163100
This commit is contained in:
parent
c2c8c4709e
commit
28ef9c8b3c
@ -897,9 +897,9 @@ this.browserAction = class extends ExtensionAPIPersistent {
|
||||
}
|
||||
|
||||
if (tabData.enabled) {
|
||||
node.removeAttribute("disabled");
|
||||
button.removeAttribute("disabled");
|
||||
} else {
|
||||
node.setAttribute("disabled", "true");
|
||||
button.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
let serializeColor = ([r, g, b, a]) =>
|
||||
|
@ -164,7 +164,7 @@ async function runTests(options) {
|
||||
is(button.getAttribute("label"), title, "image label is correct");
|
||||
is(button.getAttribute("badge"), details.badge, "badge text is correct");
|
||||
is(
|
||||
node.getAttribute("disabled") == "true",
|
||||
button.getAttribute("disabled") == "true",
|
||||
!details.enabled,
|
||||
"disabled state is correct"
|
||||
);
|
||||
|
@ -192,8 +192,9 @@ add_task(async function testBrowserActionDisabled() {
|
||||
let browserAction = browserActionFor(ext);
|
||||
|
||||
let widget = getBrowserActionWidget(extension).forWindow(window);
|
||||
let button = widget.node.firstElementChild;
|
||||
|
||||
is(widget.node.getAttribute("disabled"), "true", "Button is disabled");
|
||||
is(button.getAttribute("disabled"), "true", "Button is disabled");
|
||||
is(browserAction.pendingPopup, null, "Have no pending popup prior to click");
|
||||
|
||||
// Test canceled click.
|
||||
|
Loading…
Reference in New Issue
Block a user