NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 725 - Presentational elements are sometimes reported as content model errors
Presentational elements are sometimes reported as content model errors
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Nobody
http://google.com/
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-20 08:11 CET by Maciej Stachowiak
Modified: 2013-07-12 05:29 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2010-03-20 08:11:52 CET
When validating google.com, presentational elements are sometimes reported as content model errors instead. Sometimes, <center> errors are reported like this:

 * Error: The center element is obsolete. Use CSS instead.

Other times it's like this:

 * Error: Element center not allowed as child of element span in this context. (Suppressing further errors from this subtree.)

It seems like the "use CSS" error is more accurate and useful.

<nobr> also suffers this problem.
Comment 1 Michael[tm] Smith 2010-04-09 07:57:04 CEST
(In reply to comment #0)
> When validating google.com, presentational elements are sometimes reported as
> content model errors instead. Sometimes, <center> errors are reported like
> this:
> 
>  * Error: The center element is obsolete. Use CSS instead.
> 
> Other times it's like this:
> 
>  * Error: Element center not allowed as child of element span in this context.
> (Suppressing further errors from this subtree.)

The reason for the difference is that the first error message is reporting an error for a case of something that is valid in HTML4 but has been made invalid in HTML5. The second error message is reporting and error for something that is not valid in HTML4 -- namely, that the center element is not allowed as a child of span (nor of any other phrasing/inline element; center was only previously allowed as a block element).

We could change that the first message is generated in both cases, but I first would like to hear whether Henri thinks that'd be a good idea or not.
Comment 2 Michael[tm] Smith 2013-07-12 05:29:40 CEST
I realize this is confusing but we don't seem to have much momentum for changing it