Bug 1438511 - Copy top window's uidensity attribute in sidebarUtils.js instead of forcing gUIDensity.update(). r=florian draft
authorNihanth Subramanya <nhnt11@gmail.com>
Thu, 15 Feb 2018 19:59:13 +0530
changeset 756721 e21d8f8ab9c6e035a98f6ffdf90ab640c5d19973
parent 756720 878f733204cfcea79590975a3b3b93e365b7963c
push id99529
push usernhnt11@gmail.com
push dateSat, 17 Feb 2018 13:20:22 +0000
reviewersflorian
bugs1438511
milestone60.0a1
Bug 1438511 - Copy top window's uidensity attribute in sidebarUtils.js instead of forcing gUIDensity.update(). r=florian MozReview-Commit-ID: Ljwn5iyV37V
browser/components/places/content/sidebarUtils.js
--- a/browser/components/places/content/sidebarUtils.js
+++ b/browser/components/places/content/sidebarUtils.js
@@ -1,14 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-window.top.gUIDensity.update();
+
+let uidensity = window.top.document.documentElement.getAttribute("uidensity");
+if (uidensity) {
+  document.documentElement.setAttribute("uidensity", uidensity);
+}
 
 var SidebarUtils = {
   handleTreeClick: function SU_handleTreeClick(aTree, aEvent, aGutterSelect) {
     // right-clicks are not handled here
     if (aEvent.button == 2)
       return;
 
     var tbo = aTree.treeBoxObject;