WebKit Bugzilla
Attachment 357454 Details for
Bug 192764
: Web Inspector: Audit: fix descriptions for default tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192764-20181217110437.patch (text/plain), 15.63 KB, created by
Devin Rousso
on 2018-12-17 11:04:37 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-12-17 11:04:37 PST
Size:
15.63 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 9152ad45a76b7b16c7970000dfa89f9f834c0cdf..431fc11ddef2a97ab79eb560dd964adab61d36a5 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-17 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Audit: fix descriptions for default tests >+ https://bugs.webkit.org/show_bug.cgi?id=192764 >+ <rdar://problem/46729437> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Controllers/AuditManager.js: >+ (WI.AuditManager.prototype.addDefaultTestsIfNeeded): >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2018-12-15 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Styles: toggling selected properties may cause data corruption >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index 0d1dba8a59daa7756ec278f99be8e01629e0f550..6672e29d0fe86b60d9ab06fafc3caf6500235263 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -53,6 +53,7 @@ localizedStrings["%s \u2013 %s"] = "%s \u2013 %s"; > localizedStrings["%s \u2014 %s"] = "%s \u2014 %s"; > localizedStrings["%s cannot be modified"] = "%s cannot be modified"; > localizedStrings["%s delay"] = "%s delay"; >+localizedStrings["%s eval\n%s async"] = "%s eval\n%s async"; > localizedStrings["%s interval"] = "%s interval"; > localizedStrings["(Action %s)"] = "(Action %s)"; > localizedStrings["(Disk)"] = "(Disk)"; >@@ -121,6 +122,7 @@ localizedStrings["Assertion Failed: %s"] = "Assertion Failed: %s"; > localizedStrings["Assertion Failures"] = "Assertion Failures"; > localizedStrings["Assertion with message: %s"] = "Assertion with message: %s"; > localizedStrings["Assertive"] = "Assertive"; >+localizedStrings["Async audits are not supported."] = "Async audits are not supported."; > localizedStrings["Attribute"] = "Attribute"; > localizedStrings["Attribute Modified"] = "Attribute Modified"; > localizedStrings["Attributes"] = "Attributes"; >@@ -362,15 +364,18 @@ localizedStrings["Enable paint flashing"] = "Enable paint flashing"; > localizedStrings["Enabled"] = "Enabled"; > localizedStrings["Encoded"] = "Encoded"; > localizedStrings["Encoding"] = "Encoding"; >-localizedStrings["Ensure <area> elements of image maps have alternate text."] = "Ensure <area> elements of image maps have alternate text."; >+localizedStrings["Ensure <area> elements have alternate text."] = "Ensure <area> elements have alternate text."; >+localizedStrings["Ensure <blink> is not used."] = "Ensure <blink> is not used."; > localizedStrings["Ensure <dt> and <dd> elements are contained by a <dl>."] = "Ensure <dt> and <dd> elements are contained by a <dl>."; >+localizedStrings["Ensure <form>s have at least one input."] = "Ensure <form>s have at least one input."; >+localizedStrings["Ensure <frame> elements have a title."] = "Ensure <frame> elements have a title."; > localizedStrings["Ensure <img> elements have alternate text."] = "Ensure <img> elements have alternate text."; >+localizedStrings["Ensure <marquee> is not used."] = "Ensure <marquee> is not used."; > localizedStrings["Ensure <meta http-equiv=refresh> is not used."] = "Ensure <meta http-equiv=refresh> is not used."; >-localizedStrings["Ensure exactly one <legend> exists per form."] = "Ensure exactly one <legend> exists per form."; >-localizedStrings["Ensure forms have at least one input."] = "Ensure forms have at least one input."; >-localizedStrings["Ensure hidden=true is not present on the document body."] = "Ensure hidden=true is not present on the document body."; >-localizedStrings["Ensure legend is first child in form."] = "Ensure legend is first child in form."; >+localizedStrings["Ensure exactly one <legend> exists per <form>."] = "Ensure exactly one <legend> exists per <form>."; >+localizedStrings["Ensure hidden=true is not present on the <body>."] = "Ensure hidden=true is not present on the <body>."; > localizedStrings["Ensure tabindex is a number."] = "Ensure tabindex is a number."; >+localizedStrings["Ensure that the <legend> is the first child in the <form>."] = "Ensure that the <legend> is the first child in the <form>."; > localizedStrings["Entered Full-Screen Mode"] = "Entered Full-Screen Mode"; > localizedStrings["Entered Low-Power Mode"] = "Entered Low-Power Mode"; > localizedStrings["Entire Recording"] = "Entire Recording"; >@@ -937,8 +942,8 @@ localizedStrings["This is an example of how result DOM nodes are shown. It will > localizedStrings["This is what the result of a failing test with no data looks like."] = "This is what the result of a failing test with no data looks like."; > localizedStrings["This is what the result of a passing test with no data looks like."] = "This is what the result of a passing test with no data looks like."; > localizedStrings["This is what the result of a test that threw an error with no data looks like."] = "This is what the result of a test that threw an error with no data looks like."; >-localizedStrings["This is what the result of a unsupported test with no data looks like."] = "This is what the result of a unsupported test with no data looks like."; > localizedStrings["This is what the result of a warning test with no data looks like."] = "This is what the result of a warning test with no data looks like."; >+localizedStrings["This is what the result of an unsupported test with no data looks like."] = "This is what the result of an unsupported test with no data looks like."; > localizedStrings["This object is a root"] = "This object is a root"; > localizedStrings["This object is referenced by internal objects"] = "This object is referenced by internal objects"; > localizedStrings["This text resource could benefit from compression"] = "This text resource could benefit from compression"; >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js b/Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js >index 62d7493701c037ab3147fc9449e46ab1dadc8047..3f727f3ab83e1a9572212eb2904a164aa37f25ca 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js >@@ -222,7 +222,7 @@ WI.AuditManager = class AuditManager extends WI.Object > new WI.AuditTestCase(`level-warn`, `function() { return {level: "warn"}; }`, {description: WI.UIString("This is what the result of a warning test with no data looks like.")}), > new WI.AuditTestCase(`level-fail`, `function() { return {level: "fail"}; }`, {description: WI.UIString("This is what the result of a failing test with no data looks like.")}), > new WI.AuditTestCase(`level-error`, `function() { return {level: "error"}; }`, {description: WI.UIString("This is what the result of a test that threw an error with no data looks like.")}), >- new WI.AuditTestCase(`level-unsupported`, `function() { return {level: "unsupported"}; }`, {description: WI.UIString("This is what the result of a unsupported test with no data looks like.")}), >+ new WI.AuditTestCase(`level-unsupported`, `function() { return {level: "unsupported"}; }`, {description: WI.UIString("This is what the result of an unsupported test with no data looks like.")}), > ], {description: WI.UIString("These are all of the different test result levels.")}), > new WI.AuditTestGroup(WI.UIString("Result Data"), [ > new WI.AuditTestCase(`data-domNodes`, `function() { return {domNodes: [document.body], level: "pass"}; }`, {description: WI.UIString("This is an example of how result DOM nodes are shown. It will pass with the <body> element.")}), >@@ -233,21 +233,21 @@ WI.AuditManager = class AuditManager extends WI.Object > new WI.AuditTestGroup(WI.UIString("Accessibility"), [ > new WI.AuditTestGroup(WI.UIString("Attributes"), [ > new WI.AuditTestCase(`img-alt`, `function() { let domNodes = Array.from(document.getElementsByTagName("img")).filter((img) => !img.alt || !img.alt.length); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["alt"] }; }`, {description: WI.UIString("Ensure <img> elements have alternate text.")}), >- new WI.AuditTestCase(`area-alt`, `function() { let domNodes = Array.from(document.getElementsByTagName("area")).filter((area) => !area.alt || !area.alt.length); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["alt"] }; }`, {description: WI.UIString("Ensure <area> elements of image maps have alternate text.")}), >+ new WI.AuditTestCase(`area-alt`, `function() { let domNodes = Array.from(document.getElementsByTagName("area")).filter((area) => !area.alt || !area.alt.length); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["alt"] }; }`, {description: WI.UIString("Ensure <area> elements have alternate text.")}), > new WI.AuditTestCase(`valid-tabindex`, `function() { let domNodes = Array.from(document.querySelectorAll("*[tabindex]")) .filter((node) => { let tabindex = node.getAttribute("tabindex"); if (!tabindex) return false; tabindex = parseInt(tabindex); return isNaN(tabindex) || (tabindex !== 0 && tabindex !== -1); }); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["tabindex"] }; }`, {description: WI.UIString("Ensure tabindex is a number.")}), >- new WI.AuditTestCase(`frame-title`, `function() { let domNodes = Array.from(document.querySelectorAll("iframe, frame")) .filter((node) => { let title = node.getAttribute("title"); return !title || !title.trim().length; }); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["title"] }; }`, {description: WI.UIString("Ensure <area> elements of image maps have alternate text.")}), >- new WI.AuditTestCase(`hidden-body`, `function() { let domNodes = Array.from(document.querySelectorAll("body[hidden]")).filter((body) => body.hidden); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["hidden"] }; }`, {description: WI.UIString("Ensure hidden=true is not present on the document body.")}), >+ new WI.AuditTestCase(`frame-title`, `function() { let domNodes = Array.from(document.querySelectorAll("iframe, frame")) .filter((node) => { let title = node.getAttribute("title"); return !title || !title.trim().length; }); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["title"] }; }`, {description: WI.UIString("Ensure <frame> elements have a title.")}), >+ new WI.AuditTestCase(`hidden-body`, `function() { let domNodes = Array.from(document.querySelectorAll("body[hidden]")).filter((body) => body.hidden); return { level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["hidden"] }; }`, {description: WI.UIString("Ensure hidden=true is not present on the <body>.")}), > new WI.AuditTestCase(`meta-refresh`, `function() { let domNodes = Array.from(document.querySelectorAll("meta[http-equiv=refresh]")); return { level: domNodes.length ? "warn" : "pass", domNodes, domAttributes: ["http-equiv"] }; }`, {description: WI.UIString("Ensure <meta http-equiv=refresh> is not used.")}), > ], {description: WI.UIString("Tests for element attribute accessibility issues.")}), > new WI.AuditTestGroup(WI.UIString("Elements"), [ >- new WI.AuditTestCase(`blink`, `function() { let domNodes = Array.from(document.getElementsByTagName("blink")); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure hidden=true is not present on the document body.")}), >- new WI.AuditTestCase(`marquee`, `function() { let domNodes = Array.from(document.getElementsByTagName("marquee")); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure hidden=true is not present on the document body.")}), >+ new WI.AuditTestCase(`blink`, `function() { let domNodes = Array.from(document.getElementsByTagName("blink")); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure <blink> is not used.")}), >+ new WI.AuditTestCase(`marquee`, `function() { let domNodes = Array.from(document.getElementsByTagName("marquee")); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure <marquee> is not used.")}), > new WI.AuditTestCase(`dlitem`, `function() { function check(node) { if (!node) { return false; } if (node.nodeName === "DD") { return true; } return check(node.parentNode); } let domNodes = Array.from(document.querySelectorAll("dt, dd")).filter(check); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure <dt> and <dd> elements are contained by a <dl>.")}), > ], {description: WI.UIString("Tests for element accessibility issues.")}), > new WI.AuditTestGroup(WI.UIString("Forms"), [ >- new WI.AuditTestCase(`one-legend`, `function() { let formLegendsMap = Array.from(document.querySelectorAll("form legend")).reduce((accumulator, node) => { let existing = accumulator.get(node.form); if (!existing) { existing = []; accumulator.set(node.form, existing); } existing.push(node); return accumulator; }, new Map); let domNodes = Array.from(formLegendsMap.values()).reduce((accumulator, legends) => accumulator.concat(legends), []); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure exactly one <legend> exists per form.")}), >- new WI.AuditTestCase(`legend-first-child`, `function() { let domNodes = Array.from(document.querySelectorAll("form > legend:not(:first-child)")); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure legend is first child in form.")}), >- new WI.AuditTestCase(`form-input`, `function() { let domNodes = Array.from(document.getElementsByTagName("form")) .filter(node => !node.elements.length); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure forms have at least one input.")}), >+ new WI.AuditTestCase(`one-legend`, `function() { let formLegendsMap = Array.from(document.querySelectorAll("form legend")).reduce((accumulator, node) => { let existing = accumulator.get(node.form); if (!existing) { existing = []; accumulator.set(node.form, existing); } existing.push(node); return accumulator; }, new Map); let domNodes = Array.from(formLegendsMap.values()).reduce((accumulator, legends) => accumulator.concat(legends), []); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure exactly one <legend> exists per <form>.")}), >+ new WI.AuditTestCase(`legend-first-child`, `function() { let domNodes = Array.from(document.querySelectorAll("form > legend:not(:first-child)")); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure that the <legend> is the first child in the <form>.")}), >+ new WI.AuditTestCase(`form-input`, `function() { let domNodes = Array.from(document.getElementsByTagName("form")) .filter(node => !node.elements.length); return { level: domNodes.length ? "warn" : "pass", domNodes }; }`, {description: WI.UIString("Ensure <form>s have at least one input.")}), > ], {description: WI.UIString("Tests the accessibility of form elements.")}), > ], {description: WI.UIString("Tests for ways to improve accessibility.")}), > ];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192764
:
357454
|
357782