From 6ac7c5c4f8d26c188eb5c3be115b6deb9ce85648 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 15 Sep 2022 11:27:22 +0200 Subject: [PATCH 01/21] Add new letter-spacing rule and deprecate old one --- __tests__/spelling-ignore.yml | 1 + ...rtant-letter-spacing-wide-enough-fsy8c7.md | 299 ++++++++++++++++++ _rules/letter-spacing-not-important-24afc2.md | 4 +- 3 files changed, 303 insertions(+), 1 deletion(-) create mode 100755 _rules/important-letter-spacing-wide-enough-fsy8c7.md diff --git a/__tests__/spelling-ignore.yml b/__tests__/spelling-ignore.yml index 2ed9f8495d0..bf7d5065f8b 100755 --- a/__tests__/spelling-ignore.yml +++ b/__tests__/spelling-ignore.yml @@ -255,6 +255,7 @@ - 2px - 3px - 4px +- 10px - 16px - 20px - 24px diff --git a/_rules/important-letter-spacing-wide-enough-fsy8c7.md b/_rules/important-letter-spacing-wide-enough-fsy8c7.md new file mode 100755 index 00000000000..a36b7a9ab21 --- /dev/null +++ b/_rules/important-letter-spacing-wide-enough-fsy8c7.md @@ -0,0 +1,299 @@ +--- +id: fsy8c7 +name: Important letter spacing in style attributes is wide enough +rule_type: atomic +description: | + This rule checks that the `style` attribute is not used to prevent adjusting `letter-spacing` by using `!important`, except if it's at least 0.12 times the font size. +accessibility_requirements: + wcag21:1.4.12: # Text Spacing (AA) + forConformance: true + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed +input_aspects: + - DOM Tree + - CSS Styling +acknowledgments: + authors: + - Jean-Yves Moyen +--- + +## Applicability + +This rule applies to any [HTML element][] for which all the following are true: + +- the element is has at least one [visible][] text node children; and +- the [specified][] `letter-spacing` property of the element is [declared][] in a `style` attribute; and +- the [computed][] `letter-spacing` property is [important][]. + +The [specified][] `letter-spacing` of the element may be inherited from an ancestor, therefore the test targets do not necessarily have a `style` attribute. + +## Expectation + +For each test target, the [computed][] value of its `letter-spacing` property is at least 0.12 times the [computed][] value of its `font-size` property. + +## Assumptions + +- There is no mechanism available on the page to adjust `letter-spacing`. If there is such a mechanism, it is possible to fail this rule while [Success Criterion 1.4.12 Text Spacing][sc1412] is still satisfied. + +- This rule assumes that WCAG's meaning for the "Letter spacing style property" is the value of the CSS `letter-spacing` property rather than the actual space between letters. The value of the CSS property is _added_ to whichever spacing already exist (for example, due to kerning). Thus, the actual space between letters can be larger than the value of the `letter-spacing` property. If [Success Criterion 1.4.12 Text Spacing][sc1412] is concerned by the actual space between letters, then this rule may fail (with the `letter-spacing` property being too small) while the Success Criterion is still satisfied (with the actual space being enough). + +- This rule assumes that when inter-letters space is changed because of justification, the `letter-spacing` property is not changed. Therefore, whether a text is justified or not doesn't change the result of this rule. Note that justifying text is a failure of [Success Criterion 1.4.8 Visual Presentation][sc148]. + +- This rule assumes that at least one text node child of the target express something in a human language written in a script that that uses the `letter-spacing` property. + +## Accessibility Support + +While some assistive technologies are able to set [user origin][] or [user agent origin][] styles, others, such as browser extensions, are only able to set styles with the [author origin][]. Such assistive technologies cannot create styles "winning" the [cascade sort][] over a `style` attribute with an [important][] declaration. + +## Background + +When a style is [declared][] in the `style` attribute with an [important][] declaration, it "wins" the [cascade sort] over any other style from [author origin][], i.e. it cannot be overridden by any of these. On the other hand, if such a style is [declared][] in a style sheet, it can still "lose" the [cascade sort][] to declarations with higher [specificity][] or simply coming from a later style sheet (such as ones injected by assistive technologies). This rule ensures that the element is not in the first case and that the style can be overridden by users, unless it is already at least the minimum required threshold. [Important][] styles that are declared with the [user][user origin] or [user agent][user agent origin] origin can win the [cascade sort][] over styles with the [author origin][]. + +CSS specifications define each declaration as being either [important][] (if it has the `!important` annotation) or [normal][]. Given that `normal` is also a keyword for this property, and that `!important` is wider known that this distinction, this rule rather uses "[important][]"/"not [important][]" to avoid confusion. + +### Bibliography + +- [Understanding Success Criterion 1.4.12: Text Spacing](https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html) +- [CSS Text Module Level 3 - Spacing](https://www.w3.org/TR/css-text-3/#spacing) +- [CSS Visual formatting model details](https://drafts.csswg.org/css2/visudet.html) + +## Test Cases + +### Passed + +#### Passed Example 1 + +This `p` element has a [computed][] `letter-spacing` of 0.15 time the `font-size`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 2 + +This `p` element has a [computed][] `letter-spacing` of `3px`, which is exactly 0.12 the `font-size`. + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 3 + +This `p` element has two [declared][] values for its `letter-spacing` property. The latest wins the [cascade sort][]. It has a value of `0.15em`, which is wide enough. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 4 + +This `p` element has two [declared][] values for its `letter-spacing` property. The one which is [important][] wins the [cascade sort][]. It has a value of `0.15em`, which is wide enough. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 5 + +The `div` element has no text node child. The [computed][] `letter-spacing` of the `p` element is `2px`, 0.2 times its [computed][] `font-size` of `10px` + +```html +
+

+ The toy brought back fond memories of being lost in the rain forest. +

+
+``` + +#### Passed Example 6 + +The `div` element has no text node child. The [computed][] `letter-spacing` of the `p` element is 0.2 times its `font-size`. + +```html +
+

+ The toy brought back fond memories of being lost in the rain forest. +

