Skip to content

Is it time to bring back the table missing summary warning? #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
geoffmcl opened this issue May 3, 2015 · 5 comments
Closed

Is it time to bring back the table missing summary warning? #210

geoffmcl opened this issue May 3, 2015 · 5 comments
Assignees
Milestone

Comments

@geoffmcl
Copy link
Contributor

geoffmcl commented May 3, 2015

A post on html-tidy@w3.org https://lists.w3.org/Archives/Public/html-tidy/2015AprJun/0009.html caused me to look deeper into the code concerning this missing table summary warning.

As stated in my reply, there are perhaps 2, or more, bugs here!

Case 1: First at present tidy5 no longer emits this warning in ANY case, which may be fine for html5 mode... But is it?

Case 2: Conversely, if the document IS html5, and you DO add a summary attribute, tidy5 does NOT warn that the summary attribute is not supported in HTML5 ;=(( Should it?

Case 3: Further, if the doctype declares the document as an earlier doctype, like say 4.01 strict, or transitional, htm4--, tidy5 still does not emit the warning ;=(( Should it?

The missing summary warning was REMOVED back on Nov 21, 2011, commit/4fdc30c (4fdc30c) by @sideshowbarker, with the comment "summary attribute is not required on table in HTML5". That seems fine if tidy5 was only ever meant to support html5...

But now we want it to support ALL html, so is it time to bring back this warning?

Should it ALWAYS be there as it was in tidy before 2011?

Or should an appropriate warning ONLY be issued for Cases 2 and/or 3 above?

Or other ideas...

I seek comments in this before jumping down a path ;=)).

@geoffmcl geoffmcl added this to the 5.0.0 milestone May 3, 2015
@geoffmcl
Copy link
Contributor Author

geoffmcl commented May 5, 2015

See the thread https://lists.w3.org/Archives/Public/html-tidy/2015AprJun/0009.html for some discussion on alternatives to this table summary attribute...

@skynet
Copy link
Member

skynet commented May 24, 2015

I would vote for supporting only html5. This is tidy-html5

@geoffmcl
Copy link
Contributor Author

geoffmcl commented Jun 5, 2015

@skynet thanks for the comment. I would agree supporting html5, but there are still some questions.

I have constructed 4 test files, all with a table, and put them to the W3C validator, and to tidy 4.9.32 and show the results - (NWORE = No warnings or errors were found)

  1. in_210-1.html - html5, no summary - PASS NWORE
  2. in_210-2.html - html5, with summary - FAILED NWORE
  3. in_210-3.html - html4, no summary - PASS NWORE
  4. in_210-4.html - html4, with summary - PASS NWORE

Test 2 shows me the validator is serious about NO SUMMARY in HTML5, yet Tidy says NOTHING.

Here I suggest a new warning like warning: The summary attribute on the table element is obsolete in HTML5.

And also for case 3, when the document is NOT html5, output the usual summary warning, even though the validator sees nothing wrong. That is restoring tidy's previous behaviour.

Anyway, baring any convincing comments to the contrary, this is how I will proceed.

@geoffmcl geoffmcl self-assigned this Jun 5, 2015
geoffmcl added a commit that referenced this issue Jun 6, 2015
This new warning will only be seen if the document remains in HTML5 mode,
where the summary attribute is obsolete. The W3C validator flags this as
an error, and suggests 'Consider describing the structure of the table in
a caption element or in a figure element containing the table; or simplify
the structure of the table so that no description is needed'.

At the same time this patch also restored the old warning if the document
is HTML4--, if the table element lacks a summary attribute. This has been
a tidy warning since the beginning of time, although the W3C validator
does not presently flag this.
@geoffmcl
Copy link
Contributor Author

geoffmcl commented Jun 6, 2015

It's done ;=)) Bumped version to 4.9.33 for this change.

1. in_210-1.html - html5, no summary - remains NWORE
No warnings or errors were found.

Info: Document content looks like HTML5
2. in_210-2.html - html5, with summary - NEW WARNING
line 8 column 1 - Warning: The summary attribute on the <table> element is obsolete in HTML5
1 warning, 0 errors were found!

Info: Document content looks like HTML5
3. in_210-3.html - html4, no summary - OLD WARNING retored
line 9 column 1 - Warning: <table> lacks "summary" attribute
1 warning, 0 errors were found!

Info: Doctype given is "-//W3C//DTD HTML 4.01//EN"
Info: Document content looks like HTML 4.01 Strict

The table summary attribute should be used to describe
the table structure. It is very helpful for people using
non-visual browsers. The scope and headers attributes for
table cells are useful for specifying which headers apply
to each table cell, enabling non-visual browsers to provide
a meaningful context for each cell.

For further advice on how to make your pages accessible
see http://www.w3.org/WAI/GL.
. You may also want to try
"http://www.cast.org/bobby/" which is a free Web-based
service for checking URLs for accessibility.
4. in_210-4.html - html4, with summary - NWORE
No warnings or errors were found.

Info: Doctype given is "-//W3C//DTD HTML 4.01//EN"
Info: Document content looks like HTML 4.01 Strict

Look forward to testing and comments...

@geoffmcl
Copy link
Contributor Author

No comments for a few weeks, so closing this for now...

Feel free to re-open, or post a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants