summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/moz-button-group/moz-button-group.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /toolkit/content/widgets/moz-button-group/moz-button-group.mjs
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/content/widgets/moz-button-group/moz-button-group.mjs')
-rw-r--r--toolkit/content/widgets/moz-button-group/moz-button-group.mjs25
1 files changed, 16 insertions, 9 deletions
diff --git a/toolkit/content/widgets/moz-button-group/moz-button-group.mjs b/toolkit/content/widgets/moz-button-group/moz-button-group.mjs
index 8bf553c23d..6858367ab7 100644
--- a/toolkit/content/widgets/moz-button-group/moz-button-group.mjs
+++ b/toolkit/content/widgets/moz-button-group/moz-button-group.mjs
@@ -50,15 +50,22 @@ export default class MozButtonGroup extends MozLitElement {
// Text nodes won't support classList or getAttribute.
continue;
}
- // Bug 1791816: These should check moz-button instead of button.
- if (
- child.localName == "button" &&
- (child.classList.contains("primary") ||
- child.getAttribute("type") == "submit" ||
- child.hasAttribute("autofocus") ||
- child.hasAttribute("default"))
- ) {
- child.slot = "primary";
+ switch (child.localName) {
+ case "button":
+ if (
+ child.classList.contains("primary") ||
+ child.getAttribute("type") == "submit" ||
+ child.hasAttribute("autofocus") ||
+ child.hasAttribute("default")
+ ) {
+ child.slot = "primary";
+ }
+ break;
+ case "moz-button":
+ if (child.type == "primary" || child.type == "destructive") {
+ child.slot = "primary";
+ }
+ break;
}
}
this.#reorderLightDom();