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

Add titles and labels to HTML tables#792

Merged
Lxiamail merged 4 commits intomicrosoft:devfrom
chlowell:html
Aug 20, 2019
Merged

Add titles and labels to HTML tables#792
Lxiamail merged 4 commits intomicrosoft:devfrom
chlowell:html

Conversation

@chlowell
Copy link
Copy Markdown
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
<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
Copy Markdown
Contributor

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
Copy Markdown
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>.

Comment thread src/lib/Microsoft.Fx.Portability.Reports.Html/Views/_BreakingChangesReport.cshtml Outdated
Comment thread src/lib/Microsoft.Fx.Portability.Reports.Html/Views/_PortabilityReport.cshtml Outdated
if (usedUnresolvedAssembly.Count > 0)
{
<table>
<table aria-labelledby="@assembly.SourceAssembly">
Copy link
Copy Markdown
Contributor

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