Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Add titles and labels to HTML tables #792

Merged
merged 4 commits into from
Aug 20, 2019
Merged

Add titles and labels to HTML tables #792

merged 4 commits into from
Aug 20, 2019

Conversation

chlowell
Copy link
Member

This gives each table in the HTML report a title or aria label, so screen readers have a name to announce them by.

@chlowell chlowell requested a review from Lxiamail July 31, 2019 02:26
@@ -18,8 +18,8 @@

<h2 id="@LocalizedStrings.CompatibilityPageTitle" tabindex="0">@LocalizedStrings.CompatibilityPageTitle</h2>
<div id="summary-compat-byassembly">
<h3 class="compat-subheader">@LocalizedStrings.PerAssemblyOverview</h3>
<table>
<h3 class="compat-subheader" id="compat-byassembly-subheader">@LocalizedStrings.PerAssemblyOverview</h3>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, will @LocalizedStrings.PerAssemblyOverview be read two times, one as h3 and one as table. Also per https://www.accessibility-developer-guide.com/examples/sensible-aria-usage/label-labelledby/, aria-label and aria-labelledby has some undesirable side effects. What if remove

, and add caption with @LocalizedStrings.PerAssemblyOverview as value to the table?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<caption> works but Narrator reads it twice in Edge, once in Firefox. I agree it's preferable semantically, so I'll push a commit labeling the tables with <caption>.

@@ -114,7 +114,7 @@
var usedUnresolvedAssembly = Model.GetUnresolvedAssemblies(assembly);
if (usedUnresolvedAssembly.Count > 0)
{
<table>
<table aria-labelledby="@assembly.SourceAssembly">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this table is for missing assemblies. What if instead of adding aria-labelledby="@assembly.SourceAssembly", adding a caption with value of @LocalizedStrings.MissingAssemblies? Certainly, that could seems duplicated with the table header of LocalizedStrings.MissingAssemblies .

@Lxiamail Lxiamail merged commit eb4c558 into microsoft:dev Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants