Bug 1389165 - Cleanup html markup of about:telemetry r?gfritzsche draft
authorflyingrub <flyinggrub@gmail.com>
Fri, 11 Aug 2017 15:06:52 +0200
changeset 644902 e3ff0b0fec3f1982b66614f104ee1dea7c53ed68
parent 644901 ed947d75128fe59a1fe8575914a2a44d7cbc506e
child 725742 9bd2553cb211d9ad93b6d018c0d733b709d09115
push id73581
push userbmo:flyinggrub@gmail.com
push dateFri, 11 Aug 2017 13:18:13 +0000
reviewersgfritzsche
bugs1389165
milestone57.0a1
Bug 1389165 - Cleanup html markup of about:telemetry r?gfritzsche Prepare the code for the search on the home page. This will allow to display only the div with the "data" class and not have cluttered results. MozReview-Commit-ID: 5CtMPrLGJT7
toolkit/content/aboutTelemetry.js
toolkit/content/aboutTelemetry.xhtml
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -941,17 +941,17 @@ var StackRenderer = {
     let stackText = " " + aStack.join(" ");
     aDiv.appendChild(document.createTextNode(stackText));
 
     aDiv.appendChild(document.createElement("br"));
     aDiv.appendChild(document.createElement("br"));
   },
   renderStacks: function StackRenderer_renderStacks(aPrefix, aStacks,
                                                     aMemoryMap, aRenderHeader) {
-    let div = document.getElementById(aPrefix + "-data");
+    let div = document.getElementById(aPrefix);
     removeAllChildNodes(div);
 
     let fetchE = document.getElementById(aPrefix + "-fetch-symbols");
     if (fetchE) {
       fetchE.hidden = false;
     }
     let hideE = document.getElementById(aPrefix + "-hide-symbols");
     if (hideE) {
@@ -975,17 +975,17 @@ var StackRenderer = {
 
   /**
    * Renders the title of the stack: e.g. "Late Write #1" or
    * "Hang Report #1 (6 seconds)".
    *
    * @param aFormatArgs formating args to be passed to formatStringFromName.
    */
   renderHeader: function StackRenderer_renderHeader(aPrefix, aFormatArgs) {
-    let div = document.getElementById(aPrefix + "-data");
+    let div = document.getElementById(aPrefix);
 
     let titleElement = document.createElement("span");
     titleElement.className = "stack-title";
 
     let titleText = bundle.formatStringFromName(
       aPrefix + "-title", aFormatArgs, aFormatArgs.length);
     titleElement.appendChild(document.createTextNode(titleText));
 
@@ -1010,17 +1010,17 @@ SymbolicationRequest.prototype.handleSym
 function SymbolicationRequest_handleSymbolResponse() {
   if (this.symbolRequest.readyState != 4)
     return;
 
   let fetchElement = document.getElementById(this.prefix + "-fetch-symbols");
   fetchElement.hidden = true;
   let hideElement = document.getElementById(this.prefix + "-hide-symbols");
   hideElement.hidden = false;
-  let div = document.getElementById(this.prefix + "-data");
+  let div = document.getElementById(this.prefix);
   removeAllChildNodes(div);
   let errorMessage = bundle.GetStringFromName("errorFetchingSymbols");
 
   if (this.symbolRequest.status != 200) {
     div.appendChild(document.createTextNode(errorMessage));
     return;
   }
 
--- a/toolkit/content/aboutTelemetry.xhtml
+++ b/toolkit/content/aboutTelemetry.xhtml
@@ -189,52 +189,37 @@
 
       <section id="slow-sql-section">
         <div id="slow-sql-tables" class="data">
           <p id="sql-warning" class="hidden">&aboutTelemetry.fullSqlWarning;</p>
         </div>
       </section>
 
       <section id="chrome-hangs-section">
-        <div id="chrome-hangs" class="data">
-          <a id="chrome-hangs-fetch-symbols" href="">&aboutTelemetry.fetchStackSymbols;</a>
-          <a id="chrome-hangs-hide-symbols" class="hidden" href="">&aboutTelemetry.hideStackSymbols;</a>
-          <br/>
-          <br/>
-          <div id="chrome-hangs-data">
-          </div>
-        </div>
+        <a id="chrome-hangs-fetch-symbols" href="">&aboutTelemetry.fetchStackSymbols;</a>
+        <a id="chrome-hangs-hide-symbols" class="hidden" href="">&aboutTelemetry.hideStackSymbols;</a>
+        <div id="chrome-hangs" class="data"></div>
       </section>
 
       <section id="thread-hang-stats-section">
         <div id="thread-hang-stats" class="data"></div>
       </section>
 
       <section id="late-writes-section">
-        <div id="late-writes" class="data">
-          <a id="late-writes-fetch-symbols" href="">&aboutTelemetry.fetchStackSymbols;</a>
-          <a id="late-writes-hide-symbols" class="hidden" href="">&aboutTelemetry.hideStackSymbols;</a>
-          <br/>
-          <br/>
-          <div id="late-writes-data">
-          </div>
-        </div>
+        <a id="late-writes-fetch-symbols" href="">&aboutTelemetry.fetchStackSymbols;</a>
+        <a id="late-writes-hide-symbols" class="hidden" href="">&aboutTelemetry.hideStackSymbols;</a>
+        <div id="late-writes" class="data"></div>
       </section>
 
       <section id="addon-details-section">
         <div id="addon-details" class="data"></div>
       </section>
 
       <section id="captured-stacks-section">
-        <div id="captured-stacks" class="data">
-          <a id="captured-stacks-fetch-symbols" href="">&aboutTelemetry.fetchStackSymbols;</a>
-          <a id="captured-stacks-hide-symbols" class="hidden" href="">&aboutTelemetry.hideStackSymbols;</a>
-          <br/>
-          <br/>
-          <div id="captured-stacks-data">
-          </div>
-        </div>
+        <a id="captured-stacks-fetch-symbols" href="">&aboutTelemetry.fetchStackSymbols;</a>
+        <a id="captured-stacks-hide-symbols" class="hidden" href="">&aboutTelemetry.hideStackSymbols;</a>
+        <div id="captured-stacks" class="data"></div>
       </section>
     </div>
 
   </body>
 
 </html>