Repository: GoogleChrome/lighthouse
Pull request #9411 (2019-07-18 23:04:40)

docs: fix typo
<!-- Thank you for submitting a pull request! -->

**Summary**
<!-- What kind of change does this PR introduce? -->
This PR fixes some typos as the followings:
- `were` -> `was` (docs/understanding-results.md)
- `mask` -> `masks` (docs/variability.md)
- `failing  audit` -> `failing audit` (docs/architecture.md)


<!-- Is this a bugfix, feature, refactoring, build related change, etc? -->

<!-- Describe the need for this change -->

<!-- Link any documentation or information that would help understand this change -->

**Related Issues/PRs**
<!-- Provide any additional information we might need to understand the pull request -->
N/A

googlebot: 
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: **Please visit <https://cla.developers.google.com/> to sign.**

Once you've signed (or fixed any issues), please reply here (e.g. `I signed it!`) and we'll verify it.

----

#### What to do if you already signed the CLA

##### Individual signers

*   It's possible we don't have your GitHub username or you're using a different email address on your commit. Check [your existing CLA data](https://cla.developers.google.com/clas) and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/).

##### Corporate signers

*   Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to [go/cla#troubleshoot](http://go/cla#troubleshoot) ([Public version](https://opensource.google.com/docs/cla/#troubleshoot)).
*   The email used to register you as an authorized contributor must be the email used for the Git commit. Check [your existing CLA data](https://cla.developers.google.com/clas) and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/).
*   The email used to register you as an authorized contributor must also be [attached to your GitHub account](https://github.com/settings/emails).
		

ℹ️ **Googlers: [Go here](https://goto.google.com/prinfo/https%3A%2F%2Fgithub.com%2FGoogleChrome%2Flighthouse%2Fpull%2F9411) for more info**.

<!-- need_sender_cla -->

Patch:
diff --git a/docs/architecture.md b/docs/architecture.md
index cf67e925d..7b519f96a 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -16,7 +16,7 @@ _Some incomplete notes_
 ### Audit/Report terminology
 * **Category** - Roll-up collection of audits and audit groups into a user-facing section of the report (eg. `Best Practices`). Applies weighting and overall scoring to the section. Examples: PWA, Accessibility, Best Practices.
 * **Audit title** - Short user-visible title for the successful audit. eg. “All image elements have `[alt]` attributes.”
-* **Audit failureTitle** - Short user-visible title for a failing  audit. eg. “Some image elements do not have `[alt]` attributes.”
+* **Audit failureTitle** - Short user-visible title for a failing audit. eg. “Some image elements do not have `[alt]` attributes.”
 * **Audit description** - Explanation of why the user should care about the audit. Not necessarily how to fix it, unless there is no external link that explains it. ([See description guidelines](CONTRIBUTING.md#description-guidelines)). eg. “Informative elements should aim for short, descriptive alternate text. Decorative elements can be ignored with an empty alt attribute. [Learn more].”
 
 ## Protocol
diff --git a/docs/understanding-results.md b/docs/understanding-results.md
index 587f83e5d..7d795f455 100644
--- a/docs/understanding-results.md
+++ b/docs/understanding-results.md
@@ -12,7 +12,7 @@ For an always up-to-date definition of the LHR, take a look [at our typedefs](ht
 
 | Name | Description |
 | - | - |
-| lighthouseVersion | The version of Lighthouse with which this result were generated. |
+| lighthouseVersion | The version of Lighthouse with which this result was generated. |
 | fetchTime | The ISO-8601 timestamp of when the result was generated. |
 | userAgent | The user agent string of the version of Chrome that was used by Lighthouse. |
 | requestedUrl | The URL that was supplied to Lighthouse and initially navigated to. |
diff --git a/docs/variability.md b/docs/variability.md
index 6be848435..dce77de3b 100644
--- a/docs/variability.md
+++ b/docs/variability.md
@@ -30,7 +30,7 @@ Local networks have inherent variability from packet loss, variable traffic prio
 
 ### Tier-1 Network Variability
 
-Network interconnects are generally very stable and have minimal impact but cross-geo requests, i.e. measuring performance of a Chinese site from the US, can start to experience a high degree of latency introduced from tier-1 network hops. _Applied_ throttling partially mask these effects with network throttling. _Simulated_ throttling mitigates these effects by replaying network activity on its own.
+Network interconnects are generally very stable and have minimal impact but cross-geo requests, i.e. measuring performance of a Chinese site from the US, can start to experience a high degree of latency introduced from tier-1 network hops. _Applied_ throttling partially masks these effects with network throttling. _Simulated_ throttling mitigates these effects by replaying network activity on its own.
 
 ### Web Server Variability
 
diff --git a/lighthouse-core/gather/gatherers/seo/font-size.js b/lighthouse-core/gather/gatherers/seo/font-size.js
index c26172304..67b88be34 100644
--- a/lighthouse-core/gather/gatherers/seo/font-size.js
+++ b/lighthouse-core/gather/gatherers/seo/font-size.js
@@ -211,7 +211,7 @@ async function fetchSourceRule(driver, node) {
 
 /**
  * @param {Driver} driver
- * @param {LH.Artifacts.FontSize.DomNodeWithParent} textNode text node
+ * @param {LH.Artifacts.FontSize.DomNodeWithParent} textNode
  * @returns {Promise<?NodeFontData>}
  */
 async function fetchComputedFontSize(driver, textNode) {
diff --git a/types/artifacts.d.ts b/types/artifacts.d.ts
index a3d4cb8c3..8dda838f1 100644
--- a/types/artifacts.d.ts
+++ b/types/artifacts.d.ts
@@ -241,6 +241,7 @@ declare global {
         failingTextLength: number;
         visitedTextLength: number;
         analyzedFailingTextLength: number;
+        /** Elements that contain a text node that failed size criteria. */
         analyzedFailingNodesData: Array<{
           fontSize: number;
           textLength: number;


Test patch:
diff --git a/lighthouse-core/test/audits/seo/font-size-test.js b/lighthouse-core/test/audits/seo/font-size-test.js
index 5e86becfc..83138f049 100644
--- a/lighthouse-core/test/audits/seo/font-size-test.js
+++ b/lighthouse-core/test/audits/seo/font-size-test.js
@@ -8,7 +8,10 @@
 const FontSizeAudit = require('../../../audits/seo/font-size.js');
 const assert = require('assert');
 
-const URL = 'https://example.com';
+const URL = {
+  requestedUrl: 'https://example.com',
+  finalUrl: 'https://example.com',
+};
 const validViewport = 'width=device-width';
 
 /* eslint-env jest */
@@ -234,4 +237,54 @@ describe('SEO: Font size audit', () => {
     expect(auditResult.score).toBe(1);
     expect(auditResult.notApplicable).toBe(true);
   });
+
+  describe('attributes source location', () => {
+    async function runFontSizeAuditWithSingleFailingStyle(style, nodeProperties) {
+      const artifacts = {
+        URL: {finalUrl: 'http://www.example.com'},
+        MetaElements: makeMetaElements(validViewport),
+        FontSize: {
+          analyzedFailingNodesData: [
+            {textLength: 1, fontSize: 1, node: {nodeId: 1, ...nodeProperties}, cssRule: style},
+          ],
+        },
+        TestedAsMobileDevice: true,
+      };
+      const auditResult = await FontSizeAudit.audit(artifacts, getFakeContext());
+      expect(auditResult.details.items).toHaveLength(1);
+      return auditResult;
+    }
+
+    it('to inline node stylesheet', async () => {
+      const auditResult = await runFontSizeAuditWithSingleFailingStyle({
+        type: 'Inline',
+      }, {
+        parentNode: {attributes: ['id', 'my-parent']},
+        localName: 'p',
+        attributes: ['class', 'my-p'],
+      });
+
+      expect(auditResult.details.items[0].selector).toMatchObject({
+        type: 'node',
+        selector: '#my-parent',
+        snippet: '<p class="my-p">',
+      });
+    });
+
+    it('to attributes node stylesheet', async () => {
+      const auditResult = await runFontSizeAuditWithSingleFailingStyle({
+        type: 'Attributes',
+      }, {
+        parentNode: {attributes: ['id', 'my-parent']},
+        localName: 'font',
+        attributes: ['size', '10px'],
+      });
+
+      expect(auditResult.details.items[0].selector).toMatchObject({
+        type: 'node',
+        selector: '#my-parent',
+        snippet: '<font size="10px">',
+      });
+    });
+  });
 });