Re: Request for explanation: "the main element must not appear as a descendant of the td element" error message.

David, thanks for your thought. Very clear explanation. 
When you say: "The validator is comparing to the What WG Living HTML specification, and not the HTML 5.2 specification.", is-it a rule of thumb governing the way the validator is implemented? 

Jean-Pierre 


De: "David Dorward" <david@dorward.me.uk> 
À: "Jean-Pierre GAY" <jpg@temesis.com> 
Cc: "www-validator" <www-validator@w3.org> 
Envoyé: Jeudi 31 Janvier 2019 10:14:54 
Objet: Re: Request for explanation: "the main element must not appear as a descendant of the td element" error message. 



On 30 Jan 2019, at 19:06, Jean-Pierre GAY wrote: 




I've got this error message: "the main element must not appear as a descendant of the td element". 


BQ_BEGIN


However, nothing in the HTML specification indicates that " the main element must not appear as a descendant of the td element": Content model for td is flow content and parent content model expected for main is also flow content (except for article, aside, footer, header and nav). So, what is the meaning of this error message? 
BQ_END



Start stream of thought 

It looks like this is caused by this change: [ https://github.com/validator/validator/commit/8024cd861c666890795b897d42c457666b598cb5 | https://github.com/validator/validator/commit/8024cd861c666890795b897d42c457666b598cb5 ] 

This does appear to contradict the HTML 5.2 specification: [ https://www.w3.org/TR/html5/grouping-content.html#the-main-element | https://www.w3.org/TR/html5/grouping-content.html#the-main-element ] 

The WHAT WG spec says: [ https://html.spec.whatwg.org/multipage/grouping-content.html#the-main-element | https://html.spec.whatwg.org/multipage/grouping-content.html#the-main-element ] 

BQ_BEGIN


Contexts in which this element can be used: 

Where flow content is expected, but only if it is a hierarchically correct main element. 
BQ_END



and: [ https://html.spec.whatwg.org/multipage/grouping-content.html#hierarchically-correct-main-element | https://html.spec.whatwg.org/multipage/grouping-content.html#hierarchically-correct-main-element ] 

BQ_BEGIN


A hierarchically correct main element is one whose ancestor elements are limited to html, body, div, form without an accessible name, and autonomous custom elements. Each main element must be a hierarchically correct main element. 
BQ_END



This agrees with the comment on the change to the validator: 

BQ_BEGIN


Allow only `html`, `body`, `div`, `form`, custom elements as `main` ancestor 
BQ_END



End stream of thought 

The validator is comparing to the What WG Living HTML specification, and not the HTML 5.2 specification. 

I suspect that the HTML 5.2 version is based on an older snapshot of What WG Living and it has changed in the meantime. 

-- 
David Dorward 
[ http://dorward.co.uk/ | http://dorward.co.uk/ ] 

Received on Thursday, 31 January 2019 14:20:45 UTC