Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HTML-AAM] proscribe header/footer mappings to landmark roles #277

Closed
stevefaulkner opened this issue Mar 1, 2016 · 24 comments
Closed

[HTML-AAM] proscribe header/footer mappings to landmark roles #277

stevefaulkner opened this issue Mar 1, 2016 · 24 comments

Comments

@stevefaulkner
Copy link
Contributor

It has been suggested that browser mappings for header = banner and footer=contentinfo should be only be exposed when the header/footer elements are scoped to the body element.

refer to w3c/html-aria#27

@ZoeBijl
Copy link

ZoeBijl commented Mar 1, 2016

This was also discussed in the APG call from February 29th.

@jongund
Copy link
Contributor

jongund commented Mar 1, 2016

I agree with this change. It should be harder rather than easier to make banner and contentinfo landmark.

@jasonkiss
Copy link
Contributor

As I understand it, this is what the HTML-AAM already states for both footer and header

Only where the header or footer element is scoped to the body (i.e. its nearest sectioning content or sectioning root ancestor is body) do they get mapped to their respective ARIA landmarks. Otherwise, where the header or footer element is a descendant of any of the following elements, it is not mapped to a landmark:

  • article
  • aside
  • nav
  • section
  • blockquote
  • details
  • dialog
  • fieldset
  • figure
  • td

It is true, though, that a header in a main element that is a child of body will not be scoped to the main element but to the body and therefore the whole page, and be mapped as banner landmark. And similarly, footer that is child of main will be mapped as contentinfo landmark.

@jasonkiss jasonkiss added the AAM label Mar 2, 2016
@stevefaulkner
Copy link
Contributor Author

@jasonkiss yes you are correct, although i have always read it as section/article only, my bad. Currently to my knowledge browsers only implement section/article so will go file some implementation bugs and see how it goes. I also think that <main> should be included, any objections?

@ZoeBijl
Copy link

ZoeBijl commented Mar 2, 2016

I agree tot he <main> thing, if by that you mean that <header> in <main> does not get a role of banner.

@MarcoZehe
Copy link

@stevefaulkner No objections from my end, either. Please file a bug against Firefox and CC me if we still have a bug in our implementation.

@stevefaulkner
Copy link
Contributor Author

@MichielBijl yes that's what I mean. @MarcoZehe - thanks will file!

@ZoeBijl
Copy link

ZoeBijl commented Mar 2, 2016

@stevefaulkner
Copy link
Contributor Author

Have updated HTML-AAM to add main as a modifier for header/footer mapping
b3e0791

@stevefaulkner
Copy link
Contributor Author

@LJWatson
Copy link
Contributor

LJWatson commented Mar 2, 2016

@stevefaulkner
This proposal makes sense to me. To clarify one point though... are you suggesting that the current implimentation scenario where <header> or <footer> inside <main> are currently exposed as the banner/contentinfo for the document be continued, or that under no circumstances should they be exposed when children of <main>.

@stevefaulkner
Copy link
Contributor Author

@LJWatson

under no circumstances should they be exposed when children of <main>

yes

@LJWatson
Copy link
Contributor

LJWatson commented Mar 2, 2016

@stevefaulkner thanks for clarification.

jasonkiss added a commit that referenced this issue Mar 2, 2016
@jasonkiss
Copy link
Contributor

@stevefaulkner et al.

  1. The wording added in b3e0791 reads as if main is a sectioning content element. The scenario we need to describe is where header or footer is not a child of main, or conversely, main is not the parent of header or footer. I've updated in the commits noted above, primarily 2191f57.
  2. Is there an implicit assumption here that a header or footer in main are scoped to the main element, and therefore act as the header or footer, respectively, for that main element (as if it were a sectioning content element like
    or even though it currently isn’t)?

If so, then a bug against HTML5.1 should be filed so that, for example, the header element represents introductory content for its nearest ancestor sectioning content or sectioning root element, or for its parent main element if it is a child of main.

If there is no assumption that header or footer in main are scoped to main, then I think things are getting a little confusing, and not mapping header or footer in main to landmarks is a slightly odd exception to an otherwise clear rule.

