Re: Invalid HTML versus not(?) failing 4.1.1: Parsing

On 31/01/2022 21:37, Bristow, Alan wrote:

> I know 4.1.1 is complex topic, but I have a CMS adding an ALT attribute 
> to a DIV (yes, a (redundant) DIV) that is wrapping an IMG. The IMG also 
> (validly) has an ALT attribute. Per the spec the DIV's ALT is invalid:
> 
> https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element 
> <https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element>
> 
> specifically 'Global attributes'
> 
> https://html.spec.whatwg.org/multipage/dom.html#global-attributes 
> <https://html.spec.whatwg.org/multipage/dom.html#global-attributes>
> 
> 
> In short, I assume it is not a fail if someone adds an ALT attribute to 
> a DIV, even though it is blatantly invalid HTML, because it does not (I 
> sadly think) satisfy the wording of 4.1.1 or F70.

Correct, having invalid attributes is not a failure of 4.1.1. And in 
practice, invalid/unknown attributes don't cause any actual 
accessibility issues.

P
-- 
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

Received on Monday, 31 January 2022 22:02:37 UTC