mozilla-kde.patch
changeset 916 2f9f2e040647
parent 909 c6717354928b
child 918 0f93e8da34b6
--- a/mozilla-kde.patch	Tue Jun 07 21:44:20 2016 +0200
+++ b/mozilla-kde.patch	Wed Jun 08 13:45:00 2016 +0200
@@ -1,5 +1,5 @@
 # HG changeset patch
-# Parent  61cdc9af8ceaf75083e751e0d6497feddc26f7ba
+# Parent  f2726ebfae7cdded8e7ca6030829b0a3fae4e438
 Description: Add KDE integration to Firefox (toolkit parts)
 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
 Author: Lubos Lunak <lunak@suse.com>
@@ -27,7 +27,7 @@
  #include "prefread.h"
  #include "prefapi_private_data.h"
  
-@@ -1135,16 +1136,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
+@@ -1138,16 +1139,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
  
  static nsresult pref_LoadPrefsInDirList(const char *listId)
  {
@@ -62,7 +62,7 @@
      return NS_OK;
  
    bool hasMore;
-@@ -1160,17 +1179,17 @@ static nsresult pref_LoadPrefsInDirList(
+@@ -1163,17 +1182,17 @@ static nsresult pref_LoadPrefsInDirList(
  
      nsAutoCString leaf;
      path->GetNativeLeafName(leaf);
@@ -81,7 +81,7 @@
  {
    nsZipItemPtr<char> manifest(jarReader, name, true);
    NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
-@@ -1264,24 +1283,36 @@ static nsresult pref_InitInitialObjects(
+@@ -1267,24 +1286,36 @@ static nsresult pref_InitInitialObjects(
    /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
    static const char* specialFiles[] = {
  #if defined(XP_MACOSX)
@@ -325,7 +325,7 @@
 +          xmlns="http://www.mozilla.org/xbl"
 +          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
 +          xmlns:xbl="http://www.mozilla.org/xbl">
-+  
++
 +  <binding id="dialog" extends="chrome://global/content/bindings/general.xml#root-element">
 +    <resources>
 +      <stylesheet src="chrome://global/skin/dialog.css"/>
@@ -334,10 +334,10 @@
 +      <xul:vbox class="box-inherit dialog-content-box" flex="1">
 +        <children/>
 +      </xul:vbox>
-+          
++
 +      <xul:hbox class="dialog-button-box" anonid="buttons"
 +                xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient"
-+#ifdef XP_UNIX_GNOME
++#ifdef XP_UNIX
 +                >
 +        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
 +        <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
@@ -349,12 +349,12 @@
 +#elif XP_UNIX
 +                >
 +        <xul:button dlgtype="help" class="dialog-button" hidden="true"/>
-+	<xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
-+	<xul:spacer anonid="spacer" flex="1"/>
-+	<xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
-+	<xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
-+	<xul:button dlgtype="cancel" class="dialog-button"/>
-+	<xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
++        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
++        <xul:spacer anonid="spacer" flex="1"/>
++        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
++        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
++        <xul:button dlgtype="cancel" class="dialog-button"/>
++        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
 +#else
 +                pack="end">
 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
@@ -403,7 +403,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="cancelDialog">
 +        <body>
 +        <![CDATA[
@@ -411,7 +411,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="getButton">
 +        <parameter name="aDlgType"/>
 +        <body>
@@ -462,7 +462,7 @@
 +        <![CDATA[
 +          var xOffset = screen.availWidth/2 - window.outerWidth/2;
 +          var yOffset = screen.availHeight/2 - window.outerHeight/2; //(opener.outerHeight *2)/10;
-+  
++
 +          xOffset = xOffset > 0 ? xOffset : 0;
 +          yOffset = yOffset > 0 ? yOffset : 0;
 +          window.moveTo(xOffset, yOffset);
@@ -534,7 +534,7 @@
 +          setTimeout(focusInit, 0);
 +        ]]>
 +        </body>
-+      </method>                
++      </method>
 +
 +      <property name="mStrBundle">
 +        <getter>
@@ -549,7 +549,7 @@
 +          return this._mStrBundle;
 +        ]]></getter>
 +      </property>
-+      
++
 +      <method name="_configureButtons">
 +        <parameter name="aButtons"/>
 +        <body>
@@ -621,7 +621,7 @@
 +
 +          // ensure that hitting enter triggers the default button command
 +          this.defaultButton = this.defaultButton;
-+          
++
 +          // if there is a special button configuration, use it
 +          if (aButtons) {
 +            // expect a comma delimited list of dlgtype values
@@ -634,7 +634,7 @@
 +              shown[list[i].replace(/ /g, "")] = true;
 +
 +            // hide/show the buttons we want
-+            for (dlgtype in buttons) 
++            for (dlgtype in buttons)
 +              buttons[dlgtype].hidden = !shown[dlgtype];
 +
 +            let { AppConstants } =
@@ -682,7 +682,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="_doButtonCommand">
 +        <parameter name="aDlgType"/>
 +        <body>
@@ -706,17 +706,17 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="_fireButtonEvent">
 +        <parameter name="aDlgType"/>
 +        <body>
 +        <![CDATA[
 +          var event = document.createEvent("Events");
 +          event.initEvent("dialog"+aDlgType, true, true);
-+          
++
 +          // handle dom event handlers
 +          var noCancel = this.dispatchEvent(event);
-+          
++
 +          // handle any xml attribute event handlers
 +          var handler = this.getAttribute("ondialog"+aDlgType);
 +          if (handler != "") {
@@ -725,7 +725,7 @@
 +            if (returned == false)
 +              noCancel = false;
 +          }
-+          
++
 +          return noCancel;
 +        ]]>
 +        </body>
@@ -746,7 +746,7 @@
 +      </method>
 +
 +    </implementation>
-+    
++
 +    <handlers>
 +      <handler event="keypress" keycode="VK_RETURN"
 +               group="system" action="this._hitEnter(event);"/>
@@ -782,7 +782,7 @@
 new file mode 100644
 --- /dev/null
 +++ b/toolkit/content/widgets/preferences-kde.xml
-@@ -0,0 +1,1406 @@
+@@ -0,0 +1,1408 @@
 +<?xml version="1.0"?>
 +
 +<!DOCTYPE bindings [
@@ -849,7 +849,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="fireChangedEvent">
 +        <parameter name="aPreference"/>
 +        <body>
@@ -866,7 +866,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <field name="service">
 +        Components.classes["@mozilla.org/preferences-service;1"]
 +                  .getService(Components.interfaces.nsIPrefService);
@@ -916,11 +916,11 @@
 +            .addObserver(this.name, this.preferences, false);
 +        // In non-instant apply mode, we must try and use the last saved state
 +        // from any previous opens of a child dialog instead of the value from
-+        // preferences, to pick up any edits a user may have made. 
++        // preferences, to pick up any edits a user may have made.
 +
 +        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
 +                    .getService(Components.interfaces.nsIScriptSecurityManager);
-+        if (this.preferences.type == "child" && 
++        if (this.preferences.type == "child" &&
 +            !this.instantApply && window.opener &&
 +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
 +          var pdoc = window.opener.document;
@@ -961,13 +961,13 @@
 +        <setter>
 +          if (val == this.name)
 +            return val;
-+            
++
 +          this.preferences.rootBranchInternal
 +              .removeObserver(this.name, this.preferences);
 +          this.setAttribute('name', val);
 +          this.preferences.rootBranchInternal
 +              .addObserver(val, this.preferences, false);
-+              
++
 +          return val;
 +        </setter>
 +      </property>
@@ -994,20 +994,20 @@
 +        </body>
 +      </method>
 +      <property name="value" onget="return this._value" onset="return this._setValue(val);"/>
-+      
++
 +      <property name="locked">
 +        <getter>
 +          return this.preferences.rootBranch.prefIsLocked(this.name);
 +        </getter>
 +      </property>
-+      
++
 +      <property name="disabled">
 +        <getter>
 +          return this.getAttribute("disabled") == "true";
 +        </getter>
 +        <setter>
 +        <![CDATA[
-+          if (val) 
++          if (val)
 +            this.setAttribute("disabled", "true");
 +          else
 +            this.removeAttribute("disabled");
@@ -1018,24 +1018,24 @@
 +          var elements = document.getElementsByAttribute("preference", this.id);
 +          for (var i = 0; i < elements.length; ++i) {
 +            elements[i].disabled = val;
-+            
++
 +            var labels = document.getElementsByAttribute("control", elements[i].id);
 +            for (var j = 0; j < labels.length; ++j)
 +              labels[j].disabled = val;
 +          }
-+            
++
 +          return val;
 +        ]]>
 +        </setter>
 +      </property>
-+      
++
 +      <property name="tabIndex">
 +        <getter>
 +          return parseInt(this.getAttribute("tabindex"));
 +        </getter>
 +        <setter>
 +        <![CDATA[
-+          if (val) 
++          if (val)
 +            this.setAttribute("tabindex", val);
 +          else
 +            this.removeAttribute("tabindex");
@@ -1046,12 +1046,12 @@
 +          var elements = document.getElementsByAttribute("preference", this.id);
 +          for (var i = 0; i < elements.length; ++i) {
 +            elements[i].tabIndex = val;
-+            
++
 +            var labels = document.getElementsByAttribute("control", elements[i].id);
 +            for (var j = 0; j < labels.length; ++j)
 +              labels[j].tabIndex = val;
 +          }
-+            
++
 +          return val;
 +        ]]>
 +        </setter>
@@ -1065,7 +1065,7 @@
 +        ]]>
 +        </getter>
 +      </property>
-+      
++
 +      <method name="reset">
 +        <body>
 +          // defer reset until preference update
@@ -1073,7 +1073,7 @@
 +        </body>
 +      </method>
 +
-+      <field name="_useDefault">false</field>      
++      <field name="_useDefault">false</field>
 +      <property name="defaultValue">
 +        <getter>
 +        <![CDATA[
@@ -1084,27 +1084,27 @@
 +        ]]>
 +        </getter>
 +      </property>
-+      
++
 +      <property name="_branch">
 +        <getter>
 +          return this._useDefault ? this.preferences.defaultBranch : this.preferences.rootBranch;
 +        </getter>
 +      </property>
-+      
++
 +      <field name="batching">false</field>
-+      
++
 +      <method name="_reportUnknownType">
 +        <body>
 +        <![CDATA[
 +          var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
 +                                         .getService(Components.interfaces.nsIConsoleService);
-+          var msg = "<preference> with id='" + this.id + "' and name='" + 
++          var msg = "<preference> with id='" + this.id + "' and name='" +
 +                    this.name + "' has unknown type '" + this.type + "'.";
 +          consoleService.logStringMessage(msg);
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <property name="valueFromPreferences">
 +        <getter>
 +        <![CDATA[
@@ -1189,7 +1189,7 @@
 +              if (!lf.exists())
 +                lf.initWithPath(val);
 +            }
-+            else 
++            else
 +              lf = val.QueryInterface(Components.interfaces.nsILocalFile);
 +            this.preferences.rootBranch
 +                .setComplexValue(this.name, Components.interfaces.nsILocalFile, lf);
@@ -1203,7 +1203,7 @@
 +        ]]>
 +        </setter>
 +      </property>
-+      
++
 +      <method name="setElementValue">
 +        <parameter name="aElement"/>
 +        <body>
@@ -1220,7 +1220,7 @@
 +            try {
 +              var event = document.createEvent("Events");
 +              event.initEvent("syncfrompreference", true, true);
-+              var f = new Function ("event", 
++              var f = new Function ("event",
 +                                    aElement.getAttribute("onsyncfrompreference"));
 +              rv = f.call(aElement, event);
 +            }
@@ -1228,20 +1228,22 @@
 +              Components.utils.reportError(e);
 +            }
 +          }
-+          var val = rv !== undefined ? rv : (this.instantApply ? this.valueFromPreferences : this.value);
++          var val = rv;
++          if (val === undefined)
++            val = this.instantApply ? this.valueFromPreferences : this.value;
 +          // if the preference is marked for reset, show default value in UI
 +          if (val === undefined)
 +            val = this.defaultValue;
 +
 +          /**
-+           * Initialize a UI element property with a value. Handles the case 
++           * Initialize a UI element property with a value. Handles the case
 +           * where an element has not yet had a XBL binding attached for it and
 +           * the property setter does not yet exist by setting the same attribute
-+           * on the XUL element using DOM apis and assuming the element's 
-+           * constructor or property getters appropriately handle this state. 
++           * on the XUL element using DOM apis and assuming the element's
++           * constructor or property getters appropriately handle this state.
 +           */
 +          function setValue(element, attribute, value) {
-+            if (attribute in element) 
++            if (attribute in element)
 +              element[attribute] = value;
 +            else
 +              element.setAttribute(attribute, value);
@@ -1273,19 +1275,19 @@
 +            try {
 +              var event = document.createEvent("Events");
 +              event.initEvent("synctopreference", true, true);
-+              var f = new Function ("event", 
++              var f = new Function ("event",
 +                                    aElement.getAttribute("onsynctopreference"));
 +              var rv = f.call(aElement, event);
-+              if (rv !== undefined) 
++              if (rv !== undefined)
 +                return rv;
 +            }
 +            catch (e) {
 +              Components.utils.reportError(e);
 +            }
 +          }
-+          
++
 +          /**
-+           * Read the value of an attribute from an element, assuming the 
++           * Read the value of an attribute from an element, assuming the
 +           * attribute is a property on the element's node API. If the property
 +           * is not present in the API, then assume its value is contained in
 +           * an attribute, as is the case before a binding has been attached.
@@ -1313,7 +1315,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="isElementEditable">
 +        <parameter name="aElement"/>
 +        <body>
@@ -1329,26 +1331,26 @@
 +            return true;
 +          }
 +          return aElement.getAttribute("preference-editable") == "true";
-+        ]]> 
++        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="updateElements">
 +        <body>
 +        <![CDATA[
 +          if (!this.id)
 +            return;
 +
-+          // This "change" event handler tracks changes made to preferences by 
-+          // sources other than the user in this window. 
++          // This "change" event handler tracks changes made to preferences by
++          // sources other than the user in this window.
 +          var elements = document.getElementsByAttribute("preference", this.id);
-+          for (var i = 0; i < elements.length; ++i) 
++          for (var i = 0; i < elements.length; ++i)
 +            this.setElementValue(elements[i]);
 +        ]]>
 +        </body>
 +      </method>
 +    </implementation>
-+    
++
 +    <handlers>
 +      <handler event="change">
 +        this.updateElements();
@@ -1423,7 +1425,7 @@
 +              // no buttons on Mac except Help
 +              cancelButton.hidden = true;
 +              // Move Help button to the end
-+              document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;         
++              document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
 +              // Also, don't fire onDialogAccept on enter
 +              acceptButton.disabled = true;
 +            } else {
@@ -1500,26 +1502,26 @@
 +                onget="return document.getAnonymousElementByAttribute(this, 'class', 'paneDeckContainer');"/>
 +      <property name="_selector"
 +                onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'selector');"/>
-+      <property name="lastSelected" 
++      <property name="lastSelected"
 +                onget="return this.getAttribute('lastSelected');">
 +        <setter>
-+          this.setAttribute("lastSelected", val); 
++          this.setAttribute("lastSelected", val);
 +          document.persist(this.id, "lastSelected");
 +          return val;
-+        </setter>          
++        </setter>
 +      </property>
 +      <property name="currentPane"
 +                onset="return this._currentPane = val;">
 +        <getter>
 +          if (!this._currentPane)
 +            this._currentPane = this.preferencePanes[0];
-+          
++
 +          return this._currentPane;
-+        </getter> 
++        </getter>
 +      </property>
 +      <field name="_currentPane">null</field>
-+      
-+      
++
++
 +      <method name="_makePaneButton">
 +        <parameter name="aPaneElement"/>
 +        <body>
@@ -1551,16 +1553,16 @@
 +            {
 +              this._pane = aPane;
 +            }
-+            OverlayLoadObserver.prototype = { 
++            OverlayLoadObserver.prototype = {
 +              _outer: this,
-+              observe: function (aSubject, aTopic, aData) 
++              observe: function (aSubject, aTopic, aData)
 +              {
 +                this._pane.loaded = true;
 +                this._outer._fireEvent("paneload", this._pane);
 +                this._outer._selectPane(this._pane);
 +              }
 +            };
-+            
++
 +            var obs = new OverlayLoadObserver(aPaneElement);
 +            document.loadOverlay(aPaneElement.src, obs);
 +          }
@@ -1569,13 +1571,13 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="_fireEvent">
 +        <parameter name="aEventName"/>
 +        <parameter name="aTarget"/>
 +        <body>
 +        <![CDATA[
-+          // Panel loaded, synthesize a load event. 
++          // Panel loaded, synthesize a load event.
 +          try {
 +            var event = document.createEvent("Events");
 +            event.initEvent(aEventName, true, true);
@@ -1586,16 +1588,16 @@
 +              if (rv == false)
 +                cancel = true;
 +            }
-+            return !cancel;  
++            return !cancel;
 +          }
-+          catch (e) { 
++          catch (e) {
 +            Components.utils.reportError(e);
 +          }
 +          return false;
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <field name="_initialized">false</field>
 +      <method name="_selectPane">
 +        <parameter name="aPaneElement"/>
@@ -1614,13 +1616,13 @@
 +          else
 +            helpButton.hidden = true;
 +
-+          // Find this pane's index in the deck and set the deck's 
++          // Find this pane's index in the deck and set the deck's
 +          // selectedIndex to that value to switch to it.
 +          var prefpanes = this.preferencePanes;
 +          for (var i = 0; i < prefpanes.length; ++i) {
 +            if (prefpanes[i] == aPaneElement) {
 +              this._paneDeck.selectedIndex = i;
-+              
++
 +              if (this.type != "child") {
 +                if (aPaneElement.hasAttribute("flex") && this._shouldAnimate &&
 +                    prefpanes.length > 1)
@@ -1673,7 +1675,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <property name="_shouldAnimate">
 +        <getter>
 +        <![CDATA[
@@ -1690,7 +1692,7 @@
 +        ]]>
 +        </getter>
 +      </property>
-+      
++
 +      <method name="animate">
 +        <parameter name="aOldPane"/>
 +        <parameter name="aNewPane"/>
@@ -1698,7 +1700,7 @@
 +        <![CDATA[
 +          // if we are already resizing, use currentHeight
 +          var oldHeight = this._currentHeight ? this._currentHeight : aOldPane.contentHeight;
-+          
++
 +          this._multiplier = aNewPane.contentHeight > oldHeight ? 1 : -1;
 +          var sizeDelta = Math.abs(oldHeight - aNewPane.contentHeight);
 +          this._animateRemainder = sizeDelta % this._animateIncrement;
@@ -1707,7 +1709,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <property name="_sizeIncrement">
 +        <getter>
 +        <![CDATA[
@@ -1717,7 +1719,7 @@
 +          if ((this._multiplier > 0 && this._currentHeight >= lastSelectedPane.contentHeight) ||
 +              (this._multiplier < 0 && this._currentHeight <= lastSelectedPane.contentHeight))
 +            return 0;
-+          
++
 +          if ((this._multiplier > 0 && newHeight > lastSelectedPane.contentHeight) ||
 +              (this._multiplier < 0 && newHeight < lastSelectedPane.contentHeight))
 +            increment = this._animateRemainder * this._multiplier;
@@ -1725,14 +1727,14 @@
 +        ]]>
 +        </getter>
 +      </property>
-+      
++
 +      <method name="notify">
 +        <parameter name="aTimer"/>
 +        <body>
 +        <![CDATA[
 +          if (!document)
 +            aTimer.cancel();
-+          
++
 +          if (aTimer == this._animateTimer) {
 +            var increment = this._sizeIncrement;
 +            if (increment != 0) {
@@ -1756,39 +1758,39 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="_setUpAnimationTimer">
 +        <parameter name="aStartHeight"/>
 +        <body>
 +        <![CDATA[
-+          if (!this._animateTimer) 
++          if (!this._animateTimer)
 +            this._animateTimer = Components.classes["@mozilla.org/timer;1"]
 +                                           .createInstance(Components.interfaces.nsITimer);
 +          else
 +            this._animateTimer.cancel();
 +          this._currentHeight = aStartHeight;
-+          
-+          this._animateTimer.initWithCallback(this, this._animateDelay, 
++
++          this._animateTimer.initWithCallback(this, this._animateDelay,
 +                                              Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="_setUpFadeTimer">
 +        <body>
 +        <![CDATA[
-+          if (!this._fadeTimer) 
++          if (!this._fadeTimer)
 +            this._fadeTimer = Components.classes["@mozilla.org/timer;1"]
 +                                        .createInstance(Components.interfaces.nsITimer);
 +          else
 +            this._fadeTimer.cancel();
-+          
-+          this._fadeTimer.initWithCallback(this, this._fadeDelay, 
++
++          this._fadeTimer.initWithCallback(this, this._fadeDelay,
 +                                           Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <field name="_animateTimer">null</field>
 +      <field name="_fadeTimer">null</field>
 +      <field name="_animateDelay">15</field>
@@ -1804,13 +1806,13 @@
 +        <body>
 +        <![CDATA[
 +          this.appendChild(aPaneElement);
-+          
++
 +          // Set up pane button
 +          this._makePaneButton(aPaneElement);
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <method name="openSubDialog">
 +        <parameter name="aURL"/>
 +        <parameter name="aFeatures"/>
@@ -1819,7 +1821,7 @@
 +          return openDialog(aURL, "", "modal,centerscreen,resizable=no" + (aFeatures != "" ? ("," + aFeatures) : ""), aParams);
 +        </body>
 +      </method>
-+      
++
 +      <method name="openWindow">
 +        <parameter name="aWindowType"/>
 +        <parameter name="aURL"/>
@@ -1856,29 +1858,29 @@
 +                    .getService(Components.interfaces.nsIScriptSecurityManager);
 +        if (this.type == "child" && window.opener &&
 +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
-+          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
++          let psvc = Components.classes["@mozilla.org/preferences-service;1"]
 +                               .getService(Components.interfaces.nsIPrefBranch);
 +          var pdocEl = window.opener.document.documentElement;
 +          if (pdocEl.instantApply) {
-+            var panes = this.preferencePanes;
-+            for (var i = 0; i < panes.length; ++i)
++            let panes = this.preferencePanes;
++            for (let i = 0; i < panes.length; ++i)
 +              panes[i].writePreferences(true);
 +          }
 +          else {
 +            // Clone all the preferences elements from the child document and
-+            // insert them into the pane collection of the parent. 
++            // insert them into the pane collection of the parent.
 +            var pdoc = window.opener.document;
 +            if (pdoc.documentElement.localName == "prefwindow") {
 +              var currentPane = pdoc.documentElement.currentPane;
 +              var id = window.location.href + "#childprefs";
 +              var childPrefs = pdoc.getElementById(id);
 +              if (!childPrefs) {
-+                var childPrefs = pdoc.createElement("preferences");
++                childPrefs = pdoc.createElement("preferences");
 +                currentPane.appendChild(childPrefs);
 +                childPrefs.id = id;
 +              }
-+              var panes = this.preferencePanes;
-+              for (var i = 0; i < panes.length; ++i) {
++              let panes = this.preferencePanes;
++              for (let i = 0; i < panes.length; ++i) {
 +                var preferences = panes[i].preferences;
 +                for (var j = 0; j < preferences.length; ++j) {
 +                  // Try to find a preference element for the same preference.
@@ -1909,11 +1911,11 @@
 +          }
 +        }
 +        else {
-+          var panes = this.preferencePanes;
++          let panes = this.preferencePanes;
 +          for (var i = 0; i < panes.length; ++i)
 +            panes[i].writePreferences(false);
 +
-+          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
++          let psvc = Components.classes["@mozilla.org/preferences-service;1"]
 +                               .getService(Components.interfaces.nsIPrefService);
 +          psvc.savePrefFile(null);
 +        }
@@ -1955,7 +1957,7 @@
 +      </handler>
 +    </handlers>
 +  </binding>
-+  
++
 +  <binding id="prefpane">
 +    <resources>
 +      <stylesheet src="chrome://global/skin/preferences.css"/>
@@ -1990,20 +1992,20 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
-+      <property name="src" 
++
++      <property name="src"
 +                onget="return this.getAttribute('src');"
 +                onset="this.setAttribute('src', val); return val;"/>
-+      <property name="selected" 
++      <property name="selected"
 +                onget="return this.getAttribute('selected') == 'true';"
 +                onset="this.setAttribute('selected', val); return val;"/>
-+      <property name="image" 
++      <property name="image"
 +                onget="return this.getAttribute('image');"
 +                onset="this.setAttribute('image', val); return val;"/>
-+      <property name="label" 
++      <property name="label"
 +                onget="return this.getAttribute('label');"
 +                onset="this.setAttribute('label', val); return val;"/>
-+      
++
 +      <property name="preferenceElements"
 +                onget="return this.getElementsByAttribute('preference', '*');"/>
 +      <property name="preferences"
@@ -2027,30 +2029,30 @@
 +      </property>
 +
 +      <field name="_loaded">false</field>
-+      <property name="loaded" 
++      <property name="loaded"
 +                onget="return !this.src ? true : this._loaded;"
 +                onset="this._loaded = val; return val;"/>
-+      
++
 +      <method name="preferenceForElement">
 +        <parameter name="aElement"/>
 +        <body>
 +          return document.getElementById(aElement.getAttribute("preference"));
 +        </body>
 +      </method>
-+      
++
 +      <method name="getPreferenceElement">
 +        <parameter name="aStartElement"/>
 +        <body>
 +        <![CDATA[
 +          var temp = aStartElement;
-+          while (temp && temp.nodeType == Node.ELEMENT_NODE && 
++          while (temp && temp.nodeType == Node.ELEMENT_NODE &&
 +                 !temp.hasAttribute("preference"))
 +            temp = temp.parentNode;
 +          return temp.nodeType == Node.ELEMENT_NODE ? temp : aStartElement;
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <field name="DeferredTask" readonly="true">
 +        let targetObj = {};
 +        Components.utils.import("resource://gre/modules/DeferredTask.jsm", targetObj);
@@ -2106,7 +2108,7 @@
 +        ]]>
 +        </body>
 +      </method>
-+      
++
 +      <property name="contentHeight">
 +        <getter>
 +          var targetHeight = parseInt(window.getComputedStyle(this._content, "").height);
@@ -2121,25 +2123,25 @@
 +    </implementation>
 +    <handlers>
 +      <handler event="command">
-+        // This "command" event handler tracks changes made to preferences by 
++        // This "command" event handler tracks changes made to preferences by
 +        // the user in this window.
 +        if (event.sourceEvent)
 +          event = event.sourceEvent;
 +        this.userChangedValue(event.target);
 +      </handler>
 +      <handler event="select">
-+        // This "select" event handler tracks changes made to colorpicker 
++        // This "select" event handler tracks changes made to colorpicker
 +        // preferences by the user in this window.
-+        if (event.target.localName == "colorpicker") 
++        if (event.target.localName == "colorpicker")
 +          this.userChangedValue(event.target);
 +      </handler>
 +      <handler event="change">
-+        // This "change" event handler tracks changes made to preferences by 
-+        // the user in this window. 
++        // This "change" event handler tracks changes made to preferences by
++        // the user in this window.
 +        this.userChangedValue(event.target);
 +      </handler>
 +      <handler event="input">
-+        // This "input" event handler tracks changes made to preferences by 
++        // This "input" event handler tracks changes made to preferences by
 +        // the user in this window.
 +        this.userChangedValue(event.target);
 +      </handler>
@@ -2156,11 +2158,11 @@
 +            dump("*** No preference found for " + elements[i].getAttribute("preference") + "\n");
 +          }
 +        }
-+      ]]>      
++      ]]>
 +      </handler>
 +    </handlers>
 +  </binding>
-+          
++
 +  <binding id="panebutton" role="xul:listitem"
 +           extends="chrome://global/content/bindings/radio.xml#radio">
 +    <resources>