Testing axe rule for Label in Name

Page includes the axe test page for the label-content-name-mismatch rule, plus some tests not in axe's test suite. This page reveals serious problems with axe-core 4.0.2.

axe tests (or is supposed to test) that the visible label is part of the accessible name.

The SC says that labels that include text or images of text must have a name that contains the text visually presented. So the label has to be fully in the name. But if the label is a symbol/icon/graphic that is not text. So then the name can be user's choice – that is, the SC does not apply.

The axe test suite HTML page testing label-content-name-mismatch rule

Passes

These all pass axe as expected.

next page
next page
next page
next pAge
uNtIl the very end  
UNTIL THE VeRy EnD

Fails

All of these should fail axe but none actually does, as of axe-core 4.0.2. None get marked as Needs Review, either. Because of this, the current usefulness of this axe rule is questionable.

Next
Next
123
some content

Incompletes

All are marked as needs review by axe, but only some should be, as noted, below. However, at least axe is marking these as something that a human needs to review. That's bettern than missing the fails.

Should pass or be inapplicable (but marked needs review) because symbol/graphic is label:

Should fail (and is marked needs review) because label is not in name and label is text:

Should pass or be inapplicable (but is marked needs review) because symbol is label (question mark symbol) and name is help:

Should pass or be inapplicable (but is marked needs review) because symbol is label and same symbol is name:

Should pass or be inapplicable (but is marked needs review) because symbol is label (and name is close):

Should pass or be inapplicable (but is marked needs review) because ascii art symbol is label (wink is name):

Should fail axe (and is marked needs review) because the ascii text charater of X is text and the label is close:

Should pass or be inapplicable (but is marked needs review) because the visible label is merely a symbol of a comet:

Should pass or be inapplicable (but is marked needs review) because the question mark is a symbol and thus out of scope for the SC:

Should pass or be inapplicable (but is marked needs review) because the label is a hamburger symbol and symbols are out of scope:

Should pass (but is marked needs review) because the X icon is a symbol, not text or an image of text:

Inapplicables

All are designated inapplicable in axe test suite due to role (or lack of any role) or labelling with no visible label.

This should be inapplicable. It's a link with a label of Next and an accessible name of OK but the link has no href and is thus invalid: Next

(this is a tooltip, so inapplicable)
RSS Feed
(this is a feed, so inapplicable, but label and name are the same so this is a poor test case)
Foo Restaurant
(this is a marquee, so inapplicable)

Custom tests not in axe suite

For-ID associated valid pairing: should pass, but just appears to be ignored by axe rather than passing:

For-ID associated but aria-label overrides pairing: fails label in name but not axe:

Label surrounds input but aria-label overrides name: fails label in name but not axe:

Ampersand character entity used in label and name: passes label in name and axe:

Ampersand character entity used in label and unescaped in name: since both text and label are identical, should pass axe though feels like a fail of spirit of label in name:

Ampersand character entity used in label and ascii and in accessible name: passes axe and spririt of label in name:

ARIA hidden close icon-like character as visible label but close as name. Technical pass because nothing is always a part of the accessible name, right?? Axe marks this as Needs Review. That seems like a prudent move: