AX_TEXT_04 and Learn More links

28 views
Skip to first unread message

Sean

unread,
Apr 7, 2017, 12:52:52 PM4/7/17
to Chromium-dev
tl;dr; adding an anchor in chrome/browser/resources/options/browser_options.html is raising an AX_TEXT_04 accessibility error and I can't figure out why.  The documentation is incomplete.  Please help.

I'm trying to add a new 'Learn More' link to chrome/browser/resources/options/browser_options.html and I can't figure out why I'm failing the accessibility tests. This is an excerpt from the trybot:

[18171:18171:0406/151533.990975:INFO:CONSOLE(1221)] "Running TestCase OptionsWebUIExtendedTest.CloseOverlay", source: test_api.js (1221) [18171:18171:0406/151537.816966:ERROR:web_ui_test_handler.cc(76)] Failed: RUN_TEST_F("OptionsWebUIExtendedTest","CloseOverlay") Error: Accessibility issues found on chrome://settings-frame/ *** Begin accessibility audit results *** An accessibility audit found Warnings: Warning: AX_TEXT_04 (The purpose of each link should be clear from the link text) failed on the following element: #cups-printers-section > .settings-row > A See https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_text_04 for more information. *** End accessibility audit results *** at OptionsWebUIExtendedTest.runAccessibilityAudit (test_api.js:374:17) at TestCase.runAccessibilityAudit (test_api.js:504:22) at test_api.js:1020:20 at testDone (test_api.js:786:31) at HTMLDocument.f (options_browsertest.js:132:7) gen/chrome/browser/ui/webui/options/options_browsertest-gen.cc:404: Failure Value of: RunJavascriptTestF( true, "OptionsWebUIExtendedTest", "CloseOverlay") Actual: false Expected: true [18171:18171:0406/151537.983107:WARNING:url_request_context_getter.cc(43)] URLRequestContextGetter leaking due to no owning thread. [18171:18171:0406/151537.983136:WARNING:url_request_context_getter.cc(43)] URLRequestContextGetter leaking due to no owning thread.


Here's the section in question:
768 <section id="cups-printers-section" hidden> 769 <h3 i18n-content="advancedSectionTitleCupsPrint"></h3> 770 <div class="settings-row"> 771 <span i18n-content="cupsPrintOptionLabel"></span> 772 <a target="_blank" i18n-content="learnMore" 773 i18n-values="href:cupsPrintLearnMoreURL"> 774 </a> 775 </div> 776 <div class="settings-row"> 777 <button id="cupsPrintersManageButton" 778 i18n-content="cupsPrintersManageButton"></button> 779 </div> 780 </section>

AFAICT it's exactly the same as all the other links but if somebody who knows more about the accessibility tests, I'd appreciate it.

            <a target="_blank" class="hotword-link"
                i18n-content="learnMore"
                i18n-values="href:hotwordLearnMoreURL">
            </a>
https://cs.chromium.org/chromium/src/chrome/browser/resources/options/browser_options.html?rcl=b4c4b3509fdf1bc0f8a8c355cc83eb21fc5118eb&l=483
        <a target="_blank" i18n-content="learnMore"
            i18n-values="href:contentProtectionAttestationLearnMoreURL">
        </a>

Xiaoqian Dai

unread,
Apr 7, 2017, 1:31:12 PM4/7/17
to sk...@chromium.org, Chromium-dev, Steven Bennetts, Dan Beam, Michael Giuffrida
It seems to me that it complains "Learn more" doesn't make the purpose of the link clear. But it's weird that it doesn't complain for other <a> elements in the same file. ( Note: per skau@, changing the text "Learn more" to almost anything else fixes the accessibility problem. )

+cc a few UI folks who might know the reason.


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/1d525a92-71e3-4864-a32b-8e846dea3fe7%40chromium.org.

Hector Carmona

unread,
Apr 7, 2017, 1:48:19 PM4/7/17
to xd...@google.com, sk...@chromium.org, Chromium-dev, Steven Bennetts, Dan Beam, Michael Giuffrida
A11y audit is really good, but sometimes has false positives. You can add '#cups-printers-section > .settings-row > A', to linkWithUnclearPurposeSelectors. This will let the audit succeed.

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
--

Hector Carmona | Software Engineer | hcar...@google.com

Sean Kau

unread,
Apr 7, 2017, 2:00:01 PM4/7/17
to Hector Carmona, xd...@google.com, Chromium-dev, Steven Bennetts, Dan Beam, Michael Giuffrida
Thanks for the tip.  That fixed it. 

Michael Giuffrida

unread,
Apr 11, 2017, 6:59:48 AM4/11/17
to Sean Kau, Hector Carmona, xd...@google.com, Chromium-dev, Steven Bennetts, Dan Beam
Text like "learn more" is ignored by the AX_TEXT_04 audit rule. So if the text is just "Learn more.", the text will be considered blank and will trigger the error. If the text has other words, e.g. "Learn more about foo", the word "foo" will remain and AX_TEST_04 will pass.

These words can be configured by setting |stopwords| on the AuditConfiguration (as opposed to whitelisting the element by selector).

Reply all
Reply to author
Forward
0 new messages