-
Notifications
You must be signed in to change notification settings - Fork 76
Update auto-update-text-efbfc7.md #1959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,7 @@ acknowledgments: | |
|
||
## Applicability | ||
|
||
This rule applies to any [HTML element][] that has a [visible][] [text node][] as a [descendant][] in the [flat tree][], for which all the following is true: | ||
|
||
- **changed:** the `innerText` property of the element changes multiple times within a 10 minute time span where there is no [user interaction][]; and | ||
- **no child changed:** the element does not have [children][child] in the [flat tree][] whose `innerText` property also changes; and | ||
- **not alone:** the element has an [ancestor][] element in the [flat tree][] with a non-empty `innerText` property whose value is different from the `innerText` of the test target. | ||
This rule applies to any [HTML element][] that has one or more [visible][] [text nodes][] as [children][] in the [flat tree][], where the combined text from the [text nodes][] changes multiple times within a 10 minute time span where there is no [user interaction][]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been doing a bit of rule archaeology… The " <div id="x"><b>Hello world</b></div>
<script>
setTimeout(() => document.querySelector('#x').innerHTML = '<i>Goodbye</i>', 1000)
</script> Where the The actual move to use Then of course, the new Applicability uses "combined text" which sounds like a non-technical way to say In any case, due to the first example in this comment, the change is a big change in Applicability, making the rule much less applicable. I'm not sure this is what we want. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I appreciate the rule archaeology, that does help me understand why the applicability was formulated like this. I am going to do some additional poking to see if there is a way to restate it to make it a bit simpler. At the very least (if i can't come up with anything) I would like to add a Note that discusses the context of no child changed and not alone, such as your comment above on where the not alone came from and then for no child changed how that localizes the target to the descendant closest to the changed text. I figured I would need to define "combined text" in more definite terms. My intention is that it is calculated as the union of the text of all the text nodes of a parent( e.g., so if a parent has 3 text nodes a, b, and c, its combined text would be the union of text from a, b, c). This was my attempt to get rid of some of the tree traversal the no child changed condition brings with it. But your first example above using |
||
|
||
## Expectation | ||
|
||
|
@@ -77,7 +73,7 @@ The [instruments][instrument] used to pass this rule (if any), must meet all lev | |
|
||
#### Passed Example 1 | ||
|
||
This `span` element contains text content that is automatically **changed** multiple times without user intervention and there is a button available to stop the automatic changes. The rule is not applicable to the second `p` element because it has a **child changed** (the `span` element). | ||
This `span` element contains text content that automatically changes multiple times without user intervention and there is a button available to stop the automatic changes. The rule is not applicable to the second `p` element because its child [text node][] is unchanged. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where we need to be clear about what "contains text content" means. I guess we'll end up saying that "contains text content" refers to the |
||
|
||
```html | ||
<body onload="startUpdates()"> | ||
|
@@ -95,7 +91,7 @@ This `span` element contains text content that is automatically **changed** mult | |
|
||
#### Passed Example 2 | ||
|
||
This `span` element contains text content that is automatically **changed** multiple times without user intervention and there is a button available to pause and resume the automatic changes. The rule is not applicable to the second `p` element because it has a **child changed** (the `span` element). | ||
This `span` element contains text content that automatically changes multiple times without user intervention and there is a button available to pause and resume the automatic changes. The rule is not applicable to the second `p` element because its child [text node][] is unchanged. | ||
|
||
```html | ||
<body onload="startUpdates()"> | ||
|
@@ -113,7 +109,7 @@ This `span` element contains text content that is automatically **changed** mult | |
|
||
#### Passed Example 3 | ||
|
||
This `span` element contains text content that is automatically **changed** multiple times without user intervention and there is a button available to hide the automatically updating content. The rule is not applicable to the second `p` element because it has a **child changed** (the `span` element). | ||
This `span` element contains text content that automatically changes multiple times without user intervention and there is a button available to hide the automatically updating content. The rule is not applicable to the second `p` element because its child [text node][] is unchanged. | ||
|
||
```html | ||
<body onload="startUpdates()"> | ||
|
@@ -131,7 +127,7 @@ This `span` element contains text content that is automatically **changed** mult | |
|
||
#### Passed Example 4 | ||
|
||
This `span` element contains text content that is automatically **changed** multiple times without user intervention and there is an [instrument][] available to modify the frequency of the changes. The rule is not applicable to the second `p` element because it has a **child changed** (the `span` element). | ||
This `span` element contains text content that automatically changes multiple times without user intervention and there is an [instrument][] available to modify the frequency of the changes. The rule is not applicable to the second `p` element because its child [text node][] is unchanged. | ||
|
||
```html | ||
<body onload="startUpdates()"> | ||
|
@@ -151,7 +147,7 @@ This `span` element contains text content that is automatically **changed** mult | |
|
||
#### Passed Example 5 | ||
|
||
This `span` element contains text content that is automatically **changed** multiple times without user intervention and the location of an [instrument][] to control the changes is clearly available. | ||
This `span` element contains text content that automatically changes multiple times without user intervention and the location of an [instrument][] to control the changes is clearly available. The rule is not applicable to the second `p` element because its child [text node][] is unchanged. | ||
|
||
```html | ||
<body onload="startUpdates()"> | ||
|
@@ -199,7 +195,7 @@ This `span` element contains text content that is automatically **changed** mult | |
|
||
#### Failed Example 1 | ||
|
||
This `span` element contains text content that is automatically **changed** multiple times without user intervention and there is no [instrument][] available to stop, pause, hide or alter the frequency of the automatic changes. | ||
This `span` element contains text content that automatically changes multiple times without user intervention and there is no [instrument][] available to stop, pause, hide or alter the frequency of the automatic changes. | ||
|
||
```html | ||
<body onload="startUpdates()"> | ||
|
@@ -230,7 +226,7 @@ This document does not have any visible text node. | |
|
||
#### Inapplicable Example 2 | ||
|
||
This document does not have text content that is automatically **changed**. | ||
This document does not have text content that automatically changes. | ||
|
||
```html | ||
<p> | ||
|
@@ -241,7 +237,7 @@ This document does not have text content that is automatically **changed**. | |
|
||
#### Inapplicable Example 3 | ||
|
||
This `span` element changes color but not its `innerText` property. | ||
This `span` element changes color but not the content of its [text nodes][] are unchanged. | ||
|
||
```html | ||
<body onload="startColorUpdates()"> | ||
|
@@ -276,7 +272,7 @@ This `span` element changes color but not its `innerText` property. | |
|
||
#### Inapplicable Example 4 | ||
|
||
This `span` element contains text content that is automatically **changed** but only as a result of the user activating a button on the page. | ||
This `span` element contains text content that automatically changes but only as a result of the user activating a button on the page. | ||
|
||
```html | ||
<body> | ||
|
@@ -292,24 +288,10 @@ This `span` element contains text content that is automatically **changed** but | |
</body> | ||
``` | ||
|
||
#### Inapplicable Example 5 | ||
|
||
This `span` element with text content that automatically changes multiple times is **alone** in the document. | ||
|
||
```html | ||
<body onload="startUpdates()"> | ||
<span id="target">1</span> | ||
|
||
<script type="text/javascript" src="/test-assets/efbfc7/script.js"></script> | ||
</body> | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little bit confused where this inapplicable example came from and couldn't find anything in the understanding docs. I would personally fail this example, so I removed it for the moment, re-adding it would mean changing the new applicability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth adding it to the failed examples? - It is a hard call and might be worth asking @Jym77 or @carlosapaduarte for their thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SC 2.2.2 states (emphasises mine):
This content is not "presented in parallel with other content" and therefore shouldn't fail the SC. |
||
|
||
[ancestor]: https://dom.spec.whatwg.org/#concept-tree-ancestor | ||
[activation]: https://html.spec.whatwg.org/#activation | ||
[child]: https://dom.spec.whatwg.org/#concept-tree-child | ||
[children]: https://dom.spec.whatwg.org/#concept-tree-child | ||
[clearly labeled location]: #clearly-labeled-location 'Definition of clearly labeled location' | ||
[content]: https://www.w3.org/TR/WCAG21/#dfn-content | ||
[descendant]: https://dom.spec.whatwg.org/#concept-tree-descendant | ||
[essential]: https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide.html#dfn-essential | ||
[flat tree]: https://drafts.csswg.org/css-scoping/#flat-tree 'Definition of flat tree' | ||
[f16]: https://www.w3.org/WAI/WCAG21/Techniques/failures/F16 | ||
|
@@ -319,6 +301,7 @@ This `span` element with text content that automatically changes multiple times | |
[instrument]: #instrument-to-achieve-an-objective 'Definition of instrument to achieve an objective' | ||
[sc 2.2.2]: https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide | ||
[text node]: https://dom.spec.whatwg.org/#text | ||
[text nodes]: https://dom.spec.whatwg.org/#text | ||
[user interaction]: #user-interaction 'Definition of user interaction' | ||
[visible text content]: #visible-text-content 'Definition of visible text content' | ||
[visible]: #visible 'Definition of visible' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently have this including the possibility of multiple text nodes, we could potentially simplify this by using a normalized (https://dom.spec.whatwg.org/#dom-node-normalize) DOM, but that might make it unnecessarily more technical as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, normalising would collapse adjacent text nodes, but in something like
<div>Lorem <span>Ipsum</span> Dolor</div>
, thediv
has two text nodes (Lorem
andDolor
) and they won't be collpased by normalisation (due to thespan
in the middle) 🤔(also looks a bit like
Text.wholeText
)