Bug 1393478 - Fix subsection search in about:telemetry r?chutten draft
authorflyingrub <flyinggrub@gmail.com>
Tue, 29 Aug 2017 16:20:36 +0200
changeset 655361 21eda0f6bdee0d45cf939f3a104a6052c51cebf9
parent 655360 cc327b369db87f1b63f47cc6b318e3a649dd2ea7
child 728812 aa13650f6d943d2c00ca075e88e8d275f0825443
push id76850
push userbmo:flyinggrub@gmail.com
push dateTue, 29 Aug 2017 22:37:30 +0000
reviewerschutten
bugs1393478
milestone57.0a1
Bug 1393478 - Fix subsection search in about:telemetry r?chutten Allow to search for the section's name and fix useless margin in search. MozReview-Commit-ID: HwCXq0tUct5
toolkit/content/aboutTelemetry.css
toolkit/content/aboutTelemetry.js
--- a/toolkit/content/aboutTelemetry.css
+++ b/toolkit/content/aboutTelemetry.css
@@ -246,18 +246,24 @@ body[dir="rtl"] .histogram {
 .histogram-stats {
   font-size: 13px;
 }
 
 .keyed-histogram {
   white-space: nowrap;
   position: relative; /* required for position:absolute of the contained .copy-node */
   overflow: hidden;
+  margin-bottom: 1em;
 }
 
+.keyed-scalar, .sub-section {
+  margin-bottom: 1em;
+}
+
+
 .keyed-title {
   text-overflow: ellipsis;
   margin: 12px 0;
   font-size: 17px;
   white-space: nowrap;
 }
 
 .bar {
@@ -288,17 +294,16 @@ th, td, table {
   word-break: break-all;
   border-collapse: collapse;
 }
 
 table {
   table-layout: fixed;
   width: 100%;
   font-size: 15px;
-  margin-bottom: 2em;
 }
 
 td {
   padding-bottom: 0.25em;
   border-bottom: 1px solid var(--in-content-box-border-color);
 }
 
 tr:not(:first-child):hover {
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -1430,16 +1430,24 @@ var Search = {
     } else if (section.id === "keyed-scalars-section") {
       let keyedElements = [];
       let keyedScalars = section.getElementsByClassName("keyed-scalar");
       for (let key of keyedScalars) {
         let datas = key.querySelector("table").rows;
         keyedElements.push({key, datas});
       }
       noSearchResults = this.filterKeyedElements(keyedElements, text);
+    } else if (section.querySelector(".sub-section")) {
+      let keyedSubSections = [];
+      let subsections = section.querySelectorAll(".sub-section");
+      for (let section of subsections) {
+        let datas = section.querySelector("table").rows
+        keyedSubSections.push({section, datas});
+      }
+      noSearchResults = this.filterKeyedElements(keyedSubSections, text);
     } else {
       let tables = section.querySelectorAll("table");
       for (let table of tables) {
         noSearchResults = this.filterElements(table.rows, text);
         if (table.caption) {
           table.caption.hidden = noSearchResults;
         }
       }