+
+``` + +### Failed + +#### Failed Example 1 + +This `p` element has a [computed][] `letter-spacing` of only 0.1 times the font size, which is below the required minimum. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 2 + +This `p` element has a [computed][] `letter-spacing` of `2px` which is only 0.1 times the font size (`20px`), thus below the required minimum. + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 3 + +This `p` element has a [computed][] `letter-spacing` of 0. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 4 + +This `p` element has a [computed][] `letter-spacing` of 0. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +### Inapplicable + +#### Inapplicable Example 1 + +There is no HTML element. + +```svg + + ACT rules + +``` + +#### Inapplicable Example 2 + +This `div` element has no text node child. + +```html +
+ +
+``` + +#### Inapplicable Example 3 + +This `p` element has no [visible][] text node child because of `display: none`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 4 + +This `p` element has no [visible][] text node child because it is positioned off-screen. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 5 + +This `p` element's `letter-spacing` property is not [declared][] in a `style` attribute. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 6 + +The [specified][] value of the `letter-spacing` property of this `p` element is [declared][] in the style sheet, not in the `style` attribute (it wins the [cascade sort][] because it is [important][]). + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 7 + +This `p` element has a not [important][] [computed][] `letter-spacing`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 8 + +The `p` element has no text node child. The [computed][] value of the `letter-spacing` property of the `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore not [important][]. + +```html +

+ + The toy brought back fond memories of being lost in the rain forest. + +

+``` + +#### Inapplicable Example 9 + +The `p` element has no text node child. The [computed][] value of the `letter-spacing` property of the `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore not [important][]. + +```html +

+ + The toy brought back fond memories of being lost in the rain forest. + +

+``` + +[author origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - Author Origin' +[cascade sort]: https://www.w3.org/TR/css-cascade-4/#cascade-sort 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascade Sort' +[computed]: https://www.w3.org/TR/css-cascade-4/#computed 'CSS Cascading and Inheritance Level 4 (Working draft) - Computed Values' +[declared]: https://www.w3.org/TR/css-cascade-4/#declared 'CSS Cascading and Inheritance Level 4 (Working draft) - Declared Values' +[important]: https://www.w3.org/TR/css-cascade-4/#importance 'CSS Cascading and Inheritance Level 4 (Working draft) - Importance' +[inherited]: https://www.w3.org/TR/css-cascade-4/#inheriting 'CSS Cascading and Inheritance Level 4 (Working draft) - Inherited Values' +[normal]: https://www.w3.org/TR/css-cascade-4/#normal 'CSS Cascading and Inheritance Level 4 (Working draft) - Normal declarations' +[sc1412]: https://www.w3.org/TR/WCAG21/#text-spacing 'Success Criterion 1.4.12 Text Spacing' +[sc148]: https://www.w3.org/TR/WCAG21/#visual-presentation 'Success Criterion 1.4.8 Visual Presentation' +[specified]: https://www.w3.org/TR/css-cascade-4/#specified 'CSS Cascading and Inheritance Level 4 (Working draft) - Specified Values' +[specificity]: https://www.w3.org/TR/selectors/#specificity 'CSS Selectors Level 4 (Working draft) - Specificity' +[user origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Origin' +[user agent origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-ua 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Agent Origin' +[visible]: #visible 'Definition of visible' +[html element]: #namespaced-element diff --git a/_rules/letter-spacing-not-important-24afc2.md b/_rules/letter-spacing-not-important-24afc2.md index 3f97ec84fc2..6a65046f48f 100755 --- a/_rules/letter-spacing-not-important-24afc2.md +++ b/_rules/letter-spacing-not-important-24afc2.md @@ -1,6 +1,6 @@ --- id: 24afc2 -name: Letter spacing in style attributes is not !important +name: DEPRECATED - Letter spacing in style attributes is not !important rule_type: atomic description: | This rule checks that the `style` attribute is not used to prevent adjusting `letter-spacing` by using `!important`, except if it's at least 0.12 times the font size. @@ -19,6 +19,8 @@ acknowledgments: - Jey Nandakumar funding: - WAI-Tools +deprecated: | + This rule has been deprecated and superseded by Rule [Important letter spacing in style attributes is wide enough](https://act-rules.github.io/rules/fsy8c7). This rule is not maintained anymore and should not be used. --- ## Applicability From 453902b63ed05cb5a015baceedf6affe695ff7ac Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 15 Sep 2022 12:37:21 +0200 Subject: [PATCH 02/21] Add new word-spacing rule and deprecate old one --- ...portant-word-spacing-wide-enough-nt4zgr.md | 299 ++++++++++++++++++ _rules/word-spacing-not-important-9e45ec.md | 5 +- 2 files changed, 303 insertions(+), 1 deletion(-) create mode 100755 _rules/important-word-spacing-wide-enough-nt4zgr.md diff --git a/_rules/important-word-spacing-wide-enough-nt4zgr.md b/_rules/important-word-spacing-wide-enough-nt4zgr.md new file mode 100755 index 00000000000..4982403cb0f --- /dev/null +++ b/_rules/important-word-spacing-wide-enough-nt4zgr.md @@ -0,0 +1,299 @@ +--- +id: nt4zgr +name: Important word spacing in style attributes is wide enough +rule_type: atomic +description: | + This rule checks that the `style` attribute is not used to prevent adjusting `word-spacing` by using `!important`, except if it's at least `0.16` times the font size. +accessibility_requirements: + wcag21:1.4.12: # Text Spacing (AA) + forConformance: true + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed +input_aspects: + - DOM Tree + - CSS Styling +acknowledgments: + authors: + - Jean-Yves Moyen +--- + +## Applicability + +This rule applies to any [HTML element][] for which all the following are true: + +- the element is has at least one [visible][] text node children; and +- the [specified][] `word-spacing` property of the element is [declared][] in a `style` attribute; and +- the [computed][] `word-spacing` property is [important][]. + +The [specified][] `word-spacing` of the element may be inherited from an ancestor, therefore the test targets do not necessarily have a `style` attribute. + +## Expectation + +For each test target, the [computed][] value of its `word-spacing` property is at least 0.16 times the [computed][] value of its `font-size` property. + +## Assumptions + +- There is no mechanism available on the page to adjust `word-spacing`. If there is such a mechanism, it is possible to fail this rule while [Success Criterion 1.4.12 Text Spacing][sc1412] is still satisfied. + +- This rule assumes that WCAG's meaning for the "Word spacing style property" is the value of the CSS `word-spacing` property rather than the actual space between words. The value of the CSS property is _added_ to whichever spacing already exist (for example, the size of the space character). Thus, the actual space between words is larger than the value of the `word-spacing` property. If [Success Criterion 1.4.12 Text Spacing][sc1412] is concerned by the actual space between words, then this rule may fail (with the `word-spacing` property being too small) while the Success Criterion is still satisfied (with the actual space being enough). + +- This rule assumes that when inter-words space is changed because of justification, the `word-spacing` property is not changed (the change occurs on the width of the space character between the words). Therefore, whether a text is justified or not doesn't change the result of this rule. Note that justifying text is a failure of [Success Criterion 1.4.8 Visual Presentation][sc148]. + +- This rule assumes that at least one text node child of the target express something in a human language written in a script that that uses the `letter-spacing` property. + +## Accessibility Support + +While some assistive technologies are able to set [user origin][] or [user agent origin][] styles, others, such as browser extensions, are only able to set styles with the [author origin][]. Such assistive technologies cannot create styles "winning" the [cascade sort][] over a `style` attribute with an [important][] declaration. + +## Background + +When a style is [declared][] in the `style` attribute with an [important][] declaration, it "wins" the [cascade sort] over any other style from [author origin][], i.e. it cannot be overridden by any of these. On the other hand, if such a style is [declared][] in a style sheet, it can still "lose" the [cascade sort][] to declarations with higher [specificity][] or simply coming from a later style sheet (such as ones injected by assistive technologies). This rule ensures that the element is not in the first case and that the style can be overridden by users, unless it is already at least the minimum required threshold. [Important][] styles that are declared with the [user][user origin] or [user agent][user agent origin] origin can win the [cascade sort][] over styles with the [author origin][]. + +CSS specifications define each declaration as being either [important][] (if is as the `!important` annotation) or [normal][]. Given that `normal` is also a keyword for this property, and that `!important` is wider known that this distinction, this rule rather uses "[important][]"/"not [important][]" to avoid confusion. + +### Bibliography + +- [Understanding Success Criterion 1.4.12: Text Spacing](https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html) +- [CSS Text Module Level 3 - Spacing](https://www.w3.org/TR/css-text-3/#spacing) +- [CSS Visual formatting model details](https://drafts.csswg.org/css2/visudet.html) + +## Test Cases + +### Passed + +#### Passed Example 1 + +This `p` element has a [computed][] `word-spacing` of 0.2 times the font size. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 2 + +This `p` element has a [computed][] `word-spacing` of `4px`, which is exactly 0.16 times the [computed][] `font-size`. + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 3 + +This `p` element has two [declared][] values for its `word-spacing` property. The latest wins the [cascade sort][]. It has a value of `0.2em`, which is wide enough. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 4 + +This `p` element has two [declared][] values for its `word-spacing` property. The one which is [important][] wins the [cascade sort][]. It has a value of `0.2em`, which is wide enough. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 5 + +The `div` element has no text node child. The [computed][] `letter-spacing` of the `p` element is `2px`, 0.2 times its [computed][] `font-size` of `10px` + +```html +
+

