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

Proposal to add dynamic values for aria-level (headings) #1361

Closed
romaingervois opened this issue Nov 27, 2020 · 5 comments
Closed

Proposal to add dynamic values for aria-level (headings) #1361

romaingervois opened this issue Nov 27, 2020 · 5 comments
Milestone

Comments

@romaingervois
Copy link

romaingervois commented Nov 27, 2020

Hello,

It would be cool to be able to dynamically manage section headings via aria-level.
Three values could be used to manage a large number of cases.

  • n-1 : the level is the level of the previous heading minus 1.
  • n : the level is the same as the level of the previous heading.
  • n+1 : the level is the level of the previous heading plus 1.

Note:

  • if there's no previous heading, the default value of aria-level (level 2 as per the current specs) is applied.
  • if the value is n-1 and the previous heading has a level 1, the default value of aria-level is applied.

Example with an unique code :

<p role="heading" aria-level="n+1">Article 1</p>
<p role="heading" aria-level="n">Article 2</p>
<p role="heading" aria-level="n">Article 3</p>

Context 1:

Code:

<h1>Category of articles</h1>
<p role="heading" aria-level="n+1">Article 1</p>
<p role="heading" aria-level="n">Article 2</p>
<p role="heading" aria-level="n">Article 3</p>

Result (headings):

h1) Category of articles
h2) Article 1
h2) Article 2
h2) Article 3

Context 2:

Code:

<h2>Related articles</h2>
<p role="heading" aria-level="n+1">Article 1</p>
<p role="heading" aria-level="n">Article 2</p>
<p role="heading" aria-level="n">Article 3</p>

Result (headings):

h2) Related articles
h3) Article 1
h3) Article 2
h3) Article 3

What do you think of this proposal?

Have a nice day.
Romain

@JAWS-test
Copy link
Contributor

JAWS-test commented Nov 27, 2020

This is a very good suggestion. Above all, it would solve the problem that always occurs when external content is embedded in a page.

Example: The video player of YouTube contains a <h2> heading (= video title). This usually contradicts the rest of the page structure (e.g. if the player is located in an area with a <h3> heading and therefore the YouTube heading should be a <h4>).
But since YouTube does not know the page structure, this would be the perfect solution!

@jnurthen
Copy link
Member

jnurthen commented Dec 1, 2020

(not a comment on the proposal itself) Please note - there is no longer a default aria-level of 2 for headings. This is now defined only in the error correction section.

@pkra
Copy link
Member

pkra commented Dec 1, 2020

This proposal feels a lot like headinglevelstart proposed at whatwg/html#5033 (or any other discussion about the outline algorithm and/or level-agnostic heading elements).

@jnurthen
Copy link
Member

jnurthen commented Sep 8, 2023

Removing 1.4 milestone as I don't think we can look at this until the associated html issue gets consensus.

@jnurthen jnurthen added this to the ARIA 2.0 milestone Sep 8, 2023
@pkra
Copy link
Member

pkra commented Sep 9, 2023

@jnurthen I'd suggest to just close this. The HTML side just doesn't seem likely after removing the document outline -- but if it does against all odds it'll be easy to pick up again on the ARIA end.

@jnurthen jnurthen closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2023
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

4 participants