Bug 1453227 - set 'checked' attribute to 'true' to appease checkbox and listitem-checkbox bindings. r?sfoster
MozReview-Commit-ID: WTYYwFIaBO
--- a/toolkit/content/preferencesBindings.js
+++ b/toolkit/content/preferencesBindings.js
@@ -360,18 +360,19 @@ const Preferences = window.Preferences =
function setValue(element, attribute, value) {
if (attribute in element) {
element[attribute] = value;
} else if (attribute === "checked") {
// The "checked" attribute can't simply be set to the specified value;
// it has to be set if the value is true and removed if the value
// is false in order to be interpreted correctly by the element.
if (value) {
- // We can set it to anything; convention is to set it to itself.
- element.setAttribute(attribute, attribute);
+ // In theory we can set it to anything; however xbl implementations
+ // of `checkbox` and `listitem` only work with "true".
+ element.setAttribute(attribute, "true");
} else {
element.removeAttribute(attribute);
}
} else {
element.setAttribute(attribute, value);
}
}
if (aElement.localName == "checkbox" ||