Bugzilla – Bug 725
Presentational elements are sometimes reported as content model errors
Last modified: 2013-07-12 05:29:40 CEST
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.
(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.
I realize this is confusing but we don't seem to have much momentum for changing it