Bug 1516448 - Remove the "categories-list" binding. r=bgrins
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Sun, 30 Dec 2018 11:51:03 +0000
changeset 509343 9781b1970089c2186ab5b3ffa79532f2e0bc0a0f
parent 509342 c1a87fe81d16a114e8df100a1ee9ce29a90f275d
child 509344 3ab044c93118276fac2854d0a6c8762b32b36bd2
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1516448
milestone66.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 1516448 - Remove the "categories-list" binding. r=bgrins Differential Revision: https://phabricator.services.mozilla.com/D15499
toolkit/content/widgets/richlistbox.xml
toolkit/mozapps/extensions/content/extensions.css
toolkit/mozapps/extensions/content/extensions.xml
toolkit/themes/shared/extensions/extensions.inc.css
--- a/toolkit/content/widgets/richlistbox.xml
+++ b/toolkit/content/widgets/richlistbox.xml
@@ -737,17 +737,18 @@
         </body>
       </method>
 
       <method name="_canUserSelect">
         <parameter name="aItem"/>
         <body>
         <![CDATA[
           var style = document.defaultView.getComputedStyle(aItem);
-          return style.display != "none" && style.visibility == "visible";
+          return style.display != "none" && style.visibility == "visible" &&
+                 style.MozUserInput != "none";
         ]]>
         </body>
       </method>
 
       <method name="_selectTimeoutHandler">
         <parameter name="aMe"/>
         <body>
           aMe._fireOnSelect();
--- a/toolkit/mozapps/extensions/content/extensions.css
+++ b/toolkit/mozapps/extensions/content/extensions.css
@@ -4,20 +4,16 @@
 
 @namespace xhtml "http://www.w3.org/1999/xhtml";
 
 /* HTML link elements do weird things to the layout if they are not hidden */
 xhtml|link {
   display: none;
 }
 
-#categories {
-  -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#categories-list");
-}
-
 .category {
   -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#category");
 }
 
 .sidebar-footer-button > .text-link {
   margin-top: 0;
   margin-bottom: 0;
 }
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -199,38 +199,16 @@
       <method name="cancel">
         <body><![CDATA[
           this.mInstall.cancel();
         ]]></body>
       </method>
     </implementation>
   </binding>
 
-  <!-- Categories list - displays the list of categories on the left pane. -->
-  <binding id="categories-list"
-           extends="chrome://global/content/bindings/richlistbox.xml#richlistbox">
-    <implementation>
-      <!-- This needs to be overridden to allow the fancy animation while not
-           allowing that item to be selected when hiding.  -->
-      <method name="_canUserSelect">
-        <parameter name="aItem"/>
-        <body>
-        <![CDATA[
-          if (aItem.hasAttribute("disabled") &&
-              aItem.getAttribute("disabled") == "true")
-            return false;
-          var style = document.defaultView.getComputedStyle(aItem);
-          return style.display != "none" && style.visibility == "visible";
-        ]]>
-        </body>
-      </method>
-    </implementation>
-  </binding>
-
-
   <!-- Category item - an item in the category list. -->
   <binding id="category"
            extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
     <content align="center">
       <xul:image anonid="icon" class="category-icon"/>
       <xul:label anonid="name" class="category-name" crop="end" flex="1" xbl:inherits="value=name"/>
       <xul:label anonid="badge" class="category-badge" xbl:inherits="value=count"/>
     </content>
--- a/toolkit/themes/shared/extensions/extensions.inc.css
+++ b/toolkit/themes/shared/extensions/extensions.inc.css
@@ -155,16 +155,17 @@ button.warning {
 
 #categories > .category[disabled] {
   overflow: hidden;
   height: 0;
   min-height: 0;
   opacity: 0;
   transition-property: min-height, opacity;
   transition-duration: 1s, 0.8s;
+  -moz-user-input: none; /* Prevents list item selection during animation. */
 }
 
 #categories > .category:not([disabled]) {
   transition-property: min-height, opacity;
   transition-duration: 1s, 0.8s;
 }
 
 /* Maximize the size of the viewport when the window is small */