+ The toy brought back fond memories of being lost in the rain forest. +

+
+``` + +#### Passed Example 6 + +The `div` element has no text node child. The [computed][] `letter-spacing` of the `p` element is 0.2 times its `font-size`. + +```html +
+

+ The toy brought back fond memories of being lost in the rain forest. +

+
+``` + +### Failed + +#### Failed Example 1 + +This `p` element has a [computed][] `word-spacing` of only 0.1 times the `font-size`, which is below the required minimum. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 2 + +This `p` element has a [computed][] `word-spacing` of `2px` which is only 0.1 times the `font-size` (`20px`), thus below the required minimum. + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 3 + +This `p` element has a [computed][] `word-spacing` of 0. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 4 + +This `p` element has a [computed][] `word-spacing` of 0. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +### Inapplicable + +#### Inapplicable Example 1 + +There is no HTML element. + +```svg + + ACT rules + +``` + +#### Inapplicable Example 2 + +This `div` element has no text node child. + +```html +
+ +
+``` + +#### Inapplicable Example 3 + +This `p` element has no [visible][] text node child because of `display: none`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 4 + +This `p` element has no [visible][] text node child because it is positioned off-screen. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 5 + +This `p` element's `word-spacing` property is not [declared][] in a `style` attribute. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 6 + +The [specified][] value of the `word-spacing` property of this `p` element is [declared][] in the style sheet, not in the `style` attribute (it wins the [cascade sort][] because it is [important][]). + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 7 + +This `p` element has a not [important][] [computed][] `word-spacing`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 8 + +The `p` element has no text node child. The [computed][] value of the `word-spacing` property of this `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore not [important][]. + +```html +

+ + The toy brought back fond memories of being lost in the rain forest. + +

+``` + +#### Inapplicable Example 9 + +The `p` element has no text node child. The [computed][] value of the `word-spacing` property of this `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore not [important][]. + +```html +

+ + The toy brought back fond memories of being lost in the rain forest. + +

