dequelabs / dequelabs/axe-core
Rule 'dlitem' does not match 'definition-list'
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 17
Description
Product:
axe-core 4.4.2
Rule:
[dlitem](https://dequeuniversity.com/rules/axe/4.4/dlitem)
Expectation:
The content under the "Why it Matters", "Rule Description", and "The Algorithm (in simple terms)" headings should reflect the guidance in [definition-list](https://dequeuniversity.com/rules/axe/4.4/definition-list) (`
- ` elements must only directly contain properly-ordered `
- ` and `
- ` groups, ``, or `<template>` elements). Namely that a `<dt>` and `<dd>` must have a `<dl>` as an ancestor (or have a parent of a `<script>`, `<template>`, or `<div>` whose parent, in turn, is `<dl>`).
Actual:
The content under the "Why it Matters" heading reads:
> A definition list item must be wrapped in parent `dl` elements, otherwise it will be invalid.
>
> A definition list must follow a specific hierarchy. A list is defined using the `dl` element. What follows are alternating sets of `dt` and `dd` elements, starting with the `dt` element. `dt` elements define a term while `dd` elements denote a term's description. Each set of `dt` elements must have a corresponding set of `dd` elements. Only `dt` and `dd` elements are allowed in definition list. If this hierarchy is not followed, the list will be invalid.The content under the "Rule Description" heading reads:
> Definition list items (`dt` and/or `dd`) must be wrapped in parent `dl` elements to be valid. This enables screen reader users to understand the proper hierarchy of information in the list.The content under the "The Algorithm (in simple terms)" heading reads:
> Ensures that all child `dd` and `dt` elements have a `dl` as a parent.Motivation:
The language of rule dlitem is in conflict with the spec and axe rule definition-list. This is confusing devs. It may also be contributing to confusion with https://a11y-automation.dev/violations/valid-dl-elements/, even though it references the correct rule.
Contributor guide
Assessment
This issue has not been assessed yet.