axe-core icon indicating copy to clipboard operation
axe-core copied to clipboard

Rule 'landmark-complementary-is-top-level' does not reflect behavior

Open aardrian opened this issue 1 year ago • 4 comments

Product: axe-core 4.4.2

Rule: landmark-complementary-is-top-level

Expectation: The content under the "How to Fix the Problem" heading should not declare there is an issue with <aside> scoped to <main>. It should conform with the update made in axe-core 4.2 to allow <aside> to be scoped to <main>

Actual: The content under the "How to Fix the Problem" heading reads:

The following example FAILS the Complementary landmarks are at the top level rule:

<main>
 <p>Some text</p>
 <aside><p>An aside</p></aside>
</main>

While testing, I made a pen that confirms Axe correctly does not throw a warning (or any message) for an <aside> scoped to <main>: https://cdpn.io/pen/debug/vYRrpQy

Motivation: This language and example do not reflect the rule.

It is also wrongly causing some devs to follow the language on the page instead of the rule, the spec, or actual browser support.

aardrian avatar Aug 08 '22 16:08 aardrian

Thanks Adrian. You're absolutely correct. The documentation here doesn't reflect what axe-core does. <aside> shouldn't ever really be failed by this rule. The problem can only really occur from using role="complementary" in the wrong place. Our docs are wrong on this.

WilcoFiers avatar Aug 09 '22 09:08 WilcoFiers

I just ran into this. I don’t think this should be a fail (or best practice violation). ARIA 1.2 does not limit the use of role=complementary in any way that I can see.

https://www.w3.org/TR/wai-aria-1.2/#complementary

yatil avatar May 24 '23 11:05 yatil

@WilcoFiers we're at axe 4.8 with the same issues... can Deque please update this incorrect rule for 4.9?

jamieherrera avatar Oct 04 '23 15:10 jamieherrera

@jamieherrera thanks for the reminder. I've added this ticket to the 4.9 milestone so we don't forget about it again.

straker avatar Oct 04 '23 15:10 straker