Bugzilla – Bug 1027
header with role of banner throws a warning
Last modified: 2015-11-12 17:16:49 CET
A Warning is issued when a role appears on a <header> element. This is true, with one exception; role=banner, as long as there is only one on the page. Issuing a warning here is likely to cause developers to remove a role that improves accessibility. See "Allowed Aria role attributes" http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-header-element And http://www.w3.org/TR/wai-aria/roles#banner It would be nice of the validator detected more than one role=banner on the page and issues a Warning for that though.
Created attachment 236 [details] Role Banner - Passing Test
Created attachment 237 [details] Role Banner - Warning Test
(In reply to Mark Sadecki from comment #0) > A Warning is issued when a role appears on a <header> element. This is > true, with one exception; role=banner, as long as there is only one on the > page. I can't find anywhere in the spec that says that. Note that the current spec for this is http://w3c.github.io/html-aria/#header > See "Allowed Aria role attributes" > http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-header- > element I see that says "banner role (default - do not set)", but as far as I can see it doesn't say anything about role=banner being OK for <header> if there's only in the document. > And > http://www.w3.org/TR/wai-aria/roles#banner > > It would be nice of the validator detected more than one role=banner on the > page and issues a Warning for that though. I think the validator is behaving as expected per-spec but I have also pinged Steve Faulkner to confirm.
(In reply to Michael[tm] Smith from comment #3) > (In reply to Mark Sadecki from comment #0) > > A Warning is issued when a role appears on a <header> element. This is > > true, with one exception; role=banner, as long as there is only one on the > > page. > > I can't find anywhere in the spec that says that. Note that the current spec > for this is http://w3c.github.io/html-aria/#header there is no such caveat > > > See "Allowed Aria role attributes" > > http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-header- > > element > > I see that says "banner role (default - do not set)", but as far as I can > see it doesn't say anything about role=banner being OK for <header> if > there's only in the document. correct > > > And > > http://www.w3.org/TR/wai-aria/roles#banner > > > > It would be nice of the validator detected more than one role=banner on the > > page and issues a Warning for that though. > > I think the validator is behaving as expected per-spec but I have also > pinged Steve Faulkner to confirm. That is correct, use of default implicit roles emits a warning as per spec. There is a blanket 'should not' on all default implicit roles. "SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label." https://www.ietf.org/rfc/rfc2119.txt It may be the case that a devloper decides to ignore this rule to support legacy user agents.
Thanks for the clarification @steveF. Closing this bug.