Bug 1534336 - pass fluent IDs directly and pass text nodes in cases where we pass literal strings, r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 13 Mar 2019 05:13:58 +0000
changeset 521703 956e0ebc41ad
parent 521702 8130ba1701bb
child 521704 c97013ec665b
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1534336
milestone67.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 1534336 - pass fluent IDs directly and pass text nodes in cases where we pass literal strings, r=jaws Differential Revision: https://phabricator.services.mozilla.com/D23190
toolkit/content/aboutSupport.js
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -284,17 +284,17 @@ var snapshotFormatters = {
       }
 
       return out;
     };
 
     // Create a <tr> element with key and value columns.
     //
     // @key      Text in the key column. Localized automatically, unless starts with "#".
-    // @value    Text in the value column. Not localized.
+    // @value    Fluent ID for text in the value column, or array of children.
     function buildRow(key, value) {
       let title = key[0] == "#" ? key.substr(1) : key;
       let keyStrId = toFluentID(key);
       let valueStrId = Array.isArray(value) ? null : toFluentID(value);
       let td = $.new("td", value);
       td.style["white-space"] = "pre-wrap";
       if (valueStrId) {
         document.l10n.setAttributes(td, valueStrId);
@@ -442,18 +442,18 @@ var snapshotFormatters = {
     delete data.windowLayerManagerType;
     delete data.numTotalWindows;
     delete data.numAcceleratedWindows;
     delete data.numAcceleratedWindowsMessage;
     delete data.windowUsingAdvancedLayers;
 
     addRow("features", "asyncPanZoom",
            apzInfo.length
-           ? (await document.l10n.formatValues(apzInfo.map(id => { return {id}; }))).join("; ")
-           : await localizedMsg("apz-none"));
+           ? [new Text((await document.l10n.formatValues(apzInfo.map(id => { return {id}; }))).join("; "))]
+           : "apz-none");
     let featureKeys = [
       "webgl1WSIInfo",
       "webgl1Renderer",
       "webgl1Version",
       "webgl1DriverExtensions",
       "webgl1Extensions",
       "webgl2WSIInfo",
       "webgl2Renderer",
@@ -582,17 +582,17 @@ var snapshotFormatters = {
         addRow("decisions", "#" + feature.name, [$.new("table", trs)]);
       }
     } else {
       $("graphics-decisions-tbody").style.display = "none";
     }
 
     if (featureLog.fallbacks.length) {
       for (let fallback of featureLog.fallbacks) {
-        addRow("workarounds", fallback.name, fallback.message);
+        addRow("workarounds", fallback.name, [new Text(fallback.message)]);
       }
     } else {
       $("graphics-workarounds-tbody").style.display = "none";
     }
 
     let crashGuards = data.crashGuards;
     delete data.crashGuards;
 
@@ -613,17 +613,17 @@ var snapshotFormatters = {
     } else {
       $("graphics-crashguards-tbody").style.display = "none";
     }
 
     // Now that we're done, grab any remaining keys in data and drop them into
     // the diagnostics section.
     for (let key in data) {
       let value = data[key];
-      addRow("diagnostics", key, value);
+      addRow("diagnostics", key, [new Text(value)]);
     }
   },
 
   media(data) {
     function insertBasicInfo(key, value) {
       function createRow(key, value) {
         let th = $.new("th", null, "column");
         document.l10n.setAttributes(th, key);