Repository: GoogleChrome/lighthouse
Pull request #9629 (2019-08-31 16:37:01)

misc(viewer): fix favicon typo
an extra `data:image/png;base64,` slipped in


Patch:
diff --git a/lighthouse-core/audits/accessibility/aria-required-children.js b/lighthouse-core/audits/accessibility/aria-required-children.js
index 6ae9c4bd7..3cab36526 100644
--- a/lighthouse-core/audits/accessibility/aria-required-children.js
+++ b/lighthouse-core/audits/accessibility/aria-required-children.js
@@ -16,10 +16,11 @@ const i18n = require('../../lib/i18n/i18n.js');
 
 const UIStrings = {
   /** Title of an accesibility audit that evaluates if the elements with an aria-role that require child elements have the required children. This title is descriptive of the successful state and is shown to users when no user action is required. */
-  title: 'Elements with `[role]` that require specific children `[role]`s, are present',
+  title: 'Elements with an ARIA `[role]` that require children to contain a specific ' +
+  '`[role]` have all required children.',
   /** Title of an accesibility audit that evaluates if the elements with an aria-role that require child elements have the required children. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
-  failureTitle: 'Elements with `[role]` that require specific children `[role]`s, ' +
-      'are missing.',
+  failureTitle: 'Elements with an ARIA `[role]` that require children to contain a specific ' +
+  '`[role]` are missing some or all of those required children.',
   /** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
   description: 'Some ARIA parent roles must contain specific child roles to perform ' +
       'their intended accessibility functions. ' +
diff --git a/lighthouse-core/lib/i18n/locales/en-US.json b/lighthouse-core/lib/i18n/locales/en-US.json
index 67e13c4bd..eabd53c07 100644
--- a/lighthouse-core/lib/i18n/locales/en-US.json
+++ b/lighthouse-core/lib/i18n/locales/en-US.json
@@ -30,10 +30,10 @@
     "message": "Some ARIA parent roles must contain specific child roles to perform their intended accessibility functions. [Learn more](https://web.dev/aria-required-children/)."
   },
   "lighthouse-core/audits/accessibility/aria-required-children.js | failureTitle": {
-    "message": "Elements with `[role]` that require specific children `[role]`s, are missing."
+    "message": "Elements with an ARIA `[role]` that require children to contain a specific `[role]` are missing some or all of those required children."
   },
   "lighthouse-core/audits/accessibility/aria-required-children.js | title": {
-    "message": "Elements with `[role]` that require specific children `[role]`s, are present"
+    "message": "Elements with an ARIA `[role]` that require children to contain a specific `[role]` have all required children."
   },
   "lighthouse-core/audits/accessibility/aria-required-parent.js | description": {
     "message": "Some ARIA child roles must be contained by specific parent roles to properly perform their intended accessibility functions. [Learn more](https://web.dev/aria-required-parent/)."
diff --git a/lighthouse-core/lib/i18n/locales/en-XL.json b/lighthouse-core/lib/i18n/locales/en-XL.json
index cb9cd79ac..88ec3d321 100644
--- a/lighthouse-core/lib/i18n/locales/en-XL.json
+++ b/lighthouse-core/lib/i18n/locales/en-XL.json
@@ -30,10 +30,10 @@
     "message": "Ŝóm̂é ÂŔÎÁ p̂ár̂én̂t́ r̂ól̂éŝ ḿûśt̂ ćôńt̂áîń ŝṕêćîf́îć ĉh́îĺd̂ ŕôĺêś t̂ó p̂ér̂f́ôŕm̂ t́ĥéîŕ îńt̂én̂d́êd́ âćĉéŝśîb́îĺît́ŷ f́ûńĉt́îón̂ś. [L̂éâŕn̂ ḿôŕê](https://web.dev/aria-required-children/)."
   },
   "lighthouse-core/audits/accessibility/aria-required-children.js | failureTitle": {
-    "message": "Êĺêḿêńt̂ś ŵít̂h́ `[role]` t̂h́ât́ r̂éq̂úîŕê śp̂éĉíf̂íĉ ćĥíl̂d́r̂én̂ `[role]`ś, âŕê ḿîśŝín̂ǵ."
+    "message": "Êĺêḿêńt̂ś ŵít̂h́ âń ÂŔÎÁ `[role]` t̂h́ât́ r̂éq̂úîŕê ćĥíl̂d́r̂én̂ t́ô ćôńt̂áîń â śp̂éĉíf̂íĉ `[role]` ár̂é m̂íŝśîńĝ śôḿê ór̂ ál̂ĺ ôf́ t̂h́ôśê ŕêq́ûír̂éd̂ ćĥíl̂d́r̂én̂."
   },
   "lighthouse-core/audits/accessibility/aria-required-children.js | title": {
-    "message": "Êĺêḿêńt̂ś ŵít̂h́ `[role]` t̂h́ât́ r̂éq̂úîŕê śp̂éĉíf̂íĉ ćĥíl̂d́r̂én̂ `[role]`ś, âŕê ṕr̂éŝén̂t́"
+    "message": "Êĺêḿêńt̂ś ŵít̂h́ âń ÂŔÎÁ `[role]` t̂h́ât́ r̂éq̂úîŕê ćĥíl̂d́r̂én̂ t́ô ćôńt̂áîń â śp̂éĉíf̂íĉ `[role]` h́âv́ê ál̂ĺ r̂éq̂úîŕêd́ ĉh́îĺd̂ŕêń."
   },
   "lighthouse-core/audits/accessibility/aria-required-parent.js | description": {
     "message": "Ŝóm̂é ÂŔÎÁ ĉh́îĺd̂ ŕôĺêś m̂úŝt́ b̂é ĉón̂t́âín̂éd̂ b́ŷ śp̂éĉíf̂íĉ ṕâŕêńt̂ ŕôĺêś t̂ó p̂ŕôṕêŕl̂ý p̂ér̂f́ôŕm̂ t́ĥéîŕ îńt̂én̂d́êd́ âćĉéŝśîb́îĺît́ŷ f́ûńĉt́îón̂ś. [L̂éâŕn̂ ḿôŕê](https://web.dev/aria-required-parent/)."
diff --git a/lighthouse-core/scripts/i18n/bake-ctc-to-lhl.js b/lighthouse-core/scripts/i18n/bake-ctc-to-lhl.js
index b34deb1ca..e091fd3cc 100644
--- a/lighthouse-core/scripts/i18n/bake-ctc-to-lhl.js
+++ b/lighthouse-core/scripts/i18n/bake-ctc-to-lhl.js
@@ -75,11 +75,13 @@ function bakePlaceholders(messages) {
 
     if (placeholders) {
       for (const [placeholder, {content}] of Object.entries(placeholders)) {
-        const escapedPlaceholder = '$' + placeholder + '$';
-        if (!message.includes(escapedPlaceholder)) {
+        if (!message.includes('$' + placeholder + '$')) {
           throw Error(`Provided placeholder "${placeholder}" not found in message "${message}".`);
         }
-        message = message.replace(escapedPlaceholder, content);
+        // Need a global replace due to plural ICU copying placeholders
+        // (and therefore ICU vars) multiple times.
+        const regex = new RegExp('\\$' + placeholder + '\\$', 'g');
+        message = message.replace(regex, content);
       }
     }
 
diff --git a/lighthouse-core/scripts/i18n/prune-obsolete-lhl-messages.js b/lighthouse-core/scripts/i18n/prune-obsolete-lhl-messages.js
index dcd947e53..33e002a92 100644
--- a/lighthouse-core/scripts/i18n/prune-obsolete-lhl-messages.js
+++ b/lighthouse-core/scripts/i18n/prune-obsolete-lhl-messages.js
@@ -135,7 +135,8 @@ function pruneObsoleteLhlMessages() {
   const alreadyLoggedPrunes = new Set();
   for (const localePath of localePaths) {
     const absoluteLocalePath = path.join(lhRoot, localePath);
-    const localeLhl = require(absoluteLocalePath);
+    // readFileSync so that the file is pulled again once updated by a collect-strings run
+    const localeLhl = JSON.parse(fs.readFileSync(absoluteLocalePath, 'utf-8'));
     const prunedLocale = pruneLocale(goldenLocaleArgumentIds, localeLhl, alreadyLoggedPrunes);
 
     const stringified = JSON.stringify(prunedLocale, null, 2) + '\n';
diff --git a/lighthouse-viewer/app/index.html b/lighthouse-viewer/app/index.html
index 4cf4b5246..7c5e24e72 100644
--- a/lighthouse-viewer/app/index.html
+++ b/lighthouse-viewer/app/index.html
@@ -11,7 +11,7 @@ Unless required by applicable law or agreed to in writing, software distributed
   <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
   <title>Lighthouse Report Viewer</title>
   <link rel="manifest" href="manifest.json">
-  <link rel="icon" href="data:image/png;base64,data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGi0lEQVRYR8VXaWxUVRg9b6YzU7rPTOlGKWGRUDTwA5ClK2gRaKdIAkQNBA0ERAihmgCpxsAPYmIMRhQERERIRJStpYCmApUuFgqYKNRqSLEWprXV0naYzvruNfe+Zd7rtLT95U3e5L377rvnfOdb7jcC/uchjBR/0uKLFsMo+2q/jzhEkaZRAAZBcJqNOA/x0fF7l5b4RrLnsAlMcPxU7vYQB9ucUuVi8PK9Ok8RZTGUOyuzlg6HyJAEJhbXV3i8pFACpWCQ7J4NQgYmoLwfFWm40F6ZVfQkIoMSmLribozL1eNiGFqLZWz9HFujIcaJyt9BANJTbLGN3z79eCAiAxKYseJmRocr0MLsDYFLCnD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yrik02AE8q6VQTCoLvj56xkYm8yiWz/8fr8qZ9uqeRwgMUJxgVI2KSrdmVjVtfFJ1rN3Zf4beZILbPk1awEc1sI1nZmF0VazOqUF7/3mANzlx3ittZsA46wFsGx4F32v5XB3+EQDMtr36ku55mDjlAlZF7g5XwpCLL5osfbFDZqGbMmdlBJJQrkvMM4tgOnlLUhMSVVJuldOV0tyknN/6BzRS8/nA4/ckbgnpyHbISG3etBCxN43ppbwlDJkPAVLKducRTOF3W5XCXi2rQRpbuTPSc5PJQX6gXPrGYEGTSHiBLKryqlgdKhngZxZPGFA8ZusQMTiV2BatlYlYLPZQm766iMETh/iz6OdB3TgCjA/aUHL/Q35+lLMFsRlVw94GE01P8BZ+/uceeSOj2GY9IxKwGq1qgTEptvwlq7mJuZ1vo274lh9byBrrFgvGacZcdlV5wFjWA+3IbYSb0WXg1KCqCPVcnRLLkiIj4f/+B4Ezh3RFaRdrmXY616kywQJMFjhb3hOPfTCGpLY7GtcJO04af8QMyLuccCoo7WgYhC+Yx8gcOUc4g3ySl7e5ItQ1PkmwdG9XZcJbKXW+jAFuO/yr8Z4AkbekinjfvImtdWS+2L1OY6VYi4tlSqhQoRS2DqOqC7g4G4Si8b5uuZ0wKbUmlWZ4aeWFoVAS/JGNaLV7pe36Kwn1P1RkN0gFSVrxxeqEUbSM857q3joplT5ginh9hlczB2tKa/LUmoaTgZPKGIMoQoY0lsm0Pml1KC4aZjlCs6Qf0xi5/5wviVpc5G2w5VSSnJGtKB0GeFE7P8crvA1FIR1WVr3DklAXiw0F027FC94Xwi12RJglOICqUTy6xGxfDf2+z+WKNGhi+h+D8MloH6207E+qihw49UEeJcYQdIiBQo/FZwuEnnx1L9zju68dajvSYD9342YwEg2H87a/wBQQw5d/fsJ1gAAAABJRU5ErkJggg==">
   <meta name="theme-color" content="#304ffe">
   <link rel="stylesheet" href="styles/viewer.css">
 </head>
diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json
index ea91601c4..96434fe94 100644
--- a/proto/sample_v2_round_trip.json
+++ b/proto/sample_v2_round_trip.json
@@ -42,7 +42,7 @@
             "id": "aria-required-children",
             "score": null,
             "scoreDisplayMode": "notApplicable",
-            "title": "Elements with `[role]` that require specific children `[role]`s, are present"
+            "title": "Elements with an ARIA `[role]` that require children to contain a specific `[role]` have all required children."
         },
         "aria-required-parent": {
             "description": "Some ARIA child roles must be contained by specific parent roles to properly perform their intended accessibility functions. [Learn more](https://web.dev/aria-required-parent/).",


Test patch:
diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json
index 3cd6fd23b..08fff4d5b 100644
--- a/lighthouse-core/test/results/sample_v2.json
+++ b/lighthouse-core/test/results/sample_v2.json
@@ -1569,7 +1569,7 @@
     },
     "aria-required-children": {
       "id": "aria-required-children",
-      "title": "Elements with `[role]` that require specific children `[role]`s, are present",
+      "title": "Elements with an ARIA `[role]` that require children to contain a specific `[role]` have all required children.",
       "description": "Some ARIA parent roles must contain specific child roles to perform their intended accessibility functions. [Learn more](https://web.dev/aria-required-children/).",
       "score": null,
       "scoreDisplayMode": "notApplicable"
diff --git a/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js b/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js
index cbc2b34b3..b0a8c15de 100644
--- a/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js
+++ b/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js
@@ -43,6 +43,25 @@ describe('Baking Placeholders', () => {
     });
   });
 
+  it('bakes a placeholder into the output string multiple times', () => {
+    const strings = {
+      hello: {
+        message: '$MARKDOWN_SNIPPET_0$ - $MARKDOWN_SNIPPET_0$',
+        placeholders: {
+          MARKDOWN_SNIPPET_0: {
+            content: '`World`',
+          },
+        },
+      },
+    };
+    const res = bakery.bakePlaceholders(strings);
+    expect(res).toStrictEqual({
+      hello: {
+        message: '`World` - `World`',
+      },
+    });
+  });
+
   it('throws when a placeholder cannot be found', () => {
     const strings = {
       hello: {