+``` + +[author origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - Author Origin' +[cascade sort]: https://www.w3.org/TR/css-cascade-4/#cascade-sort 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascade Sort' +[computed]: https://www.w3.org/TR/css-cascade-4/#computed 'CSS Cascading and Inheritance Level 4 (Working draft) - Computed Values' +[declared]: https://www.w3.org/TR/css-cascade-4/#declared 'CSS Cascading and Inheritance Level 4 (Working draft) - Declared Values' +[important]: https://www.w3.org/TR/css-cascade-4/#importance 'CSS Cascading and Inheritance Level 4 (Working draft) - Importance' +[inherited]: https://www.w3.org/TR/css-cascade-4/#inheriting 'CSS Cascading and Inheritance Level 4 (Working draft) - Inherited Values' +[normal]: https://www.w3.org/TR/css-cascade-4/#normal 'CSS Cascading and Inheritance Level 4 (Working draft) - Normal declarations' +[sc1412]: https://www.w3.org/TR/WCAG21/#text-spacing 'Success Criterion 1.4.12 Text Spacing' +[sc148]: https://www.w3.org/TR/WCAG21/#visual-presentation 'Success Criterion 1.4.8 Visual Presentation' +[specificity]: https://www.w3.org/TR/selectors/#specificity 'CSS Selectors Level 4 (Working draft) - Specificity' +[specified]: https://www.w3.org/TR/css-cascade-4/#specified 'CSS Cascading and Inheritance Level 4 (Working draft) - Specified Values' +[user origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Origin' +[user agent origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-ua 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Agent Origin' +[visible]: #visible 'Definition of visible' +[html element]: #namespaced-element diff --git a/_rules/word-spacing-not-important-9e45ec.md b/_rules/word-spacing-not-important-9e45ec.md index 313f3248e24..812b4c3a137 100755 --- a/_rules/word-spacing-not-important-9e45ec.md +++ b/_rules/word-spacing-not-important-9e45ec.md @@ -1,6 +1,6 @@ --- id: 9e45ec -name: Word spacing in style attributes is not !important +name: DEPRECATED - Word spacing in style attributes is not !important rule_type: atomic description: | This rule checks that the `style` attribute is not used to prevent adjusting `word-spacing` by using `!important`, except if it's at least `0.16` times the font size. @@ -19,6 +19,9 @@ acknowledgments: - Jey Nandakumar funding: - WAI-Tools +deprecated: | + This rule has been deprecated and superseded by Rule [Important word spacing in style attributes is wide enough](https://act-rules.github.io/rules/nt4zgr). This rule is not maintained anymore and should not be used. + --- ## Applicability From e8f7c9e7b84edb0e088d96af4550d5c99e9f0ee8 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 15 Sep 2022 12:52:08 +0200 Subject: [PATCH 03/21] Clean up assumptions --- _rules/important-letter-spacing-wide-enough-fsy8c7.md | 6 ++++-- _rules/important-word-spacing-wide-enough-nt4zgr.md | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/_rules/important-letter-spacing-wide-enough-fsy8c7.md b/_rules/important-letter-spacing-wide-enough-fsy8c7.md index a36b7a9ab21..fee793b951a 100755 --- a/_rules/important-letter-spacing-wide-enough-fsy8c7.md +++ b/_rules/important-letter-spacing-wide-enough-fsy8c7.md @@ -6,7 +6,7 @@ description: | This rule checks that the `style` attribute is not used to prevent adjusting `letter-spacing` by using `!important`, except if it's at least 0.12 times the font size. accessibility_requirements: wcag21:1.4.12: # Text Spacing (AA) - forConformance: true + forConformance: true failed: not satisfied passed: further testing needed inapplicable: further testing needed @@ -36,11 +36,13 @@ For each test target, the [computed][] value of its `letter-spacing` property is - There is no mechanism available on the page to adjust `letter-spacing`. If there is such a mechanism, it is possible to fail this rule while [Success Criterion 1.4.12 Text Spacing][sc1412] is still satisfied. +- The font size is constant for all text in the element. If `font-size` changes (e.g., through use of the `::first-line` pseudo-element) then the required letter spacing would also change throughout the element. This is untested by the current rule. + - This rule assumes that WCAG's meaning for the "Letter spacing style property" is the value of the CSS `letter-spacing` property rather than the actual space between letters. The value of the CSS property is _added_ to whichever spacing already exist (for example, due to kerning). Thus, the actual space between letters can be larger than the value of the `letter-spacing` property. If [Success Criterion 1.4.12 Text Spacing][sc1412] is concerned by the actual space between letters, then this rule may fail (with the `letter-spacing` property being too small) while the Success Criterion is still satisfied (with the actual space being enough). - This rule assumes that when inter-letters space is changed because of justification, the `letter-spacing` property is not changed. Therefore, whether a text is justified or not doesn't change the result of this rule. Note that justifying text is a failure of [Success Criterion 1.4.8 Visual Presentation][sc148]. -- This rule assumes that at least one text node child of the target express something in a human language written in a script that that uses the `letter-spacing` property. +- At least one text node child of the element express something in a human language written in a script that that uses the `letter-spacing` property. ## Accessibility Support diff --git a/_rules/important-word-spacing-wide-enough-nt4zgr.md b/_rules/important-word-spacing-wide-enough-nt4zgr.md index 4982403cb0f..0842d5f4eae 100755 --- a/_rules/important-word-spacing-wide-enough-nt4zgr.md +++ b/_rules/important-word-spacing-wide-enough-nt4zgr.md @@ -36,11 +36,13 @@ For each test target, the [computed][] value of its `word-spacing` property is a - There is no mechanism available on the page to adjust `word-spacing`. If there is such a mechanism, it is possible to fail this rule while [Success Criterion 1.4.12 Text Spacing][sc1412] is still satisfied. +- The font size is constant for all text in the element. If `font-size` changes (e.g., through use of the `::first-line` pseudo-element) then the required word spacing would also change throughout the element. This is untested by the current rule. + - This rule assumes that WCAG's meaning for the "Word spacing style property" is the value of the CSS `word-spacing` property rather than the actual space between words. The value of the CSS property is _added_ to whichever spacing already exist (for example, the size of the space character). Thus, the actual space between words is larger than the value of the `word-spacing` property. If [Success Criterion 1.4.12 Text Spacing][sc1412] is concerned by the actual space between words, then this rule may fail (with the `word-spacing` property being too small) while the Success Criterion is still satisfied (with the actual space being enough). - This rule assumes that when inter-words space is changed because of justification, the `word-spacing` property is not changed (the change occurs on the width of the space character between the words). Therefore, whether a text is justified or not doesn't change the result of this rule. Note that justifying text is a failure of [Success Criterion 1.4.8 Visual Presentation][sc148]. -- This rule assumes that at least one text node child of the target express something in a human language written in a script that that uses the `letter-spacing` property. +- At least one text node child of the element express something in a human language written in a script that that uses the `letter-spacing` property. ## Accessibility Support From 77be6e97d1f18a5c7e380612f20eae6becb55ce2 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 15 Sep 2022 13:00:30 +0200 Subject: [PATCH 04/21] Clean up --- _rules/important-letter-spacing-wide-enough-fsy8c7.md | 4 ++-- _rules/important-word-spacing-wide-enough-nt4zgr.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_rules/important-letter-spacing-wide-enough-fsy8c7.md b/_rules/important-letter-spacing-wide-enough-fsy8c7.md index fee793b951a..ab3792f8526 100755 --- a/_rules/important-letter-spacing-wide-enough-fsy8c7.md +++ b/_rules/important-letter-spacing-wide-enough-fsy8c7.md @@ -76,7 +76,7 @@ This `p` element has a [computed][] `letter-spacing` of 0.15 time the `font-size #### Passed Example 2 -This `p` element has a [computed][] `letter-spacing` of `3px`, which is exactly 0.12 the `font-size`. +This `p` element has a [computed][] `letter-spacing` of `3px`, which is exactly 0.12 the `font-size` of `25px`. ```html + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 3 + +This `p` element has a [used][] `line-height` of `25.6px` (160% of `16px`) which is 1.6 times the `font-size`. + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 4 + +This `p` element has a [used][] `line-height` of `1.6` times the `font-size`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 5 + +This `p` element has two [declared][] values for its `line-height` property. The latest wins the [cascade sort][]. It has a value of `2em`, which is large enough. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 6 + +This `p` element has two [declared][] values for its `line-height` property. The one which is [important][] wins the [cascade sort][]. It has a value of `2em`, which is large enough. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Passed Example 7 + +The `div` element has no text node child. The [computed][] `line-height` of the `p` element is `15px`, 1.5 times its [computed][] `font-size` of `10px` + +```html +
+

+ The toy brought back fond memories of being lost in the rain forest. +

+
+``` + +#### Passed Example 8 + +The `div` element has no text node child. The [computed][] `letter-spacing` of the `p` element is 1.5 times its `font-size`. + +```html +
+

+ The toy brought back fond memories of being lost in the rain forest. +

+
+``` + +### Failed + +#### Failed Example 1 + +This `p` element has a [used][] `line-height` equal to the font size, which is below the required minimum. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 2 + +This `p` element has a [used][] `line-height` of `20px`, which is below the required minimum given the specified font size is 20 pixels. + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 3 + +This `p` element has a [used][] `line-height` of `19.2px` (120% of `16px`) which is below the required minimum. + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 4 + +This `p` element has a [used][] `line-height` of `1.2` which is below the required minimum. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 5 + +This `p` element has a [computed][] `line-height` of `normal` which is below the required minimum ([used][] value for `normal` is generally around 1.2). + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Failed Example 6 + +This `p` element has a [computed][] `line-height` of `normal` which is below the required minimum ([used][] value for `normal` is generally around 1.2). + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +### Inapplicable + +#### Inapplicable Example 1 + +There is no HTML element. + +```svg + + ACT rules + +``` + +#### Inapplicable Example 2 + +This `div` element has no text node child. + +```html +
+ +
+``` + +#### Inapplicable Example 3 + +This `p` element has no [visible][] text node child because of `display: none`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 4 + +This `p` element has no [visible][] text node child because it is positioned off-screen. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 5 + +This `p` element will never have a [soft wrap break][] due to the use of an overflow container. In this case, even changing the view port size will not cause a [soft wrap break][]. + +```html +
+

+ The toy brought back fond memories of being lost in the rain forest. +

+
+``` + +#### Inapplicable Example 6 + +This `p` element's `line-height` property is not [declared][] in a `style` attribute. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 7 + +The [specified][] value of the `line-height` property of this `p` element is [declared][] in the style sheet, not in the `style` attribute (it wins the [cascade sort][] because it is [important][]). + +```html + + +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 8 + +This `p` element does not have an [important][] [computed][] `line-height`. + +```html +

+ The toy brought back fond memories of being lost in the rain forest. +

+``` + +#### Inapplicable Example 9 + +The `p` element has no text node child. The [computed][] value of the `line-height` property of this `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore not [important][]. + +```html +

+ + The toy brought back fond memories of being lost in the rain forest. + +

