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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,7 @@
<data name="Version" xml:space="preserve">
<value>Version</value>
</data>
<data name="PortabilityDetails" xml:space="preserve">
<value>Portability Details</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -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>.

<table aria-labelledby="compat-byassembly-subheader">
<tbody>
<tr>
<th rowspan="2">@LocalizedStrings.AssemblyHeader</th>
Expand Down Expand Up @@ -81,8 +81,8 @@
@if (Model.OrderedBreakingChangeSkippedAssemblies.Count() > 0)
{
<div id="summary-compat-skippedassemblies">
<h3 class="compat-subheader">@LocalizedStrings.IgnoredAssemblies</h3>
<table>
<h3 class="compat-subheader" id="compat-skippedassemblies-subheader">@LocalizedStrings.IgnoredAssemblies</h3>
<table aria-labelledby="compat-skippedassemblies-subheader">
<tr>
<th>@LocalizedStrings.Assembly</th>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="BreakingChangeTable">
@if (Model.Breaks.Count() > 0)
{
<table>
<table title="@Model.Name">
<thead>
<tr>
<th colspan="4"></th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</svg>

<h2 id="@LocalizedStrings.PortabilitySummaryPageTitle" tabindex="0">@LocalizedStrings.PortabilitySummaryPageTitle</h2>
<table>
<table aria-labelledby="@LocalizedStrings.PortabilitySummaryPageTitle">
<tbody>
<tr>
<th>@LocalizedStrings.AssemblyHeader</th>
Expand Down Expand Up @@ -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 .

<tbody>
<tr><th>@LocalizedStrings.MissingAssemblies</th></tr>
@foreach (var name in usedUnresolvedAssembly)
Expand All @@ -126,7 +126,7 @@
<a>&nbsp;</a> @*insert a blank line for readability*@
}

<table class="table_portability_details">
<table class="table_portability_details" title="@LocalizedStrings.PortabilityDetails">
<tbody>
<tr>
@foreach (var header in detailColumnHeaders)
Expand Down Expand Up @@ -193,7 +193,7 @@
}
}

<table>
<table title="@LocalizedStrings.AvailableNuGetPackages">
<tbody>
<tr>
@foreach (var header in nugetColumnHeaders)
Expand Down