Bug 1372583 - Hide about:preferences#containers panel in search result r?jaws draft
authorRicky Chien <ricky060709@gmail.com>
Wed, 14 Jun 2017 23:09:51 +0800
changeset 597040 2abe043bdb0566aeacbea90195b125c8205c0573
parent 597026 416c3c8c4b3db9ba96a103ce7820c9a140a3051d
child 634115 210a75734521f499ac69c714426ccc22115a875e
push id64806
push userbmo:rchien@mozilla.com
push dateTue, 20 Jun 2017 02:01:56 +0000
reviewersjaws
bugs1372583
milestone56.0a1
Bug 1372583 - Hide about:preferences#containers panel in search result r?jaws MozReview-Commit-ID: Fv3W3qqXsTt
browser/components/preferences/in-content-new/containers.xul
browser/components/preferences/in-content-new/preferences.js
--- a/browser/components/preferences/in-content-new/containers.xul
+++ b/browser/components/preferences/in-content-new/containers.xul
@@ -24,17 +24,18 @@
 <hbox id="header-containers"
       class="header"
       hidden="true"
       data-category="paneContainers">
   <label class="header-name" flex="1">&paneContainers.title;</label>
 </hbox>
 
 <!-- Containers -->
-<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true">
+<groupbox id="browserContainersGroupPane" data-category="paneContainers" hidden="true"
+          data-hidden-from-search="true" data-subpanel="true">
   <vbox id="browserContainersbox">
 
     <richlistbox id="containersView" orient="vertical" persist="lastSelectedType"
                  flex="1">
       <listheader equalsize="always">
           <treecol id="typeColumn" value="type"
                    persist="sortDirection"
                    flex="1" sortDirection="ascending"/>
--- a/browser/components/preferences/in-content-new/preferences.js
+++ b/browser/components/preferences/in-content-new/preferences.js
@@ -216,17 +216,18 @@ function gotoPref(aCategory) {
 function search(aQuery, aAttribute, aSubquery, aSubAttribute) {
   let mainPrefPane = document.getElementById("mainPrefPane");
   let elements = mainPrefPane.children;
   for (let element of elements) {
     // If the "data-hidden-from-search" is "true", the
     // element will not get considered during search. This
     // should only be used when an element is still under
     // development and should not be shown for any reason.
-    if (element.getAttribute("data-hidden-from-search") != "true") {
+    if (element.getAttribute("data-hidden-from-search") != "true" ||
+        element.getAttribute("data-subpanel") == "true") {
       let attributeValue = element.getAttribute(aAttribute);
       if (attributeValue == aQuery) {
         if (!element.classList.contains("header") &&
              aSubquery && aSubAttribute) {
           let subAttributeValue = element.getAttribute(aSubAttribute);
           element.hidden = subAttributeValue != aSubquery;
         } else {
           element.hidden = false;