Skip to content

Commit b45da01

Browse files
Jym77kasperisager
andauthored
Improve definition of "disabled element" (#1503)
* Modernise writing style * Copy Assumption from definition to rule Co-authored-by: Kasper Isager <kasperisager@gmail.com>
1 parent 1703e80 commit b45da01

File tree

2 files changed

+13
-29
lines changed

2 files changed

+13
-29
lines changed

_rules/text-contrast-afw4f7.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ For each test target, the [highest possible contrast][] between the [foreground
4646

4747
- Text that has the same foreground and background color (a contrast ratio of 1:1) is not considered to be "visual presentation of text", making it inapplicable to the success criterion. Text hidden in this way can still cause accessibility issues under other success criteria, depending on the content.
4848

49+
- The definition of [disabled element][disabled] assumes that when the `aria-disabled` attribute is specified on an element, this element has also been disabled for users that do not rely on [assistive technology][]. If this is not the case, that definition may produce incorrect results and in consequence this rule might be Inapplicable to some text nodes that still require a good contrast ratio.
50+
4951
## Accessibility Support
5052

5153
- Different browsers have different levels of support for CSS. This can cause contrast issues in one browser that do not appear in another. Because of that, this rule can produce different results depending on the browser that is used. For example, a text that is positioned using CSS transform may be on a different background in a browser that does not support CSS transform.
@@ -380,6 +382,7 @@ This text is part of a label of a [disabled][] widget, because it is in a `label
380382

381383
[accessible name]: #accessible-name 'Definition of Accessible Name'
382384
[ancestor]: https://dom.spec.whatwg.org/#concept-shadow-including-ancestor 'DOM, ancestor, 2020/07/23'
385+
[assistive technology]: https://www.w3.org/TR/WCAG21/#dfn-assistive-technologies 'WCAG definition of Assistive Technologies'
383386
[background colors]: #background-colors-of-text 'Definition of Background color of text'
384387
[child]: https://dom.spec.whatwg.org/#concept-tree-child 'DOM, child, 2020/07/23'
385388
[disabled]: #disabled-element 'Definition of Disabled'

pages/glossary/disabled-element.md

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,19 @@ input_aspects:
77
- DOM tree
88
---
99

10-
An element is considered disabled when it has been rendered [inoperable][] using one of the following properties:
10+
An element is _disabled_ when it has been rendered [inoperable][] in one of the following ways:
1111

12-
1. The [`disabled`][disabled] attribute. The presence of this attribute, regardless of its value, on a
12+
1. The element matches the [`:disabled` pseudo-class][disabled pseudo-class]. For HTML elements this means that the element is [actually disabled][].
1313

14-
- [`button`][button],
15-
- [`input`][input],
16-
- [`select`][select],
17-
- [`textarea`][textarea],
18-
- [form-associated custom element][],
19-
- or [`fieldset`][fieldset] element
14+
2. The element has a [shadow-including ancestor][] whose `aria-disabled` [attribute value][] is "true".
2015

21-
will disable the element itself if it is not a [`fieldset`][fieldset] or, if it is, will disable any [descendants][descendant] of the element, excluding those that are [descendants][descendant] of the first [`legend`][legend] [child][] of the element.
16+
#### Assumptions
2217

23-
**Note:** When the [`disabled`][disabled] attribute is specified on a [`fieldset`][fieldset] element, [shadow-including descendants][shadow-including descendant] are **not** disabled by default. Such behavior may however be explicitly implemented by [form-associated custom elements][form-associated custom element].
18+
This definition assumes that when the `aria-disabled` attribute is specified on an element, this element has also been disabled for users that do not rely on [assistive technology][]. For example, this can be done by disabling pointer events using the `pointer-events` property and by disabling keyboard interactions using the `tabindex` attribute. If this is not the case, the definition will produce incorrect results.
2419

25-
2. The [`aria-disabled`][aria-disabled] attribute. The presence of this attribute with a value that is an [ASCII case-insensitive](https://infra.spec.whatwg.org/#ascii-case-insensitive) match for `true` on an element will communicate its state, and the state of its [shadow-including descendants][shadow-including descendant], as "disabled" to [assistive technology][].
26-
27-
**Note:** When the [`aria-disabled`][aria-disabled] attribute is specified on an element, it is assumed that the element has also been disabled for users that do not rely on [assistive technology][]. For example, this can be done by disabling pointer events using the [`pointer-events`][pointer-events] property and by disabling keyboard interactions using the [`tabindex`][tabindex] attribute.
28-
29-
[aria-disabled]: https://www.w3.org/TR/wai-aria/#aria-disabled
30-
[assistive technology]: https://www.w3.org/TR/WCAG21/#dfn-assistive-technologies)
31-
[button]: https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element
32-
[child]: https://dom.spec.whatwg.org/#concept-tree-child
33-
[descendant]: https://dom.spec.whatwg.org/#concept-tree-descendant
34-
[disabled]: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-disabled
35-
[fieldset]: https://html.spec.whatwg.org/multipage/form-elements.html#the-fieldset-element
36-
[form-associated custom element]: https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-element
37-
[input]: https://html.spec.whatwg.org/multipage/input.html#the-input-element
38-
[legend]: https://html.spec.whatwg.org/multipage/form-elements.html#the-legend-element
20+
[actually disabled]: https://html.spec.whatwg.org/multipage/semantics-other.html#concept-element-disabled 'HTML definition of Actually Disabled'
21+
[assistive technology]: https://www.w3.org/TR/WCAG21/#dfn-assistive-technologies 'WCAG definition of Assistive Technologies'
22+
[attribute value]: #attribute-value 'Definition of Attribute Value'
23+
[disabled pseudo-class]: https://drafts.csswg.org/selectors/#disabled-pseudo "CSS Selectors Level 4 (Editor's Draft), definition of the :disabled pseudo-class"
3924
[inoperable]: https://www.w3.org/TR/wai-aria/#dfn-operable
40-
[pointer-events]: https://www.w3.org/TR/SVG2/interact.html#PointerEventsProperty
41-
[select]: https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element
42-
[shadow-including descendant]: https://dom.spec.whatwg.org/#concept-shadow-including-descendant
43-
[tabindex]: https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
44-
[textarea]: https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
25+
[shadow-including ancestor]: https://dom.spec.whatwg.org/#concept-shadow-including-ancestor

0 commit comments

Comments
 (0)