Bug 1423564 - Correctly set disabled and checked states of custom history pref checkboxes. r=johannh

This seemed to be working before by a fluke:
> Before bug 1375870, _constructAfterChildren was getting called several times,
  resulting in change events triggering updatePrivacyMicroControls repeatedly.
> updatePrivacyMicroControls was using the auto-private-browsing checkbox to
  decide whether to disable and hide the checkmarks of the other checkboxes.
> After bug 1375870, at the point when updatePrivacyMicroControls is called,
  the preference value has not yet propagated to the auto-private-browsing
  checkbox, so uPMC doesn't work correctly and is not called again.

Solution: use the actual preference value in uPMC.

MozReview-Commit-ID: 2AhRQwkjH5Q

--HG--
extra : rebase_source : dfcea62d925d019b880e87bc0f1551e78d756e9e
This commit is contained in:
Nihanth Subramanya 2017-12-06 16:03:14 -08:00
parent a2359f420f
commit c25da1b83c

View File

@ -496,7 +496,7 @@ var gPrivacyPane = {
updatePrivacyMicroControls() {
if (document.getElementById("historyMode").value == "custom") {
let disabled = this._autoStartPrivateBrowsing =
document.getElementById("privateBrowsingAutoStart").checked;
document.getElementById("browser.privatebrowsing.autostart").value;
this.dependentControls.forEach(function(aElement) {
let control = document.getElementById(aElement);
let preferenceId = control.getAttribute("preference");