```
diff --git a/_rules/scrollable-element-keyboard-accessible-0ssw9k.md b/_rules/scrollable-element-keyboard-accessible-0ssw9k.md
index 87b9e0c65ad..a92154aa247 100755
--- a/_rules/scrollable-element-keyboard-accessible-0ssw9k.md
+++ b/_rules/scrollable-element-keyboard-accessible-0ssw9k.md
@@ -40,8 +40,9 @@ This rule applies to any [HTML element][] that has [visible][] [children][] in t
## Expectation
-For each target element, at least one of the following is true:
-- the element is included in [sequential focus navigation][]; or
+For each target element, at least one of the following is true:
+
+- the element is included in [sequential focus navigation][]; or
- the element has a [descendant][] in the [flat tree][] that is included in [sequential focus navigation][]; or
- the element is [inert][].
@@ -119,7 +120,7 @@ This [scrollable][] `section` element is [inert][] because of the modal dialog,
```html
@@ -144,11 +145,11 @@ This [scrollable][] `section` element is [inert][] because of the modal dialog,
```
diff --git a/_rules/visible-label-in-accessible-name-2ee8b8.md b/_rules/visible-label-in-accessible-name-2ee8b8.md
index ac679646e82..837d7257852 100755
--- a/_rules/visible-label-in-accessible-name-2ee8b8.md
+++ b/_rules/visible-label-in-accessible-name-2ee8b8.md
@@ -24,6 +24,7 @@ acknowledgments:
authors:
- Anne Thyme Nørregaard
- Bryn Anderson
+ - Dan Tripp
- Jey Nandakumar
funding:
- WAI-Tools
@@ -39,7 +40,7 @@ This rule applies to any element for which all the following is true:
## Expectation
-For each target element, all [text nodes][] in the [visible text content][] [match characters][] and are contained within the [accessible name][] of this target element, except for characters in the [text nodes][] used to express [non-text content][]. Leading and trailing [whitespace][] and difference in case sensitivity should be ignored.
+For the target element, the [visible inner text][] is contained within the [accessible name][] according to the [label in name algorithm][].
## Background
@@ -49,6 +50,16 @@ The understanding document of [2.5.3 Label in Name][understand253] use the term
### Assumptions
+This rule assumes that the [visible inner text][] is equal to the [label][https://www.w3.org/wai/wcag21/understanding/label-in-name#dfn-label], even though "label" is not precisely defined at this point in history.
+
+This rule assumes that the visible label isn't rearranged with CSS so that it appears to the user in a different order than it appears in the DOM.
+
+This rule assumes that the visible label doesn't use CSS to add whitespace where none exists in the DOM.
+
+This rule assumes that for any word which appears in both the accessible name and the visible label, the same spelling and hyphenation is used in both places. For example: if "non-negative" is used in the accessible name and "nonnegative" is used in the visible label, that would violate this assumption. Similarly, if "color" is used in the accessible name and "colour" is used in the visible label, that would also violate this assumption.
+
+This rule - specifically, the [label in name algorithm][] that this rule relies on - assumes that the algorithm's treatment of parentheses is appropriate in the given human language. "Parentheses" are also known as "round brackets". The algorithm's treatment of parentheses is to remove them and all characters within them. This assumption can be reworded as: content within parentheses can be ignored. This assumption is almost always true in English. It is known to be often false in other languages, such as German (where parentheses indicate dual states) and Arabic (where parentheses are often used as quotation marks). Violations of this assumption will, in real-world scenarios, more often result in a false negative for this rule rather than a false positive.
+
This rule assumes that all resources needed for rendering the page are properly loaded. Checking if resources are missing is out of the scope of rules. Missing resources may be rendered as text (for example, missing `img` are rendered as their `alt` attribute).
### Accessibility Support
@@ -66,7 +77,7 @@ Implementation of [Presentational Roles Conflict Resolution][] varies from one b
#### Passed Example 1
-This link has [visible][] text that matches the [accessible name][].
+This link has [visible inner text][] that is equal to the [accessible name][].
```html
ACT rules
@@ -74,23 +85,23 @@ This link has [visible][] text that matches the [accessible name][].
#### Passed Example 2
-This link has [visible][] text that, ignoring trailing whitespace, matches the [accessible name][].
+This link has [visible inner text][] that, ignoring whitespace, is equal to the [accessible name][].
```html
-ACT rules
+ACT rules
```
#### Passed Example 3
-This link has [visible][] text that, ignoring case, matches the [accessible name][].
+This link has [visible inner text][] that, ignoring case, is equal to the [accessible name][].
```html
-ACT rules
+ACT rules
```
#### Passed Example 4
-This button has [visible][] text that is contained within the [accessible name][].
+This button has [visible inner text][] that is contained within the [accessible name][] according to the [label in name algorithm][].
```html
@@ -98,7 +109,7 @@ This button has [visible][] text that is contained within the [accessible name][
#### Passed Example 5
-This button has [visible][] text that does not need to be contained within the [accessible name][], because the "x" text node is [non-text content][]. Note: this would need to meet SC 1.1.1 Non text content.
+This button has [visible inner text][] that does not need to be contained within the [accessible name][], because the "x" text node is [non-text content][]. Note: this would need to meet SC 1.1.1 Non text content.
```html
@@ -118,11 +129,119 @@ This `button` element has the text "search" rendered as an magnifying glass icon
```
+#### Passed Example 7
+
+This button has [visible inner text][] that, according to the [label in name algorithm][], is contained within the [accessible name][]. This example shows why the [label in name algorithm][] uses the [visible inner text][] and not the [visible text content][]: the
tags insert whitespace into the result in the former but not the latter.
+
+```html
+
+```
+
+#### Passed Example 8
+
+Similar to the previous example.
+
+```html
+
+```
+
+#### Passed Example 9
+
+The [visible inner text][] of this link is "ACT" (with no spaces) because of the explicit styles of `display: inline` on the `p` elements and the absence of whitespace between the `p` elements. The cases of `display: inline` and `display: block` are handled by the definition of [visible inner text of an element][]. This example shows that the definition agrees with the visual rendering done by the browser.
+
+```html
+
+
+
+```
+
+#### Passed Example 10
+
+The [visible inner text][] is "Download specification". The words "the" and "gizmo" aren't part of it.
+
+```html
+Download thegizmo specification
+```
+
+#### Passed Example 11
+
+The [visible inner text][] is "Download specification", which includes a space character between the two words due to the second clause of the definition of [visible inner text of a text node][].
+
+```html
+Downloadspecification
+```
+
+#### Passed Example 12
+
+This example shows that the [visible inner text][] isn't always the same as the [innerText][https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute]. The visible inner text is "Download specification". The innerText is 'Download \ngizmo\nspecification'. This rule uses the visible inner text - not innerText.
+
+```html
+
+Download gizmo specification
+```
+
+#### Passed Example 13
+
+This example shows that the [label in name algorithm][] handles many kinds of whitespace.
+
+```html
+compose
+ email
+```
+
+#### Passed Example 14
+
+This example passes the rule because "YYYY-MM-DD" is in brackets. Text in brackets is removed by the [label in name algorithm][], because its not normally spoken by speech-input users.
+
+```html
+
+```
+
+#### Passed Example 15
+
+This passes for two reasons: 1) because the ellipsis ("…") is [non-text content][], and 2) because the ellipsis is neither a letter nor a digit and so is filtered out by the [label in name algorithm][].
+
+```html
+
+```
+
+#### Passed Example 16
+
+This passes because the [label in name algorithm][] effectively ignores all punctuation and emoji, in both the visible inner text and the accessible name, as long as they don't break up words.
+
+```html
+
+```
+
### Failed
#### Failed Example 1
-This link has [visible][] text that is different from the [accessible name][].
+This link has [visible inner text][] that is very different from the [accessible name][].
```html
ACT rules
@@ -130,7 +249,7 @@ This link has [visible][] text that is different from the [accessible name][].
#### Failed Example 2
-This button has [visible][] text that is only partially contained within the [accessible name][].
+This button has [visible inner text][] that is only partially contained within the [accessible name][].
```html
@@ -138,33 +257,137 @@ This button has [visible][] text that is only partially contained within the [ac
#### Failed Example 3
-This link has [visible][] text with mathematical symbols, that does not match the [accessible name][] because the mathematical symbols were written out in the accessible name. This is [explicitly mentioned in WCAG](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name#mathematical-expressions-and-formulae).
+This button has [visible inner text][] that is fully contained within the [accessible name][] when viewed as a character-by-character substring. But that does not satisfy our [label in name algorithm][], which works on full words. So this fails the rule.
```html
-Proof of 2×2=4
+Discover It
```
#### Failed Example 4
-This link has [visible][] text does not match the [accessible name][] because there is a hyphen in the accessible name.
+This link's [accessible name][] contains two tokens (according to the[label in name algorithm][]) and the [visible inner text][] contains one token. So it fails the rule.
```html
-nonstandard
+justice
```
#### Failed Example 5
-This link has [visible][] text does not match the [accessible name][] because there are extra spaces in the accessible name.
+This link has an [accessible name][] which contains a hyphen. The [label in name algorithm][] breaks up words on hyphens. So it turns "non-standard" into two tokens: "non" and "standard". So this fails the rule.
+
+```html
+nonstandard
+```
+
+#### Failed Example 6
+
+The rule has no special handling for acronyms or initialisms.
+
+```html
+W C A G
+```
+
+#### Failed Example 7
+
+The rule has no special handling for abbreviations.
+
+```html
+University Ave.
+```
+
+#### Failed Example 8
+
+This link has [visible inner text][] with mathematical symbols and is not contained within the [accessible name][] because the mathematical symbols are represented as English words (not digits) in the accessible name. This is [explicitly mentioned in WCAG](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name#mathematical-expressions-and-formulae).
+
+```html
+Proof of 2×2=4
+```
+
+#### Failed Example 9
+
+Similar to the previous example. This rule has no special handling for converting mathematical symbols into words, or vice versa.
+
+```html
+
+```
+
+#### Failed Example 10
+
+This button's accessible name contains the same tokens that are in the visible label. But they aren't in the same order, so it fails the sublist check part of the [label in name algorithm][], and so it fails the rule.
+
+```html
+
+```
+
+#### Failed Example 11
+
+This button's accessible name contains the word "the" in the middle of it, which causes the sublist check of the [label in name algorithm][] (in particular: the "consecutive" requirement of that check) to fail. So it fails the rule.
+
+```html
+
+```
+
+#### Failed Example 12
+
+This link's accessible name contains the same digits that are in the visible label, and in the same order. But they have different spaces and punctuation between them, so they are considered separate tokens. So this fails the rule.
```html
123.456.7890
```
+#### Failed Example 13
+
+This rule has no special handling which tries to guess when number have the same semantic meaning. It operates on tokens only.
+
+```html
+2021
+```
+
+#### Failed Example 14
+
+Similar to the previous example.
+
+```html
+fibonacci: 0112358132134
+```
+
+#### Failed Example 15
+
+This rule has no special handling for converting digits into words, or vice versa.
+
+```html
+two thousand twenty-one
+```
+
+#### Failed Example 16
+
+(Same as above.) This rule has no special handling for converting digits into words, or vice versa.
+
+```html
+2 0 2 3
+```
+
+#### Failed Example 17
+
+This rule has no special handling for digits that appear next to letters with no spaces in between.
+
+```html
+1
+```
+
+#### Failed Example 18
+
+The definition of [visible inner text][] doesn't treat text any differently if it's excluded from the accessibility tree with aria-hidden. So this rule effectively ignores aria-hidden. So this element fails the rule.
+
+```html
+Download gizmo specification
+```
+
### Inapplicable
#### Inapplicable Example 1
-This `nav` is not a widget, so the [visible][] text does not need to match the [accessible name][].
+This `nav` is not a widget, so the [visible inner text][] does not need to match the [accessible name][].
```html
@@ -172,7 +395,7 @@ This `nav` is not a widget, so the [visible][] text does not need to match the [
#### Inapplicable Example 2
-This email text field does not need to have its [visible][] text match the [accessible name][]. The content of a textfield shows its value instead of its label; it does not [support name from content][supports name from content]. The label is usually adjacent to the textfield instead.
+This email text field does not need to have its [visible inner text][] match the [accessible name][]. The content of a textfield shows its value instead of its label; it does not [support name from content][supports name from content]. The label is usually adjacent to the textfield instead.
```html
E-mail
@@ -181,7 +404,7 @@ This email text field does not need to have its [visible][] text match the [acce
#### Inapplicable Example 3
-This `div` element does not have a widget role, so the [visible][] text does not need to match the [accessible name][].
+This `div` element does not have a widget role, so the [visible inner text][] does not need to match the [accessible name][].
```html