Rule 11.8.2

Summary

This test consists in checking the presence of the "label" attribute for all the <optgroup> elements within <select> elements of the page.

Business description

Criterion

11.8

Test

11.8.2

Description

Dans chaque balise <select>, chaque balise <optgroup> possède-t-elle un attribut label ?

Technical notes (criterion 11.8)

Il est possible d’utiliser une balise ayant un attribut WAI-ARIA role="listbox" en remplacement d’une balise <select>. En revanche, il est impossible de créer des groupes d’options via l’utilisation de WAI-ARIA. De ce fait, une liste nécessitant un regroupement d’options structurée à l’aide d’une balise ayant un attribut WAI-ARIA role="listbox" sera considérée comme non conforme au critère 11.8.

Level

A

Technical description

Scope

Page

Decision level

Decidable

Algorithm

Selection

Set1

All the <optgroup> tags within <select> tags of the page (css selector: select optgroup)

Process

Test1

For each element of Set1, test the presence of the "label" attribute.

For each occurrence of false-result of Test1, raise a MessageA

MessageA: Optgroup without label attribute
  • code: OptgroupWithoutLabel
  • status: Failed
  • parameter: tag name, snippet
  • present in source: yes

Analysis

Passed

All the <optgroup> tags within <select> tags have a "label" attribute (Test1 returns true for all the elements of Set1)

Failed

At least one <optgroup> tag within a <select> tag has no "label" attribute (Test1 returns false for at least one element of Set1)

Not Applicable

The page has no <optgroup> tag within <select> tags (Set1 is empty)

Files