Search

HTML5 validation reports spurious error when th tags appear within tbody tags by Douglas McClean

Closed
as Fixed Help for as Fixed

5
0
Sign in
to vote
Type: Bug
ID: 656626
Opened: 4/1/2011 4:34:08 AM
Access Restriction: Public
0
Workaround(s)
2
User(s) can reproduce this bug
Visual Studio incorrectly identifies correct HTML5 as failing to validate, because it is enforcing a non-existent rule against th elements being nested within (indirectly within, inside a tr) a tbody element.

This may be based on a false assumption that all th elements are column headers, when in fact they may also serve as row headers thanks to the scope attribute.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010 SP1

What category (if any) best represents this feedback?

Compatibility

Steps to reproduce

Cshtml similar to that below, with the "Target Schema for Validation" set to HTML5, produces warnings like:

Warning 1 Validation (HTML5): Element 'th' must not be nested within element 'tbody tfoot'.

<table>
<caption>Maps of @Model.Name</caption>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Publisher</th>
<th scope="col">Scale</th>
<th scope="col">Year</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Franconia Quadrangle</th>
<td>USGS</td>
<td>@Cairn.Cartography.Scale.CreateScaleFromDenominator(24000)</td>
<td>1967</td>
</tr>
</tbody>
</table>

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

A warning:

Warning 1 Validation (HTML5): Element 'th' must not be nested within element 'tbody tfoot'.

Expected results

No warning. The example is correct HTML5. The spec contains examples of such tables, for example see section 4.9.13 http://www.w3.org/TR/html5/tabular-data.html#examples (the 2nd and 3rd examples after that anchor, don't be thrown off by the first one).

Quite often the first cell within a tr should be a th with scope="row" marking up the name or ID number or what-have-you describing that row.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 6/1/2011 at 2:21 PM
Thank you for passing along this issue to us. At this point, we are pulling together this and other feedback as part of our planning and evaluation for the next release. We know that our customers are the most qualified people to help us learn how to make our products better, and we greatly appreciate hearing from you.
Posted by Microsoft on 4/3/2011 at 7:27 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by Microsoft on 4/1/2011 at 5:13 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.