+``` + +#### Inapplicable Example 10 + +The `p` element has no text node child. The [computed][] value of the `line-height` property of this `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore not [important][]. + +```html +

+ + The toy brought back fond memories of being lost in the rain forest. + +

+``` + +[author origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - Author Origin' +[cascade sort]: https://www.w3.org/TR/css-cascade-4/#cascade-sort 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascade Sort' +[computed]: https://www.w3.org/TR/css-cascade-4/#computed 'CSS Cascading and Inheritance Level 4 (Working draft) - Computed Values' +[declared]: https://www.w3.org/TR/css-cascade-4/#declared 'CSS Cascading and Inheritance Level 4 (Working draft) - Declared Values' +[html element]: #namespaced-element +[important]: https://www.w3.org/TR/css-cascade-4/#importance 'CSS Cascading and Inheritance Level 4 (Working draft) - Importance' +[inherited]: https://www.w3.org/TR/css-cascade-4/#inheriting 'CSS Cascading and Inheritance Level 4 (Working draft) - Inherited Values' +[normal]: https://www.w3.org/TR/css-cascade-4/#normal 'CSS Cascading and Inheritance Level 4 (Working draft) - Normal declarations' +[sc1412]: https://www.w3.org/TR/WCAG21/#text-spacing 'Success Criterion 1.4.12 Text Spacing' +[soft wrap break]: https://www.w3.org/TR/css-text-3/#soft-wrap-break +[specificity]: https://www.w3.org/TR/selectors/#specificity 'CSS Selectors Level 4 (Working draft) - Specificity' +[specified]: https://www.w3.org/TR/css-cascade-4/#specified 'CSS Cascading and Inheritance Level 4 (Working draft) - Specified Values' +[used]: https://www.w3.org/TR/css-cascade-4/#used 'CSS Cascading and Inheritance Level 4 (Working draft) - Used Values' +[user origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Origin' +[user agent origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-ua 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Agent Origin' +[visible]: #visible 'Definition of visible' diff --git a/_rules/line-height-not-important-78fd32.md b/_rules/line-height-not-important-78fd32.md index f81da983821..324b28ee488 100755 --- a/_rules/line-height-not-important-78fd32.md +++ b/_rules/line-height-not-important-78fd32.md @@ -1,6 +1,6 @@ --- id: 78fd32 -name: Line height in style attributes is not !important +name: DEPRECATED - Line height in style attributes is not !important rule_type: atomic description: | This rule checks that the `style` attribute is not used to prevent adjusting `line-height` by using `!important`, except if it's at least 1.5 times the font size. @@ -19,6 +19,8 @@ acknowledgments: - Jey Nandakumar funding: - WAI-Tools +deprecated: | + This rule has been deprecated and superseded by Rule [Important letter spacing in style attributes is wide enough](https://act-rules.github.io/rules/fsy8c7). This rule is not maintained anymore and should not be used. --- ## Applicability From 152e445ce819a5d5b15cc4e3302e6cbde8a4e5ee Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Fri, 7 Oct 2022 15:18:45 +0200 Subject: [PATCH 07/21] Replace old letter spacing version rather than deprecating it --- ...tant-letter-spacing-wide-enough-24afc2.md} | 10 +- _rules/letter-spacing-not-important-24afc2.md | 268 ------------------ 2 files changed, 6 insertions(+), 272 deletions(-) rename _rules/{important-letter-spacing-wide-enough-fsy8c7.md => important-letter-spacing-wide-enough-24afc2.md} (99%) delete mode 100755 _rules/letter-spacing-not-important-24afc2.md diff --git a/_rules/important-letter-spacing-wide-enough-fsy8c7.md b/_rules/important-letter-spacing-wide-enough-24afc2.md similarity index 99% rename from _rules/important-letter-spacing-wide-enough-fsy8c7.md rename to _rules/important-letter-spacing-wide-enough-24afc2.md index f11ab4eddff..d91286dd9c6 100755 --- a/_rules/important-letter-spacing-wide-enough-fsy8c7.md +++ b/_rules/important-letter-spacing-wide-enough-24afc2.md @@ -1,5 +1,5 @@ --- -id: fsy8c7 +id: 24afc2 name: Important letter spacing in style attributes is wide enough rule_type: atomic description: | @@ -16,9 +16,11 @@ input_aspects: acknowledgments: authors: - Jean-Yves Moyen ---- - -## Applicability + previous_authors: + - Jey Nandakumar + funding: + - WAI-Tools +---## Applicability This rule applies to any [HTML element][] for which all the following are true: diff --git a/_rules/letter-spacing-not-important-24afc2.md b/_rules/letter-spacing-not-important-24afc2.md deleted file mode 100755 index 6a65046f48f..00000000000 --- a/_rules/letter-spacing-not-important-24afc2.md +++ /dev/null @@ -1,268 +0,0 @@ ---- -id: 24afc2 -name: DEPRECATED - Letter spacing in style attributes is not !important -rule_type: atomic -description: | - This rule checks that the `style` attribute is not used to prevent adjusting `letter-spacing` by using `!important`, except if it's at least 0.12 times the font size. -accessibility_requirements: - wcag21:1.4.12: # Text Spacing (AA) - forConformance: true - failed: not satisfied - passed: further testing needed - inapplicable: further testing needed -input_aspects: - - DOM Tree - - CSS Styling -acknowledgments: - authors: - - Jean-Yves Moyen - - Jey Nandakumar - funding: - - WAI-Tools -deprecated: | - This rule has been deprecated and superseded by Rule [Important letter spacing in style attributes is wide enough](https://act-rules.github.io/rules/fsy8c7). This rule is not maintained anymore and should not be used. ---- - -## Applicability - -This rule applies to any [HTML element][] that is [visible][] and for which the `style` attribute [declares][declared] the [letter-spacing][] CSS property. - -## Expectation - -For each test target, at least one of the following is true: - -- **not important**: the [computed][] value of its [letter-spacing][] property is not [important][]; or -- **wide enough**: the [computed][] value of its [letter-spacing][] property is at least 0.12 times the [computed][] value of its [font-size][] property; or -- **cascade**: the [cascaded][] value of its [letter-spacing][] property is not a value [declared][] in its `style` attribute. - -## Assumptions - -- There is no mechanism available on the page to adjust [letter-spacing][]. If there is such a mechanism, it is possible to fail this rule while [Success Criterion 1.4.12 Text Spacing][sc1412] is still satisfied. - -- This rule assumes that WCAG's meaning for the "Letter spacing style property" is the value of the CSS `letter-spacing` property rather than the actual space between letters. The value of the CSS property is _added_ to whichever spacing already exist (for example, due to kerning). Thus, the actual space between letters can be larger than the value of the `letter-spacing` property. If [Success Criterion 1.4.12 Text Spacing][sc1412] is concerned by the actual space between letters, then this rule may fail (with the `letter-spacing` property being too small) while the Success Criterion is still satisfied (with the actual space being enough). - -- This rule assumes that when inter-letters space is changed because of justification, the `letter-spacing` property is not changed. Therefore, whether a text is justified or not doesn't change the result of this rule. Note that justifying text is a failure of [Success Criterion 1.4.8 Visual Presentation][sc148]. - -## Accessibility Support - -While some assistive technologies are able to set [user origin][] or [user agent origin][] styles, others, such as browser extensions, are only able to set styles with the [author origin][]. Such assistive technologies cannot create styles "winning" the [cascade sort][] over a `style` attribute with an [important][] declaration. - -## Background - -When a style is [declared][] in the `style` attribute with an [important][] declaration, it "wins" the [cascade sort] over any other style from [author origin][], i.e. it cannot be overridden by any of these. On the other hand, if such a style is [declared][] in a style sheet, it can still "lose" the [cascade sort][] to declarations with higher [specificity][] or simply coming from a later style sheet (such as ones injected by assistive technologies). This rule ensures that the element is not in the first case and that the style can be overridden by users, unless it is already at least the minimum required threshold. [Important][] styles that are declared with the [user][user origin] or [user agent][user agent origin] origin can win the [cascade sort][] over styles with the [author origin][]. - -CSS specifications define each declaration as being either [important][] (if it has the `!important` annotation) or [normal][]. Given that `normal` is also a keyword for this property, and that `!important` is wider known that this distinction, this rule rather uses "[important][]"/"not [important][]" to avoid confusion. - -### Bibliography - -- [Understanding Success Criterion 1.4.12: Text Spacing](https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html) -- [CSS Text Module Level 3 - Spacing](https://www.w3.org/TR/css-text-3/#spacing) -- [CSS Visual formatting model details](https://drafts.csswg.org/css2/visudet.html) - -## Test Cases - -### Passed - -#### Passed Example 1 - -This `p` element has a **not [important][]** [computed][] `letter-spacing`. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Passed Example 2 - -This `p` element has a [computed][] `letter-spacing` of 0.15 time the font size, which is **wide enough**. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Passed Example 3 - -This `p` element has a [computed][] [letter-spacing][] of `3px`, which is **wide enough** (the threshold is `3px`). - -```html - - -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Passed Example 4 - -This `p` element has two [declared][] values for its `letter-spacing` property. The latest wins the [cascade sort][]. It has a value of `0.15em`, and is **wide enough**. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Passed Example 5 - -This `p` element has two [declared][] values for its `letter-spacing` property. The one which is [important][] wins the [cascade sort][]. It has a value of `0.15em`, and is **wide enough**. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Passed Example 6 - -The [cascaded][] value of the `letter-spacing` property of this `p` element is [declared][] in the style sheet, not in the `style` attribute (it wins the [cascade sort][] because it is [important][]). Thus, the `p` element matches the **cascade** condition. - -```html - - -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Passed Example 7 - -The [computed][] value of the `letter-spacing` property of this `p` element is **not [important][]**. The [computed][] value of the `letter-spacing` property of this `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore also **not [important][]**. - -```html -

- - The toy brought back fond memories of being lost in the rain forest. - -

-``` - -#### Passed Example 8 - -The [computed][] value of the `letter-spacing` property of this `p` element is **not [important][]**. The [computed][] value of the `letter-spacing` property of this `span` element is the [inherited][] value, that is the [computed][] value of its parent and therefore also **not [important][]**. - -```html -

- - The toy brought back fond memories of being lost in the rain forest. - -

-``` - -### Failed - -#### Failed Example 1 - -This `p` element has a [computed][] `letter-spacing` of only 0.1 times the font size, which is below the required minimum. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Failed Example 2 - -This `p` element has a [computed][] `letter-spacing` of `2px` which is only 0.1 times the font size (`20px`), thus below the required minimum. - -```html - - -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Failed Example 3 - -This `p` element has a [computed][] `letter-spacing` of 0. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Failed Example 4 - -This `p` element has a [computed][] `letter-spacing` of 0. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -### Inapplicable - -#### Inapplicable Example 1 - -There is no HTML element. - -```svg - - ACT rules - -``` - -#### Inapplicable Example 2 - -This `p` element is not [visible][] because of `display: none`. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Inapplicable Example 3 - -This `p` element is not [visible][] because it is positioned off-screen. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -#### Inapplicable Example 4 - -The `style` attribute of this `p` element does not [declare][declared] the `letter-spacing` property. - -```html -

- The toy brought back fond memories of being lost in the rain forest. -

-``` - -[author origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - Author Origin' -[cascade sort]: https://www.w3.org/TR/css-cascade-4/#cascade-sort 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascade Sort' -[cascaded]: https://www.w3.org/TR/css-cascade-4/#cascaded 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascaded Values' -[computed]: https://www.w3.org/TR/css-cascade-4/#computed 'CSS Cascading and Inheritance Level 4 (Working draft) - Computed Values' -[declared]: https://www.w3.org/TR/css-cascade-4/#declared 'CSS Cascading and Inheritance Level 4 (Working draft) - Declared Values' -[font-size]: https://www.w3.org/TR/css-fonts-4/#propdef-font-size 'CSS Fonts Module Level 4 (Working draft) - Font size: the font-size property' -[important]: https://www.w3.org/TR/css-cascade-4/#importance 'CSS Cascading and Inheritance Level 4 (Working draft) - Importance' -[inherited]: https://www.w3.org/TR/css-cascade-4/#inheriting 'CSS Cascading and Inheritance Level 4 (Working draft) - Inherited Values' -[letter-spacing]: https://www.w3.org/TR/css-text-3/#propdef-letter-spacing 'CSS Text Module Level 3 - Tracking: the letter-spacing property' -[normal]: https://www.w3.org/TR/css-cascade-4/#normal 'CSS Cascading and Inheritance Level 4 (Working draft) - Normal declarations' -[sc1412]: https://www.w3.org/TR/WCAG21/#text-spacing 'Success Criterion 1.4.12 Text Spacing' -[sc148]: https://www.w3.org/TR/WCAG21/#visual-presentation 'Success Criterion 1.4.8 Visual Presentation' -[specificity]: https://www.w3.org/TR/selectors/#specificity 'CSS Selectors Level 4 (Working draft) - Specificity' -[user origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Origin' -[user agent origin]: https://www.w3.org/TR/css-cascade-4/#cascade-origin-ua 'CSS Cascading and Inheritance Level 4 (Working draft) - Cascading Origins - User Agent Origin' -[visible]: #visible 'Definition of visible' -[html element]: #namespaced-element From cb09dc9a5ba46243e97c4a36f4b4903dd7a9fe60 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Fri, 7 Oct 2022 15:20:36 +0200 Subject: [PATCH 08/21] Replace old line height version rather than deprecating it --- _rules/important-letter-spacing-wide-enough-24afc2.md | 4 +++- ...3qr8p.md => important-line-height-wide-enough-78fd32.md} | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) rename _rules/{important-line-height-wide-enough-p3qr8p.md => important-line-height-wide-enough-78fd32.md} (99%) diff --git a/_rules/important-letter-spacing-wide-enough-24afc2.md b/_rules/important-letter-spacing-wide-enough-24afc2.md index d91286dd9c6..6920d62d301 100755 --- a/_rules/important-letter-spacing-wide-enough-24afc2.md +++ b/_rules/important-letter-spacing-wide-enough-24afc2.md @@ -20,7 +20,9 @@ acknowledgments: - Jey Nandakumar funding: - WAI-Tools ----## Applicability +--- + +## Applicability This rule applies to any [HTML element][] for which all the following are true: diff --git a/_rules/important-line-height-wide-enough-p3qr8p.md b/_rules/important-line-height-wide-enough-78fd32.md similarity index 99% rename from _rules/important-line-height-wide-enough-p3qr8p.md rename to _rules/important-line-height-wide-enough-78fd32.md index eda8b180103..6df5950a2ce 100755 --- a/_rules/important-line-height-wide-enough-p3qr8p.md +++ b/_rules/important-line-height-wide-enough-78fd32.md @@ -1,5 +1,5 @@ --- -id: p3qr8p +id: 78fd32 name: Important line height in style attributes is wide enough rule_type: atomic description: | @@ -16,6 +16,10 @@ input_aspects: acknowledgments: authors: - Jean-Yves Moyen + previous_authors: + - Jey Nandakumar + funding: + - WAI-Tools --- ## Applicability From 27ce95472cb9f36e8122a06e3b506346a9c54198 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Fri, 7 Oct 2022 15:21:39 +0200 Subject: [PATCH 09/21] Replace old word spacing version rather than deprecating it --- ...4zgr.md => important-word-spacing-wide-enough-9e45ec.md} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename _rules/{important-word-spacing-wide-enough-nt4zgr.md => important-word-spacing-wide-enough-9e45ec.md} (99%) diff --git a/_rules/important-word-spacing-wide-enough-nt4zgr.md b/_rules/important-word-spacing-wide-enough-9e45ec.md similarity index 99% rename from _rules/important-word-spacing-wide-enough-nt4zgr.md rename to _rules/important-word-spacing-wide-enough-9e45ec.md index 663dbcca09b..b4cbe9d8462 100755 --- a/_rules/important-word-spacing-wide-enough-nt4zgr.md +++ b/_rules/important-word-spacing-wide-enough-9e45ec.md @@ -1,5 +1,5 @@ --- -id: nt4zgr +id: 9e45ec name: Important word spacing in style attributes is wide enough rule_type: atomic description: | @@ -16,6 +16,10 @@ input_aspects: acknowledgments: authors: - Jean-Yves Moyen + previous_authors: + - Jey Nandakumar + funding: + - WAI-Tools --- ## Applicability From 840a39c14e5ad891b35e54fb202c794bf25dbbc6 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Fri, 7 Oct 2022 15:54:30 +0200 Subject: [PATCH 10/21] Target text nodes --- ...rtant-letter-spacing-wide-enough-24afc2.md | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/_rules/important-letter-spacing-wide-enough-24afc2.md b/_rules/important-letter-spacing-wide-enough-24afc2.md index 6920d62d301..a52f62165db 100755 --- a/_rules/important-letter-spacing-wide-enough-24afc2.md +++ b/_rules/important-letter-spacing-wide-enough-24afc2.md @@ -24,18 +24,19 @@ acknowledgments: ## Applicability -This rule applies to any [HTML element][] for which all the following are true: +This rule applies to any [visible][] [text node][] child of an [HTML element][], when all the following are true for its `letter-spacing` property: -- the element is has at least one [visible][] text node children; and -- the [specified][] `letter-spacing` property of the element is [declared][] in a `style` attribute; and -- the [computed][] `letter-spacing` property is [important][]. +- the [specified][] value is [declared][] in a `style` attribute; and +- the [computed][] value is [important][]. -The [specified][] `letter-spacing` of the element may be inherited from an ancestor, therefore the test targets do not necessarily have a `style` attribute. +Where the `letter-spacing` property of a text node means the one of its parent. ## Expectation For each test target, the [computed][] value of its `letter-spacing` property is at least 0.12 times the [computed][] value of its `font-size` property. +Where the `letter-spacing` property of a text node means the one of its parent. + ## Assumptions - There is no mechanism available on the page to adjust `letter-spacing`. If there is such a mechanism, it is possible to fail this rule while [Success Criterion 1.4.12 Text Spacing][sc1412] is still satisfied. @@ -46,7 +47,7 @@ For each test target, the [computed][] value of its `letter-spacing` property is - This rule assumes that when inter-letters space is changed because of justification, the `letter-spacing` property is not changed. Therefore, whether a text is justified or not doesn't change the result of this rule. Note that justifying text is a failure of [Success Criterion 1.4.8 Visual Presentation][sc148]. -- At least one text node child of the element express something in a human language written in a script that that uses the `letter-spacing` property. +- The target text node expresses something in a human language written in a script that that uses the `letter-spacing` property. ## Accessibility Support @@ -66,11 +67,13 @@ CSS specifications define each declaration as being either [important][] (if it ## Test Cases +Test cases description abusively refer to the CSS properties of text nodes, meaning the one of their parent. + ### Passed #### Passed Example 1 -This `p` element has a [computed][] `letter-spacing` of 0.15 time the `font-size`. +This text node has a [computed][] `letter-spacing` of 0.15 time the `font-size`. ```html

@@ -80,7 +83,7 @@ This `p` element has a [computed][] `letter-spacing` of 0.15 time the `font-size #### Passed Example 2 -This `p` element has a [computed][] `letter-spacing` of `3px`, which is exactly 0.12 the `font-size` of `25px`. +This text node has a [computed][] `letter-spacing` of `3px`, which is exactly 0.12 the `font-size` of `25px`. ```html