Bug 1389165 - Cleanup html markup of about:telemtry r?gfritzsche draft
authorflyingrub <flyinggrub@gmail.com>
Fri, 11 Aug 2017 15:06:52 +0200
changeset 644897 4b9baa0da8b85d9f2227431f70b0f40195a45b86
parent 644768 56bbdd0d6c4fe04a5d40818d4f1fdd4eaa4baba5
child 725739 d3025f8c72fd97016bcf3e9e331bf9e76bde334c
push id73578
push userbmo:flyinggrub@gmail.com
push dateFri, 11 Aug 2017 13:12:01 +0000
reviewersgfritzsche
bugs1389165
milestone57.0a1
Bug 1389165 - Cleanup html markup of about:telemtry 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
@@ -938,17 +938,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) {
@@ -972,17 +972,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));
 
@@ -1018,17 +1018,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>