Bug 1453227 - set 'checked' attribute to 'true' to appease checkbox and listitem-checkbox bindings. r=jaws,sfoster
authorHector Zhao <bzhao@mozilla.com>
Wed, 18 Apr 2018 11:06:36 +0800
changeset 467903 afa738308f06b47127a4f3d0ee5c3478b669faaf
parent 467902 582de61479ed9c5f82a145492f7134dbdf7a94c7
child 467904 98845151aee3e3873adf0d49a7e7df0c1762c0ce
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, sfoster
bugs1453227
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1453227 - set 'checked' attribute to 'true' to appease checkbox and listitem-checkbox bindings. r=jaws,sfoster MozReview-Commit-ID: WTYYwFIaBO
toolkit/content/preferencesBindings.js
--- 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" ||