Is another possible approach to clarify in HTML5.1 with author guidance that header or footer in main remain scoped to the nearest ancestor sectioning content or sectioning root element, and not main, in which case they'll serve as header or footer for either the body element (and be landmarks) or whatever other sectioning element they're in (and not be landmarks)?

@stevefaulkner
Copy link
Contributor Author

@jasonkiss

I agree it may not be clear, but what you have changed it to reads as the opposite of what is intended:

footer (nearest ancestor sectioning content or sectioning root element is not body, and parent is not main)

The pattern is:

<body>

<header> = banner
<body> 
<main> or sectioning content 
<header> NOT= banner

so I think should read more like

footer (nearest ancestor sectioning content or sectioning root element is not body, or parent is main)

jasonkiss added a commit that referenced this issue Mar 2, 2016
@jasonkiss
Copy link
Contributor

@stevefaulkner good catch. I mistakenly had the converse. Fixed in 66e5317
What's your thoughts on header and footer being scoped to main and the possible need to update HTML5.1 spec?

@jasonkiss
Copy link
Contributor

The more I think about this, the more I think we shouldn't bother specifying that header/footer in main isn't a landmark, unless the definition of header/footer changes to allow them to be scoped to main like they can be to other sectioning elements. Even then, it would get quite confusing.

I'd currently consider it author error to use header/footer in main and expect them to act as header or footer for main, because main is not a sectioning element.

If we do want to say that header/footer in main is not a landmark, it occurs to me that we need to adjust the way to specify this in the mappings. Referring to main as parent isn't quite correct.

header/footer landmark patterns to account for:

<body>
<header> = banner
<body>
<div>
<header> = banner

The above scenarios might be described as "header (descendant of body but not descendant of main or of other sectioning content or sectioning root element)"

Patterns where header/footer are NOT landmarks:

<body>
<main>
<header> = NOT banner
<body>
<article>
<header> = NOT banner
<body>
<main>
<article>
<header> = NOT banner
<body>
<main>
<div>
<header> = NOT banner

Can we describe these as, for example, "header (descendant of main, or of sectioning content or sectioning root element other than body)"?

@stevefaulkner
Copy link
Contributor Author

Can we describe these as, for example, "header (descendant of main, or of sectioning content or sectioning root element other than body)"?

yes

@jasonkiss
Copy link
Contributor

I'm still not entirely comfortable with this change.

What is an author intending when nesting header or footer in main (and not also within some other sectioning content element)? Are they thinking they are creating a header or footer for the main element, as if it were a sectioning element? If so, they're currently wrong as per the HTML5 spec, no? If so, it makes no sense to nest header or footer as child of main, no?

And so why, from an a11y API perspective, would the relative positioning of header or footer with respect to main have any bearing on their mapping as landmarks or not?

Either main should become a sectioning element, which is a different can of worms, or header/footer intended as header or footer for main should be considered author error, advised against, and not impact their a11y API mapping.

@stevefaulkner
Copy link
Contributor Author

take a look at the following example http://codepen.io/stevef/pen/VavBay I don't think it is either an author error or misunderstanding (conforms to HTML), but as it currently stands, for implicit sections, all headers=banner which is not desirable.

@jasonkiss
Copy link
Contributor

I agree that header==banner is not what an author has likely intended, but what is an author meaning to do with header by using it to enclose those headings in this example? The HTML5.1 spec, as I read it, is pretty clear on this: use of header in this example doesn't do anything more than div, so why would we establish special mapping criteria?

@stevefaulkner
Copy link
Contributor Author

The HTML5.1 spec, as I read it, is pretty clear on this: use of header in this example doesn't do anything more than div, so why would we establish special mapping criteria?

HTML encourages use of <header> to group headings and taglines etc. And yes header in these cases is supposed to be a grouping object only, so that is the reason why we should establish additional special mapping criteria. i.e. to avoid excessive, confusing appearances of role=banner.

@jasonkiss
Copy link
Contributor

Then I suggest the element definition for header be updated to note that grouping usage and to clarify:

  • that a header can represent introductory content for its nearest ancestor main element, or sectioning content or sectioning root element
  • that when the header element's nearest ancestor sectioning content or sectioning root element is the body element, then it applies to the whole page, unless the header element is nested within main

@jasonkiss
Copy link
Contributor

This issue was moved to w3c/html-aam#34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants