From 6190fb8b555352aad2bfdfeced360bcd7e7521f8 Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 30 Mar 2020 18:08:28 +0100 Subject: [PATCH 01/35] new rule: Text spacing specified via CSS styles is below permissible minimum value or not set to `!important` --- _rules/text-spacing-not-important-b8bb68.md | 110 ++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 _rules/text-spacing-not-important-b8bb68.md diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md new file mode 100644 index 0000000000..db3d5447db --- /dev/null +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -0,0 +1,110 @@ +--- +id: b8bb68 +name: Text spacing specified via CSS styles is below permissible minimum value or not set to `!important` +rule_type: atomic +description: | + This rule checks that +accessibility_requirements: + wcag21:1.4.12: # Text Spacing - Level AA + forConformance: true + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed +input_aspects: + - DOM Tree + - CSS Styling +acknowledgments: + authors: + - Jey Nandakumar +--- + +## Applicability + +This rule applies to any HTML element that is [visible][] and has any of the below CSS properties: + +- [word-spacing][] +- [letter-spacing][] +- [line-height][] + +## Expectation + +The target element does not have an overriding property value with `!important` specified for any of the above applicable CSS properties, except when value is below the permissible minimum respectively: + +**Note**: The permissible minimum values are `0.16em` for [word-spacing][], `0.12em` for [letter-spacing][], and `1.5em` for [line-height][] respectively. + +## Assumptions + +_There are currently no assumptions_ + +## Accessibility Support + +_There are no major accessibility support issues known for this rule._ + +## Background + +- [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 `line-height` of `1.2em` which is below the permissible minimum. + +```html +

+ The quick brown fox jumps over the lazy dog +

+``` + +#### Passed Example 2 + +This `span` element has a `letter-spacing` of `1.5em !important` which is less than or equal to the permissible minimum. + +```html + + The quick brown fox jumps over the lazy dog + +``` + +### Failed + +#### Failed Example 1 + +This `p` element has a `word-spacing` of `0.15em !important` which has `!important` and is above the permissible minimum. + +```html +

+ The quick brown fox jumps over the lazy dog +

+``` + +### Inapplicable + +#### Inapplicable Example 1 + +This `p` element is not [visible][] because of `display: none`. + +```html +

+ The quick brown fox jumps over the lazy dog +

+``` + +#### Inapplicable Example 2 + +This text is not [visible][] because it is positioned off screen. + +```html +

+ The quick brown fox jumps over the lazy dog +

+``` + +[visible]: #visible 'Definition of visible' +[word-spacing]: https://www.w3.org/TR/css-text-3/#word-spacing-property 'CSS Text Module Level 3 - Word Spacing: the word-spacing property' +[letter-spacing]: https://www.w3.org/TR/css-text-3/#propdef-letter-spacing 'CSS Text Module Level 3 - Tracking: the letter-spacing property' +[line-height]: https://drafts.csswg.org/css2/visudet.html#propdef-line-height 'CSS Visual formatting model details - line-height property' From 5edc983b28216a9a699dd96e4f0b7e59f74e080d Mon Sep 17 00:00:00 2001 From: Jey Nandakumar Date: Mon, 6 Apr 2020 07:37:12 -0400 Subject: [PATCH 02/35] Apply suggestions from code review Co-Authored-By: Wilco Fiers --- _rules/text-spacing-not-important-b8bb68.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index db3d5447db..31fa998fff 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -1,11 +1,11 @@ --- id: b8bb68 -name: Text spacing specified via CSS styles is below permissible minimum value or not set to `!important` +name: Text spacing set in the `style` attribute is below permissible minimum value or not set to `!important` rule_type: atomic description: | This rule checks that accessibility_requirements: - wcag21:1.4.12: # Text Spacing - Level AA + wcag21:1.4.12: # Text Spacing (AA) forConformance: true failed: not satisfied passed: further testing needed @@ -20,7 +20,7 @@ acknowledgments: ## Applicability -This rule applies to any HTML element that is [visible][] and has any of the below CSS properties: +This rule applies to any HTML element that is [visible][] and has any of the below CSS properties set in the `style` attribute: - [word-spacing][] - [letter-spacing][] @@ -34,11 +34,11 @@ The target element does not have an overriding property value with `!important` ## Assumptions -_There are currently no assumptions_ +If there is a mechanism available on the page by which text spacing can be adjusted, failing this rule might not mean [success criterion 1.4.12 Text spacing](https://www.w3.org/TR/WCAG21/#text-spacing) is not satisfied. ## Accessibility Support -_There are no major accessibility support issues known for this rule._ +While some assistive technologies are able to set [user origin][] styles, others such as browser exteinsions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important`. If [accessibility support][] does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. ## Background @@ -62,7 +62,7 @@ This `p` element has a `line-height` of `1.2em` which is below the permissible m #### Passed Example 2 -This `span` element has a `letter-spacing` of `1.5em !important` which is less than or equal to the permissible minimum. +This `span` element has a `letter-spacing` of `1.5em !important` which is equal to the permissible minimum. ```html From 3fc46cf0f1f8c9d493143bd4f87289427ffbe462 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 7 Apr 2020 16:45:48 +0100 Subject: [PATCH 03/35] update rule --- _rules/text-spacing-not-important-b8bb68.md | 140 +++++++++++++++++--- 1 file changed, 125 insertions(+), 15 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 31fa998fff..26ed3f76ee 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -26,11 +26,19 @@ This rule applies to any HTML element that is [visible][] and has any of the bel - [letter-spacing][] - [line-height][] -## Expectation +## Expectation 1 -The target element does not have an overriding property value with `!important` specified for any of the above applicable CSS properties, except when value is below the permissible minimum respectively: +The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is `0.16em` or greater. -**Note**: The permissible minimum values are `0.16em` for [word-spacing][], `0.12em` for [letter-spacing][], and `1.5em` for [line-height][] respectively. +## Expectation 2 + +The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is `0.12em` or greater. + +## Expectation 3 + +The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is `1.5em` or greater. + +**Note:** Font size conversations rely on the default pixel size for body (usually 16px), as defined by the user-agent stylesheet. ## Assumptions @@ -52,36 +60,134 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `1.2em` which is below the permissible minimum. +This `p` element has a `line-height` of `20px !important` (equals `1.25em`) which is below the permissible minimum, given the default pixel size of the body is `16px`. ```html -

- The quick brown fox jumps over the lazy dog +

+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.

``` #### Passed Example 2 -This `span` element has a `letter-spacing` of `1.5em !important` which is equal to the permissible minimum. +This `div` element has a `letter-spacing` of `0.12em !important` which is equal to the permissible minimum, given the default pixel size of the body is `16px`. + +```html +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+``` + +#### Passed Example 3 + +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the permissible value, given the default pixel size of the body is `16px`. + +```html + + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. + +``` + +#### Passed Example 4 + +This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is `16px`. + +```html +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+``` + +#### Passed Example 5 + +This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the element has an font-size of `16` pixels, which overrides the pixel size of the body. ```html - - The quick brown fox jumps over the lazy dog - + + + + +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+ ``` ### Failed #### Failed Example 1 -This `p` element has a `word-spacing` of `0.15em !important` which has `!important` and is above the permissible minimum. +This `p` element has a `line-height` of `30px !important` (equals `1.875em`) which is above the permissible minimum, given the default pixel size of the body is `16px`. ```html -

- The quick brown fox jumps over the lazy dog +

+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.

``` +#### Failed Example 2 + +This `div` element has a `letter-spacing` of `1em !important` which is above to the permissible minimum, given the default pixel size of the body is `16px`. + +```html +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+``` + +#### Failed Example 3 + +This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em`) which is above the permissible value, given the default pixel size of the body is `16px`. + +```html + + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. + +``` + +#### Failed Example 4 + +This `article` element has both `letter-spacing` and `line-height` specified, where `line-height` is above the permissible value, given the default pixel size of the body is `16px`. + +```html +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+``` + +#### Failed Example 5 + +This `p` element has a `line-height` of `1.25em !important`, which is greater than `1.5em` given the body has a default pixel size of `24px`. + +```html + + + + +

+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +

+ +``` + ### Inapplicable #### Inapplicable Example 1 @@ -90,7 +196,8 @@ This `p` element is not [visible][] because of `display: none`. ```html

- The quick brown fox jumps over the lazy dog + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.

``` @@ -100,7 +207,8 @@ This text is not [visible][] because it is positioned off screen. ```html

- The quick brown fox jumps over the lazy dog + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.

``` @@ -108,3 +216,5 @@ This text is not [visible][] because it is positioned off screen. [word-spacing]: https://www.w3.org/TR/css-text-3/#word-spacing-property 'CSS Text Module Level 3 - Word Spacing: the word-spacing property' [letter-spacing]: https://www.w3.org/TR/css-text-3/#propdef-letter-spacing 'CSS Text Module Level 3 - Tracking: the letter-spacing property' [line-height]: https://drafts.csswg.org/css2/visudet.html#propdef-line-height 'CSS Visual formatting model details - line-height property' +[priority]: https://www.w3.org/TR/cssom/#dom-cssstyledeclaration-getpropertypriority 'CSS Object Model (CSSOM) - Definition getComputedPriority' +[computed]: https://www.w3.org/TR/css-cascade-3/#computed-value 'CSS Cascading and Inheritance Level 3 - Computed Values' From cf07cfb2f27125e23d66e094d5c4524060e5b657 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 7 Apr 2020 17:12:07 +0100 Subject: [PATCH 04/35] update rule --- _rules/text-spacing-not-important-b8bb68.md | 69 +++++++++------------ 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 26ed3f76ee..73090e02e1 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -38,7 +38,7 @@ The test target does not have "important" as its [letter-spacing][] [priority][] The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is `1.5em` or greater. -**Note:** Font size conversations rely on the default pixel size for body (usually 16px), as defined by the user-agent stylesheet. +**Note:** Font size conversations rely on the default pixel size for body (usually 16 pixels), as defined by the [user agent origin][] stylesheet. ## Assumptions @@ -46,7 +46,7 @@ If there is a mechanism available on the page by which text spacing can be adjus ## Accessibility Support -While some assistive technologies are able to set [user origin][] styles, others such as browser exteinsions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important`. If [accessibility support][] does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. +While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important`. If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. ## Background @@ -60,7 +60,7 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `20px !important` (equals `1.25em`) which is below the permissible minimum, given the default pixel size of the body is `16px`. +This `p` element has a `line-height` of `20px !important` (equals `1.25em`) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. ```html

@@ -71,7 +71,7 @@ This `p` element has a `line-height` of `20px !important` (equals `1.25em`) whic #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em !important` which is equal to the permissible minimum, given the default pixel size of the body is `16px`. +This `div` element has a `letter-spacing` of `0.12em !important` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. ```html

@@ -82,7 +82,7 @@ This `div` element has a `letter-spacing` of `0.12em !important` which is equal #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the permissible value, given the default pixel size of the body is `16px`. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. ```html @@ -93,7 +93,7 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e #### Passed Example 4 -This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is `16px`. +This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. ```html
@@ -104,29 +104,24 @@ This `article` element has both `word-spacing` and `line-height` specified, whic #### Passed Example 5 -This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the element has an font-size of `16` pixels, which overrides the pixel size of the body. +This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the element has an font-size of 16 pixels, which overrides the pixel size of the body. ```html - - - - -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
- + + +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+ + ``` ### Failed #### Failed Example 1 -This `p` element has a `line-height` of `30px !important` (equals `1.875em`) which is above the permissible minimum, given the default pixel size of the body is `16px`. +This `p` element has a `line-height` of `30px !important` (equals `1.875em`) which is above the permissible minimum, given the default pixel size of the body is 16 pixels. ```html

@@ -137,7 +132,7 @@ This `p` element has a `line-height` of `30px !important` (equals `1.875em`) whi #### Failed Example 2 -This `div` element has a `letter-spacing` of `1em !important` which is above to the permissible minimum, given the default pixel size of the body is `16px`. +This `div` element has a `letter-spacing` of `1em !important` which is above to the permissible minimum, given the default pixel size of the body is 16 pixels. ```html

@@ -148,7 +143,7 @@ This `div` element has a `letter-spacing` of `1em !important` which is above to #### Failed Example 3 -This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em`) which is above the permissible value, given the default pixel size of the body is `16px`. +This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em`) which is above the permissible value, given the default pixel size of the body is 16 pixels. ```html @@ -159,7 +154,7 @@ This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em`) #### Failed Example 4 -This `article` element has both `letter-spacing` and `line-height` specified, where `line-height` is above the permissible value, given the default pixel size of the body is `16px`. +This `article` element has both `letter-spacing` and `line-height` specified, where `line-height` is above the permissible value, given the default pixel size of the body is 16 pixels. ```html
@@ -170,22 +165,17 @@ This `article` element has both `letter-spacing` and `line-height` specified, wh #### Failed Example 5 -This `p` element has a `line-height` of `1.25em !important`, which is greater than `1.5em` given the body has a default pixel size of `24px`. +This `p` element has a `line-height` of `1.25em !important`, which is greater than `1.5em` given the body has a default pixel size of 24 pixels. ```html - - - - -

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -

- + + +

+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +

+ + ``` ### Inapplicable @@ -218,3 +208,6 @@ This text is not [visible][] because it is positioned off screen. [line-height]: https://drafts.csswg.org/css2/visudet.html#propdef-line-height 'CSS Visual formatting model details - line-height property' [priority]: https://www.w3.org/TR/cssom/#dom-cssstyledeclaration-getpropertypriority 'CSS Object Model (CSSOM) - Definition getComputedPriority' [computed]: https://www.w3.org/TR/css-cascade-3/#computed-value 'CSS Cascading and Inheritance Level 3 - Computed Values' +[author origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 - Cascading Origins - Author Origin' +[user origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Origin' +[user agent origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-ua 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Agent Origin' From 44bd73f24c6cdc8f121cb73b01301622ea41d770 Mon Sep 17 00:00:00 2001 From: jkodu Date: Wed, 15 Apr 2020 15:34:16 +0100 Subject: [PATCH 05/35] update to pass tests --- __tests__/spelling-ignore.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/__tests__/spelling-ignore.yml b/__tests__/spelling-ignore.yml index 2ac215f471..f5776f31c0 100755 --- a/__tests__/spelling-ignore.yml +++ b/__tests__/spelling-ignore.yml @@ -70,9 +70,15 @@ - labelable - merchantability - de-hello +- Helvetica +- stylesheet + - 14pt - 18pt -- Helvetica +- 20px +- 30px +- 1em +- 8px # Notes and acronyms - TODO @@ -140,3 +146,6 @@ - cantTell - TestSubject - earl:cantTell + +# fns +- getComputedPriority From 382301ea9aaa3634b9f52b5560b52ab9fcca83ba Mon Sep 17 00:00:00 2001 From: jkodu Date: Wed, 15 Apr 2020 15:38:52 +0100 Subject: [PATCH 06/35] update spelling --- __tests__/spelling-ignore.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/__tests__/spelling-ignore.yml b/__tests__/spelling-ignore.yml index 162f93c53f..441b88ad54 100755 --- a/__tests__/spelling-ignore.yml +++ b/__tests__/spelling-ignore.yml @@ -72,11 +72,15 @@ - de-hello - Helvetica - stylesheet +- Helvetica +- fieldsets - 14pt - 18pt -- Helvetica -- fieldsets +- 20px +- 30px +- 1em +- 8px # spell checker checks against strict casing & hence some repeated words here - Autocomplete From 7469b82eb94ee3b9fad83591637f7656e01fdaea Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 28 Apr 2020 13:26:44 +0100 Subject: [PATCH 07/35] revert changes to another rule, that will be a diff pr From ee1968ce99c033673f71869f907a6930236491c8 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 28 Apr 2020 13:28:40 +0100 Subject: [PATCH 08/35] revert 36b590 From be29569246b69a203eedc12bdadfbd5568eea1b0 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 28 Apr 2020 13:29:33 +0100 Subject: [PATCH 09/35] revert 36b590 --- _rules/invalid-form-field-value-36b590.md | 27 ++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/_rules/invalid-form-field-value-36b590.md b/_rules/invalid-form-field-value-36b590.md index d39ebaa00a..d6e82147be 100644 --- a/_rules/invalid-form-field-value-36b590.md +++ b/_rules/invalid-form-field-value-36b590.md @@ -23,18 +23,17 @@ acknowledgments: ## Applicability -The rule applies to each HTML element that has one of the following [semantic roles][semantic role]: - -- `checkbox`, -- `combobox`, -- `listbox`, -- `menuitemcheckbox`, -- `menuitemradio`, -- `radio`, -- `searchbox`, -- `slider`, -- `spinbutton`, -- `switch` or +The rule applies to each HTML element that has one of the following [semantic roles][semantic role]: +- `checkbox`, +- `combobox`, +- `listbox`, +- `menuitemcheckbox`, +- `menuitemradio`, +- `radio`, +- `searchbox`, +- `slider`, +- `spinbutton`, +- `switch` or - `textbox`. **Note**: The list of applicable [semantic roles][semantic role] is derived by taking all the [ARIA 1.1][] roles that: @@ -55,7 +54,6 @@ For each test target with a [form field error indicator][], at least one of the ## Expectation 2 For each test target with a [form field error indicator][], at least one of the [form field error indicators][form field error indicator] describes: - - the cause of the error, or - how to resolve it, @@ -64,7 +62,6 @@ in [text][] that is [visible][]. ## Expectation 3 For each test target with a [form field error indicator][], at least one of the [form field error indicators][form field error indicator] describes: - - the cause of the error, or - how to resolve it, @@ -241,4 +238,4 @@ There are no elements with any of the required [semantic roles][semantic role]. [required context]: https://www.w3.org/TR/wai-aria/#scope [semantic role]: #semantic-role 'Definition of semantic role' [text]: https://www.w3.org/TR/WCAG21/#dfn-text -[visible]: #visible 'Definition of visible' +[visible]: #visible 'Definition of visible' \ No newline at end of file From 676a16efe150054a61950e6943cb4e89cd565458 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 28 Apr 2020 16:50:18 +0100 Subject: [PATCH 10/35] updates --- _rules/text-spacing-not-important-b8bb68.md | 62 +++++++++++++-------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 73090e02e1..bfa07459b5 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -10,17 +10,16 @@ accessibility_requirements: failed: not satisfied passed: further testing needed inapplicable: further testing needed -input_aspects: - - DOM Tree - - CSS Styling + +input_aspects: + DOM Tree + + CSS Styling + acknowledgments: authors: - Jey Nandakumar ---- +---## Applicability -## Applicability - -This rule applies to any HTML element that is [visible][] and has any of the below CSS properties set in the `style` attribute: +This rule applies to any HTML element that is [visible][] and has one of the following CSS properties set by the `style` attribute: - [word-spacing][] - [letter-spacing][] @@ -28,15 +27,15 @@ This rule applies to any HTML element that is [visible][] and has any of the bel ## Expectation 1 -The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is `0.16em` or greater. +The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is greater than `0.16em` . ## Expectation 2 -The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is `0.12em` or greater. +The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is greater than `0.12em` . ## Expectation 3 -The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is `1.5em` or greater. +The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is greater than `1.5em` . **Note:** Font size conversations rely on the default pixel size for body (usually 16 pixels), as defined by the [user agent origin][] stylesheet. @@ -46,7 +45,7 @@ If there is a mechanism available on the page by which text spacing can be adjus ## Accessibility Support -While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important`. If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. +While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important` . If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. ## Background @@ -60,10 +59,10 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `20px !important` (equals `1.25em`) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. +This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -

+

The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.

@@ -71,10 +70,10 @@ This `p` element has a `line-height` of `20px !important` (equals `1.25em`) whic #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em !important` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. +This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -
+
The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.
@@ -82,7 +81,7 @@ This `div` element has a `letter-spacing` of `0.12em !important` which is equal #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. Given the computed valuevalue is equal to the permissible value, the [priority][] is not taken into consideration. ```html @@ -96,7 +95,7 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -
+
The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.
@@ -109,7 +108,7 @@ This `article` element has both `word-spacing` and `line-height` specified, whic ```html -
+
The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate.
@@ -121,7 +120,7 @@ This `article` element has both `word-spacing` and `line-height` specified, whic #### Failed Example 1 -This `p` element has a `line-height` of `30px !important` (equals `1.875em`) which is above the permissible minimum, given the default pixel size of the body is 16 pixels. +This `p` element has a `line-height` of `30px !important` (equals `1.875em` ) which is above the permissible minimum, given the default pixel size of the body is 16 pixels. ```html

@@ -143,7 +142,7 @@ This `div` element has a `letter-spacing` of `1em !important` which is above to #### Failed Example 3 -This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em`) which is above the permissible value, given the default pixel size of the body is 16 pixels. +This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) which is above the permissible value, given the default pixel size of the body is 16 pixels. ```html @@ -165,7 +164,7 @@ This `article` element has both `letter-spacing` and `line-height` specified, wh #### Failed Example 5 -This `p` element has a `line-height` of `1.25em !important`, which is greater than `1.5em` given the body has a default pixel size of 24 pixels. +This `p` element has a `line-height` of `1.25em !important` , which is greater than `1.5em` given the body has a default pixel size of 24 pixels. ```html @@ -182,7 +181,7 @@ This `p` element has a `line-height` of `1.25em !important`, which is greater th #### Inapplicable Example 1 -This `p` element is not [visible][] because of `display: none`. +This `p` element is not [visible][] because of `display: none` . ```html

@@ -202,6 +201,25 @@ This text is not [visible][] because it is positioned off screen.

``` +#### Inapplicable Example 3 + +This `body` element does not have `style` attribute specified. + +```html + + + + + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. + + +``` + [visible]: #visible 'Definition of visible' [word-spacing]: https://www.w3.org/TR/css-text-3/#word-spacing-property 'CSS Text Module Level 3 - Word Spacing: the word-spacing property' [letter-spacing]: https://www.w3.org/TR/css-text-3/#propdef-letter-spacing 'CSS Text Module Level 3 - Tracking: the letter-spacing property' From f395c780eac0d7332346be4b3fc5ff65f0c3ab53 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 28 Apr 2020 17:59:39 +0100 Subject: [PATCH 11/35] update --- _rules/text-spacing-not-important-b8bb68.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index bfa07459b5..8ee0cd97f8 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -11,13 +11,16 @@ accessibility_requirements: passed: further testing needed inapplicable: further testing needed -input_aspects: + DOM Tree - + CSS Styling +input_aspects: + - DOM Tree + - CSS Styling acknowledgments: authors: - Jey Nandakumar ----## Applicability +--- + +## Applicability This rule applies to any HTML element that is [visible][] and has one of the following CSS properties set by the `style` attribute: @@ -81,7 +84,7 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the perm #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. Given the computed valuevalue is equal to the permissible value, the [priority][] is not taken into consideration. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. Given the computed value is equal to the permissible value, the [priority][] is not taken into consideration. ```html From 8117664d40ae72ca0a7f059eb4713383fec6f72c Mon Sep 17 00:00:00 2001 From: jkodu Date: Fri, 1 May 2020 13:21:36 +0100 Subject: [PATCH 12/35] update --- _rules/text-spacing-not-important-b8bb68.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 8ee0cd97f8..937a0b6fdf 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -30,15 +30,15 @@ This rule applies to any HTML element that is [visible][] and has one of the fol ## Expectation 1 -The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is greater than `0.16em` . +The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is greater than `0.16` times the computed [font-size][] of the test target. ## Expectation 2 -The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is greater than `0.12em` . +The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is greater than `0.12` times the computed [font-size][] of the test target. ## Expectation 3 -The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is greater than `1.5em` . +The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is greater than `1.5` times the computed [font-size][] of the test target. **Note:** Font size conversations rely on the default pixel size for body (usually 16 pixels), as defined by the [user agent origin][] stylesheet. @@ -232,3 +232,4 @@ This `body` element does not have `style` attribute specified. [author origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 - Cascading Origins - Author Origin' [user origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Origin' [user agent origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-ua 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Agent Origin' +[font-size]: https://www.w3.org/TR/css-fonts-3/#propdef-font-size 'CSS Fonts Module Level 3- Font size: the font-size property' From e27e1316de30fdb3b2b2f03513d703b86edb8744 Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 4 May 2020 13:41:10 +0100 Subject: [PATCH 13/35] updates --- _rules/text-spacing-not-important-b8bb68.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 937a0b6fdf..5286b5bff4 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -1,20 +1,18 @@ --- id: b8bb68 -name: Text spacing set in the `style` attribute is below permissible minimum value or not set to `!important` +name: Text spacing in `style` attributes is not `!important` rule_type: atomic description: | - This rule checks that + This rule checks that text spacing set in the `style` attribute is below permissible minimum value or not set to `!important` 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: - Jey Nandakumar @@ -30,17 +28,17 @@ This rule applies to any HTML element that is [visible][] and has one of the fol ## Expectation 1 -The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is greater than `0.16` times the computed [font-size][] of the test target. +The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is greater than `0.16` times the [computed][] [font-size][] of the test target. ## Expectation 2 -The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is greater than `0.12` times the computed [font-size][] of the test target. +The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is greater than `0.12` times the [computed][] [font-size][] of the test target. ## Expectation 3 -The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is greater than `1.5` times the computed [font-size][] of the test target. +The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is greater than `1.5` times the [computed][] [font-size][] of the test target. -**Note:** Font size conversations rely on the default pixel size for body (usually 16 pixels), as defined by the [user agent origin][] stylesheet. +**Note:** Font size conversions rely on the default pixel size for body (usually 16 pixels), as defined by the [user agent origin][] stylesheet. ## Assumptions @@ -48,7 +46,7 @@ If there is a mechanism available on the page by which text spacing can be adjus ## Accessibility Support -While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important` . If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. +While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important`. If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. ## Background From 8c0e3d89f632c86ff0a50b47d547b29673c74344 Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 4 May 2020 13:50:40 +0100 Subject: [PATCH 14/35] update examples --- _rules/text-spacing-not-important-b8bb68.md | 153 +++++++++++++++----- 1 file changed, 120 insertions(+), 33 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 5286b5bff4..5942d1b700 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -63,10 +63,21 @@ While some assistive technologies are able to set [user origin][] styles, others This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -

+ + + + + +

+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +

+ + ``` #### Passed Example 2 @@ -74,10 +85,21 @@ This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
+ + + + + +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+ + ``` #### Passed Example 3 @@ -85,10 +107,21 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the perm This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. Given the computed value is equal to the permissible value, the [priority][] is not taken into consideration. ```html - - The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. - + + + + + + + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. + + + ``` #### Passed Example 4 @@ -96,10 +129,21 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
+ + + + + +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+ + ``` #### Passed Example 5 @@ -124,10 +168,21 @@ This `article` element has both `word-spacing` and `line-height` specified, whic This `p` element has a `line-height` of `30px !important` (equals `1.875em` ) which is above the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -

+ + + + + +

+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +

+ + ``` #### Failed Example 2 @@ -135,10 +190,21 @@ This `p` element has a `line-height` of `30px !important` (equals `1.875em` ) wh This `div` element has a `letter-spacing` of `1em !important` which is above to the permissible minimum, given the default pixel size of the body is 16 pixels. ```html -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
+ + + + + +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+ + ``` #### Failed Example 3 @@ -146,10 +212,21 @@ This `div` element has a `letter-spacing` of `1em !important` which is above to This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) which is above the permissible value, given the default pixel size of the body is 16 pixels. ```html - - The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. - + + + + + + + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. + + + ``` #### Failed Example 4 @@ -157,10 +234,21 @@ This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) This `article` element has both `letter-spacing` and `line-height` specified, where `line-height` is above the permissible value, given the default pixel size of the body is 16 pixels. ```html -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
+ + + + + +
+ The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the + sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. +
+ + ``` #### Failed Example 5 @@ -213,7 +301,6 @@ This `body` element does not have `style` attribute specified. line-height: 50px; } - The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. From cdd6b7c596ffb71109b366c0d3c8271c442716bf Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 4 May 2020 16:11:35 +0100 Subject: [PATCH 15/35] update --- _rules/text-spacing-not-important-b8bb68.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 5942d1b700..42b78619f7 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -38,8 +38,6 @@ The test target does not have "important" as its [letter-spacing][] [priority][] The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is greater than `1.5` times the [computed][] [font-size][] of the test target. -**Note:** Font size conversions rely on the default pixel size for body (usually 16 pixels), as defined by the [user agent origin][] stylesheet. - ## Assumptions If there is a mechanism available on the page by which text spacing can be adjusted, failing this rule might not mean [success criterion 1.4.12 Text spacing](https://www.w3.org/TR/WCAG21/#text-spacing) is not satisfied. From 30496a94398e7ebe8a8c89d873e2662fd1164469 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 5 May 2020 13:26:25 +0100 Subject: [PATCH 16/35] update --- _rules/text-spacing-not-important-b8bb68.md | 97 +++++++++------------ 1 file changed, 40 insertions(+), 57 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 42b78619f7..c10ed24b50 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -62,13 +62,11 @@ This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below ```html - - - +

The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -84,13 +82,11 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the perm ```html - - - +

The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -106,13 +102,11 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e ```html - - - + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -128,13 +122,11 @@ This `article` element has both `word-spacing` and `line-height` specified, whic ```html - - - +
The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -167,13 +159,11 @@ This `p` element has a `line-height` of `30px !important` (equals `1.875em` ) wh ```html - - - +

The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -189,13 +179,11 @@ This `div` element has a `letter-spacing` of `1em !important` which is above to ```html - - - +

The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -211,13 +199,11 @@ This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) ```html - - - + The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -233,13 +219,11 @@ This `article` element has both `letter-spacing` and `line-height` specified, wh ```html - - - +
The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the @@ -314,5 +298,4 @@ This `body` element does not have `style` attribute specified. [computed]: https://www.w3.org/TR/css-cascade-3/#computed-value 'CSS Cascading and Inheritance Level 3 - Computed Values' [author origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 - Cascading Origins - Author Origin' [user origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Origin' -[user agent origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-ua 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Agent Origin' [font-size]: https://www.w3.org/TR/css-fonts-3/#propdef-font-size 'CSS Fonts Module Level 3- Font size: the font-size property' From b835247f491d561cb3f6a13d8348c831e477b176 Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 8 Jun 2020 17:50:37 +0100 Subject: [PATCH 17/35] update example descriptions --- _rules/text-spacing-not-important-b8bb68.md | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index c10ed24b50..55b73a67ef 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -58,7 +58,7 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. +This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the priority is not set to `important` the user can increase the `line-height` above the permissible minimum value. ```html @@ -78,7 +78,7 @@ This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. +This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. Since the priority is not set to `important` the user can increase the `letter-spacing` above the permissible minimum value. ```html @@ -118,7 +118,7 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e #### Passed Example 4 -This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. +This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the priority is not set to `important` for either the `line-height` or `word-spacing`, the user can increase them to be above the permissible minimum value. ```html @@ -136,21 +136,6 @@ This `article` element has both `word-spacing` and `line-height` specified, whic ``` -#### Passed Example 5 - -This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the element has an font-size of 16 pixels, which overrides the pixel size of the body. - -```html - - -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
- - -``` - ### Failed #### Failed Example 1 From b5345ee4f8b4f2a39dd3f306f029a1ce4037fff2 Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 8 Jun 2020 18:14:18 +0100 Subject: [PATCH 18/35] update expectations and example desc --- _rules/text-spacing-not-important-b8bb68.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 55b73a67ef..4f34fc4736 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -28,15 +28,15 @@ This rule applies to any HTML element that is [visible][] and has one of the fol ## Expectation 1 -The test target does not have "important" as its [word-spacing][] [priority][], unless the [computed][] [word-spacing][] is greater than `0.16` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the CSS [word-spacing][] property, unless the [computed][] [word-spacing][] is greater than `0.16` times the [computed][] [font-size][] of the test target. ## Expectation 2 -The test target does not have "important" as its [letter-spacing][] [priority][], unless the [computed][] [letter-spacing][] is greater than `0.12` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the CSS [letter-spacing][] property, unless the [computed][] [letter-spacing][] is greater than `0.12` times the [computed][] [font-size][] of the test target. ## Expectation 3 -The test target does not have "important" as its [line-height][] [priority][], unless the [computed][] [line-height][] is greater than `1.5` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the CSS [line-height][] property, unless the [computed][] [line-height][] is greater than `1.5` times the [computed][] [font-size][] of the test target. ## Assumptions @@ -44,7 +44,7 @@ If there is a mechanism available on the page by which text spacing can be adjus ## Accessibility Support -While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough priority to override a `style` attribute with `!important`. If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. +While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough [priority][] to override a `style` attribute with the [important flag][]. If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. ## Background @@ -58,7 +58,7 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the priority is not set to `important` the user can increase the `line-height` above the permissible minimum value. +This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `line-height` above the permissible minimum value. ```html @@ -78,7 +78,7 @@ This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. Since the priority is not set to `important` the user can increase the `letter-spacing` above the permissible minimum value. +This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `letter-spacing` above the permissible minimum value. ```html @@ -98,7 +98,7 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the perm #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. Given the computed value is equal to the permissible value, the [priority][] is not taken into consideration. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. ```html @@ -118,7 +118,7 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e #### Passed Example 4 -This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the priority is not set to `important` for either the `line-height` or `word-spacing`, the user can increase them to be above the permissible minimum value. +This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the [important flag][] is not set for either the `line-height` or `word-spacing`, the user can increase them to be above the permissible minimum value. ```html @@ -284,3 +284,4 @@ This `body` element does not have `style` attribute specified. [author origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-author 'CSS Cascading and Inheritance Level 4 - Cascading Origins - Author Origin' [user origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Origin' [font-size]: https://www.w3.org/TR/css-fonts-3/#propdef-font-size 'CSS Fonts Module Level 3- Font size: the font-size property' +[important flag]: https://www.w3.org/TR/cssom/#css-declaration-important-flag 'CSS Object Model (CSSOM) - important flag' From 87742fec75a1149d0ca9b1a9411d3fa9b050b1af Mon Sep 17 00:00:00 2001 From: Jey Nandakumar Date: Thu, 11 Jun 2020 11:07:05 -0400 Subject: [PATCH 19/35] Apply suggestions from code review Co-authored-by: Kasper Isager --- _rules/text-spacing-not-important-b8bb68.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 4f34fc4736..744a8d9dc7 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -28,15 +28,15 @@ This rule applies to any HTML element that is [visible][] and has one of the fol ## Expectation 1 -The test target does not have the [important flag][] set for the CSS [word-spacing][] property, unless the [computed][] [word-spacing][] is greater than `0.16` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the CSS [word-spacing][] property, unless the [computed][] [word-spacing][] is at least `0.16` times the [computed][] [font-size][] of the test target. ## Expectation 2 -The test target does not have the [important flag][] set for the CSS [letter-spacing][] property, unless the [computed][] [letter-spacing][] is greater than `0.12` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the CSS [letter-spacing][] property, unless the [computed][] [letter-spacing][] is at least `0.12` times the [computed][] [font-size][] of the test target. ## Expectation 3 -The test target does not have the [important flag][] set for the CSS [line-height][] property, unless the [computed][] [line-height][] is greater than `1.5` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the CSS [line-height][] property, unless the [computed][] [line-height][] is at least `1.5` times the [computed][] [font-size][] of the test target. ## Assumptions From 45db2eaa0530b2bf380bf5f698d98be237eeef3f Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 23 Jun 2020 12:52:11 +0100 Subject: [PATCH 20/35] update --- _rules/text-spacing-not-important-b8bb68.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 744a8d9dc7..bc91a1ea87 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -36,7 +36,7 @@ The test target does not have the [important flag][] set for the CSS [letter-spa ## Expectation 3 -The test target does not have the [important flag][] set for the CSS [line-height][] property, unless the [computed][] [line-height][] is at least `1.5` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the [declared value][] of the CSS [line-height][] property that is specified by the `style` attribute of the test target, unless the [computed][] [line-height][] is at least `1.5` times the [computed][] [font-size][] of the test target. ## Assumptions @@ -285,3 +285,4 @@ This `body` element does not have `style` attribute specified. [user origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Origin' [font-size]: https://www.w3.org/TR/css-fonts-3/#propdef-font-size 'CSS Fonts Module Level 3- Font size: the font-size property' [important flag]: https://www.w3.org/TR/cssom/#css-declaration-important-flag 'CSS Object Model (CSSOM) - important flag' +[declared value]: https://drafts.csswg.org/css-cascade/#declared 'CSS Cascading and Inheritance Level 4 - Declared Values' From cf3dc6bdd0bc9496207b6320ecf460b747367980 Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 23 Jun 2020 15:56:42 +0100 Subject: [PATCH 21/35] updat expectations --- _rules/text-spacing-not-important-b8bb68.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index bc91a1ea87..6dead41efb 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -28,11 +28,11 @@ This rule applies to any HTML element that is [visible][] and has one of the fol ## Expectation 1 -The test target does not have the [important flag][] set for the CSS [word-spacing][] property, unless the [computed][] [word-spacing][] is at least `0.16` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the [declared value][] of the CSS [word-spacing][] property that is specified by the `style` attribute of the test target, unless the [computed][] [word-spacing][] is at least `0.16` times the [computed][] [font-size][] of the test target. ## Expectation 2 -The test target does not have the [important flag][] set for the CSS [letter-spacing][] property, unless the [computed][] [letter-spacing][] is at least `0.12` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the [declared value][] of the the CSS [letter-spacing][] property that is specified by the `style` attribute of the test target, unless the [computed][] [letter-spacing][] is at least `0.12` times the [computed][] [font-size][] of the test target. ## Expectation 3 From 45680edce0ceb7c8afb7f10d509535df01db0d4d Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 23 Jun 2020 16:10:54 +0100 Subject: [PATCH 22/35] update --- _rules/text-spacing-not-important-b8bb68.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 6dead41efb..cb97737c1f 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -32,7 +32,7 @@ The test target does not have the [important flag][] set for the [declared value ## Expectation 2 -The test target does not have the [important flag][] set for the [declared value][] of the the CSS [letter-spacing][] property that is specified by the `style` attribute of the test target, unless the [computed][] [letter-spacing][] is at least `0.12` times the [computed][] [font-size][] of the test target. +The test target does not have the [important flag][] set for the [declared value][] of the CSS [letter-spacing][] property that is specified by the `style` attribute of the test target, unless the [computed][] [letter-spacing][] is at least `0.12` times the [computed][] [font-size][] of the test target. ## Expectation 3 From ca72bd9317fc446e07a4b5ef3b93bc3ba2cd20f8 Mon Sep 17 00:00:00 2001 From: Jey Nandakumar Date: Wed, 24 Jun 2020 08:25:43 -0400 Subject: [PATCH 23/35] Apply suggestions from code review Co-authored-by: Carlos --- _rules/text-spacing-not-important-b8bb68.md | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index cb97737c1f..84f5920c6d 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -44,7 +44,7 @@ If there is a mechanism available on the page by which text spacing can be adjus ## Accessibility Support -While some assistive technologies are able to set [user origin][] styles, others such as browser extensions are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough [priority][] to override a `style` attribute with the [important flag][]. If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. +While some assistive technologies are able to set [user origin][] styles, others, such as browser extensions, are only able to set style with the [author origin][]. Such assistive technologies can not create styles with a high enough [priority][] to override a `style` attribute with the [important flag][]. If accessibility support does not include assistive technologies that override text spacing through [author origin][], this rule should not be used. ## Background @@ -58,7 +58,7 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `line-height` above the permissible minimum value. +This `p` element has a `line-height` of `20px` (equals `1.25em`) which is below the permissible minimum, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `line-height` above the permissible minimum value. ```html @@ -78,7 +78,7 @@ This `p` element has a `line-height` of `20px` (equals `1.25em` ) which is below #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `letter-spacing` above the permissible minimum value. +This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `letter-spacing` above the permissible minimum value. ```html @@ -98,7 +98,7 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the perm #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size of the body is 16 pixels. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the permissible value, given the pixel size of the body is 16 pixels. ```html @@ -118,7 +118,7 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e #### Passed Example 4 -This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the default pixel size of the body is 16 pixels. Since the [important flag][] is not set for either the `line-height` or `word-spacing`, the user can increase them to be above the permissible minimum value. +This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set for either the `line-height` or `word-spacing`, the user can increase them to be above the permissible minimum value. ```html @@ -140,7 +140,7 @@ This `article` element has both `word-spacing` and `line-height` specified, whic #### Failed Example 1 -This `p` element has a `line-height` of `30px !important` (equals `1.875em` ) which is above the permissible minimum, given the default pixel size of the body is 16 pixels. +This `p` element has a `line-height` of `30px !important` (equals `1.875em`) which is above the permissible minimum, given the pixel size of the body is 16 pixels. ```html @@ -160,7 +160,7 @@ This `p` element has a `line-height` of `30px !important` (equals `1.875em` ) wh #### Failed Example 2 -This `div` element has a `letter-spacing` of `1em !important` which is above to the permissible minimum, given the default pixel size of the body is 16 pixels. +This `div` element has a `letter-spacing` of `1em !important` which is above to the permissible minimum, given the pixel size of the body is 16 pixels. ```html @@ -180,7 +180,7 @@ This `div` element has a `letter-spacing` of `1em !important` which is above to #### Failed Example 3 -This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) which is above the permissible value, given the default pixel size of the body is 16 pixels. +This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) which is above the permissible value, given the pixel size of the body is 16 pixels. ```html @@ -200,7 +200,7 @@ This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) #### Failed Example 4 -This `article` element has both `letter-spacing` and `line-height` specified, where `line-height` is above the permissible value, given the default pixel size of the body is 16 pixels. +This `article` element has both `letter-spacing` and `line-height` specified, where `line-height` is above the permissible value, given the pixel size of the body is 16 pixels. ```html @@ -220,7 +220,7 @@ This `article` element has both `letter-spacing` and `line-height` specified, wh #### Failed Example 5 -This `p` element has a `line-height` of `1.25em !important` , which is greater than `1.5em` given the body has a default pixel size of 24 pixels. +This `p` element has a `line-height` of `1.25em !important` , which is greater than `1.5em` given the body has a pixel size of 24 pixels. ```html @@ -237,7 +237,7 @@ This `p` element has a `line-height` of `1.25em !important` , which is greater t #### Inapplicable Example 1 -This `p` element is not [visible][] because of `display: none` . +This `p` element is not [visible][] because of `display: none`. ```html

@@ -259,7 +259,7 @@ This text is not [visible][] because it is positioned off screen. #### Inapplicable Example 3 -This `body` element does not have `style` attribute specified. +This `body` element does not have a `style` attribute specified. ```html From 348498a8c1391b4629872fc7bd8238faef6b6b36 Mon Sep 17 00:00:00 2001 From: Jey Nandakumar Date: Mon, 29 Jun 2020 09:31:33 -0400 Subject: [PATCH 24/35] Apply suggestions from code review Co-authored-by: EmmaJP --- _rules/text-spacing-not-important-b8bb68.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 84f5920c6d..6df1f99796 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -3,7 +3,7 @@ id: b8bb68 name: Text spacing in `style` attributes is not `!important` rule_type: atomic description: | - This rule checks that text spacing set in the `style` attribute is below permissible minimum value or not set to `!important` + This rule checks that text spacing set in the `style` attribute is not set to `!important` or that at least one of the relevant text styles has exceeded the specified metric for retaining content visibility and functionality. accessibility_requirements: wcag21:1.4.12: # Text Spacing (AA) forConformance: true @@ -58,7 +58,7 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `20px` (equals `1.25em`) which is below the permissible minimum, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `line-height` above the permissible minimum value. +This `p` element has a `line-height` of `20px` (equals `1.25em`) which is below the recommended metric, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `line-height`. ```html From 249f80e128149cc0a5e5c38cc243bf65bc89daf2 Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 6 Jul 2020 03:23:24 +0100 Subject: [PATCH 25/35] update rule --- __tests__/spelling-ignore.yml | 1 - _rules/text-spacing-not-important-b8bb68.md | 295 +++++++++----------- 2 files changed, 133 insertions(+), 163 deletions(-) diff --git a/__tests__/spelling-ignore.yml b/__tests__/spelling-ignore.yml index 135788d4d6..691ba8ae67 100755 --- a/__tests__/spelling-ignore.yml +++ b/__tests__/spelling-ignore.yml @@ -73,7 +73,6 @@ - de-hello - Helvetica - stylesheet -- Helvetica - fieldsets - ascii # lowercase needed in reference list - CMS diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 6df1f99796..32fd8054a3 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -3,7 +3,7 @@ id: b8bb68 name: Text spacing in `style` attributes is not `!important` rule_type: atomic description: | - This rule checks that text spacing set in the `style` attribute is not set to `!important` or that at least one of the relevant text styles has exceeded the specified metric for retaining content visibility and functionality. + This rule checks that the text spacing styles are able to be adjusted, ie. `!important` is not applied to the style, unless the style has already exceeded the specified metric for retaining content visibility and functionality. accessibility_requirements: wcag21:1.4.12: # Text Spacing (AA) forConformance: true @@ -11,8 +11,8 @@ accessibility_requirements: passed: further testing needed inapplicable: further testing needed input_aspects: - - DOM Tree - - CSS Styling + - DOM Tree + - CSS Styling acknowledgments: authors: - Jey Nandakumar @@ -20,23 +20,23 @@ acknowledgments: ## Applicability -This rule applies to any HTML element that is [visible][] and has one of the following CSS properties set by the `style` attribute: - -- [word-spacing][] -- [letter-spacing][] -- [line-height][] +This rule applies to any HTML element that is [visible][] and has a [declared value][] for any of the following CSS properties: +- [word-spacing][], +- [letter-spacing][], +- [line-height][]; +which are set by the `style` attribute, and have the [important] flag. ## Expectation 1 -The test target does not have the [important flag][] set for the [declared value][] of the CSS [word-spacing][] property that is specified by the `style` attribute of the test target, unless the [computed][] [word-spacing][] is at least `0.16` times the [computed][] [font-size][] of the test target. +The test target's [computed][] [word-spacing][] is at least `0.16` times it's [computed][] [font-size][]. ## Expectation 2 -The test target does not have the [important flag][] set for the [declared value][] of the CSS [letter-spacing][] property that is specified by the `style` attribute of the test target, unless the [computed][] [letter-spacing][] is at least `0.12` times the [computed][] [font-size][] of the test target. +The test target's [computed][] [letter-spacing][] is at least `0.12` times it's [computed][] [font-size][]. ## Expectation 3 -The test target does not have the [important flag][] set for the [declared value][] of the CSS [line-height][] property that is specified by the `style` attribute of the test target, unless the [computed][] [line-height][] is at least `1.5` times the [computed][] [font-size][] of the test target. +The test target's [computed][] [line-height][] is at least `1.5` times it's [computed][] [font-size][] of the test target. ## Assumptions @@ -48,9 +48,9 @@ While some assistive technologies are able to set [user origin][] styles, others ## Background -- [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) +* [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 @@ -58,81 +58,64 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `20px` (equals `1.25em`) which is below the recommended metric, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `line-height`. +This `p` element has a `line-height` of `32px` (equals `2em` ) which is above the recommended metric, given the default pixel size is 16 pixels. -```html +``` html - - -

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -

- + + + +

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

+ + ``` #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set, the user can increase the `letter-spacing` above the permissible minimum value. +This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size is 16 pixels. -```html +``` html - - -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
- + + + +
+ The toy brought back fond memories of being lost in the rain forest. +
+ + ``` #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the permissible value, given the pixel size of the body is 16 pixels. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size is 16 pixels. -```html +``` html - - - - The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. - - - -``` - -#### Passed Example 4 + + + + + The toy brought back fond memories of being lost in the rain forest. + + -This `article` element has both `word-spacing` and `line-height` specified, which are both below the permissible minimum, given the pixel size of the body is 16 pixels. Since the [important flag][] is not set for either the `line-height` or `word-spacing`, the user can increase them to be above the permissible minimum value. - -```html - - - -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
- ``` @@ -140,96 +123,64 @@ This `article` element has both `word-spacing` and `line-height` specified, whic #### Failed Example 1 -This `p` element has a `line-height` of `30px !important` (equals `1.875em`) which is above the permissible minimum, given the pixel size of the body is 16 pixels. +This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. -```html +``` html - - -

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -

- + + + +

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

+ + ``` #### Failed Example 2 -This `div` element has a `letter-spacing` of `1em !important` which is above to the permissible minimum, given the pixel size of the body is 16 pixels. +This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375em`) which is below to the permissible minimum, given the default pixel size is 16 pixels. -```html +``` html - - -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
- - -``` + + + +
+ The toy brought back fond memories of being lost in the rain forest. +
+ -#### Failed Example 3 - -This `strong` element has a `word-spacing` of `8px !important` (equals `0.5em` ) which is above the permissible value, given the pixel size of the body is 16 pixels. - -```html - - - - - The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. - - ``` -#### Failed Example 4 +#### Failed Example 3 -This `article` element has both `letter-spacing` and `line-height` specified, where `line-height` is above the permissible value, given the pixel size of the body is 16 pixels. +This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.15625em` ) which is below the permissible value, given the default pixel size is 16 pixels. -```html +``` html - - -
- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -
- - -``` - -#### Failed Example 5 + + + + + The toy brought back fond memories of being lost in the rain forest. + + -This `p` element has a `line-height` of `1.25em !important` , which is greater than `1.5em` given the body has a pixel size of 24 pixels. - -```html - - -

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. -

- ``` @@ -237,12 +188,11 @@ This `p` element has a `line-height` of `1.25em !important` , which is greater t #### Inapplicable Example 1 -This `p` element is not [visible][] because of `display: none`. +This `p` element is not [visible][] because of `display: none` . -```html +``` html

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. + The toy brought back fond memories of being lost in the rain forest.

``` @@ -250,10 +200,9 @@ This `p` element is not [visible][] because of `display: none`. This text is not [visible][] because it is positioned off screen. -```html +``` html

- The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. + The toy brought back fond memories of being lost in the rain forest.

``` @@ -261,17 +210,39 @@ This text is not [visible][] because it is positioned off screen. This `body` element does not have a `style` attribute specified. -```html +``` html - - - The boy walked down the street in a carefree way, playing without notice of what was about him. He didn't hear the - sound of the car as his ball careened into the road. He took a step toward it, and in doing so sealed his fate. - + + + + The toy brought back fond memories of being lost in the rain forest. + + + +``` + +#### Inapplicable Example 4 + +This `p` element has a [line-height][] of `24px` specified via the style attribute, but does not have the [important flag][]. + +``` html + + + + +

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

+ + ``` From e074909bf89019b6bba47c5b94f9592a90ff5f0e Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 6 Jul 2020 03:44:07 +0100 Subject: [PATCH 26/35] fix tests --- __tests__/spelling-ignore.yml | 7 +- _rules/text-spacing-not-important-b8bb68.md | 221 ++++++++++---------- 2 files changed, 111 insertions(+), 117 deletions(-) diff --git a/__tests__/spelling-ignore.yml b/__tests__/spelling-ignore.yml index 691ba8ae67..91dd6a0834 100755 --- a/__tests__/spelling-ignore.yml +++ b/__tests__/spelling-ignore.yml @@ -79,9 +79,10 @@ - 14pt - 18pt -- 20px -- 30px -- 1em +- 32px +- 2em +- 10px +- 24px - 8px # spell checker checks against strict casing & hence some repeated words here diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 32fd8054a3..79b2ea6b1d 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -3,7 +3,7 @@ id: b8bb68 name: Text spacing in `style` attributes is not `!important` rule_type: atomic description: | - This rule checks that the text spacing styles are able to be adjusted, ie. `!important` is not applied to the style, unless the style has already exceeded the specified metric for retaining content visibility and functionality. + This rule checks that the text spacing styles are able to be adjusted, i.e. `!important` is not applied to the style, unless the style has already exceeded the specified metric for retaining content visibility and functionality. accessibility_requirements: wcag21:1.4.12: # Text Spacing (AA) forConformance: true @@ -11,8 +11,8 @@ accessibility_requirements: passed: further testing needed inapplicable: further testing needed input_aspects: - - DOM Tree - - CSS Styling + - DOM Tree + - CSS Styling acknowledgments: authors: - Jey Nandakumar @@ -21,10 +21,11 @@ acknowledgments: ## Applicability This rule applies to any HTML element that is [visible][] and has a [declared value][] for any of the following CSS properties: + - [word-spacing][], - [letter-spacing][], - [line-height][]; -which are set by the `style` attribute, and have the [important] flag. + which are set by the `style` attribute, and have the [important flag][]. ## Expectation 1 @@ -48,9 +49,9 @@ While some assistive technologies are able to set [user origin][] styles, others ## Background -* [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) +- [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 @@ -60,20 +61,19 @@ While some assistive technologies are able to set [user origin][] styles, others This `p` element has a `line-height` of `32px` (equals `2em` ) which is above the recommended metric, given the default pixel size is 16 pixels. -``` html +```html - - - -

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

- - + + + +

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

+ ``` @@ -81,20 +81,19 @@ This `p` element has a `line-height` of `32px` (equals `2em` ) which is above th This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size is 16 pixels. -``` html +```html - - - -
- The toy brought back fond memories of being lost in the rain forest. -
- - + + + +
+ The toy brought back fond memories of being lost in the rain forest. +
+ ``` @@ -102,20 +101,19 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the perm This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size is 16 pixels. -``` html +```html - - - - - The toy brought back fond memories of being lost in the rain forest. - - - + + + + + The toy brought back fond memories of being lost in the rain forest. + + ``` @@ -125,20 +123,19 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. -``` html +```html - - - -

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

- - + + + +

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

+ ``` @@ -146,20 +143,19 @@ This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) wh This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375em`) which is below to the permissible minimum, given the default pixel size is 16 pixels. -``` html +```html - - - -
- The toy brought back fond memories of being lost in the rain forest. -
- - + + + +
+ The toy brought back fond memories of being lost in the rain forest. +
+ ``` @@ -167,20 +163,19 @@ This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375 This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.15625em` ) which is below the permissible value, given the default pixel size is 16 pixels. -``` html +```html - - - - - The toy brought back fond memories of being lost in the rain forest. - - - + + + + + The toy brought back fond memories of being lost in the rain forest. + + ``` @@ -190,9 +185,9 @@ This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.1562 This `p` element is not [visible][] because of `display: none` . -``` html +```html

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

``` @@ -200,9 +195,9 @@ This `p` element is not [visible][] because of `display: none` . This text is not [visible][] because it is positioned off screen. -``` html +```html

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

``` @@ -210,39 +205,37 @@ This text is not [visible][] because it is positioned off screen. This `body` element does not have a `style` attribute specified. -``` html +```html - - - - The toy brought back fond memories of being lost in the rain forest. - - + + + + The toy brought back fond memories of being lost in the rain forest. + ``` #### Inapplicable Example 4 -This `p` element has a [line-height][] of `24px` specified via the style attribute, but does not have the [important flag][]. +This `p` element has a [line-height][] of `24px` specified via the style attribute, but does not have the [important flag][]. -``` html +```html - - - -

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

- - + + + +

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

+ ``` From 1e8af6af4ab19824d8126e8d25f925137c002bc1 Mon Sep 17 00:00:00 2001 From: Jey Date: Mon, 6 Jul 2020 08:10:03 -0400 Subject: [PATCH 27/35] Apply suggestions from code review Co-authored-by: Jean-Yves Moyen --- _rules/text-spacing-not-important-b8bb68.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 79b2ea6b1d..b43fbcd61f 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -3,7 +3,7 @@ id: b8bb68 name: Text spacing in `style` attributes is not `!important` rule_type: atomic description: | - This rule checks that the text spacing styles are able to be adjusted, i.e. `!important` is not applied to the style, unless the style has already exceeded the specified metric for retaining content visibility and functionality. + This rule checks that the text spacing styles can be adjusted by user, i.e. that `!important` is not applied to the style, unless the style has already exceeded the specified metric for retaining content visibility and functionality. accessibility_requirements: wcag21:1.4.12: # Text Spacing (AA) forConformance: true @@ -29,15 +29,15 @@ This rule applies to any HTML element that is [visible][] and has a [declared va ## Expectation 1 -The test target's [computed][] [word-spacing][] is at least `0.16` times it's [computed][] [font-size][]. +The test target's [computed][] [word-spacing][] is at least `0.16` times its [computed][] [font-size][]. ## Expectation 2 -The test target's [computed][] [letter-spacing][] is at least `0.12` times it's [computed][] [font-size][]. +The test target's [computed][] [letter-spacing][] is at least `0.12` times its [computed][] [font-size][]. ## Expectation 3 -The test target's [computed][] [line-height][] is at least `1.5` times it's [computed][] [font-size][] of the test target. +The test target's [computed][] [line-height][] is at least `1.5` times its [computed][] [font-size][] of the test target. ## Assumptions @@ -79,7 +79,7 @@ This `p` element has a `line-height` of `32px` (equals `2em` ) which is above th #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em` which is equal to the permissible minimum, given the default pixel size is 16 pixels. +This `div` element has a `letter-spacing` of `0.12em` which is equal to the recommended minimum, given the default pixel size is 16 pixels. ```html @@ -99,7 +99,7 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the perm #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em` ) which is equal to the permissible value, given the default pixel size is 16 pixels. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the recommended minimum, given the default pixel size is 16 pixels. ```html @@ -121,7 +121,7 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e #### Failed Example 1 -This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) which is below the permissible minimum, given the default pixel size of the body is 16 pixels. +This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) which is below the recommended minimum, given the default pixel size of the body is 16 pixels. ```html @@ -141,7 +141,7 @@ This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) wh #### Failed Example 2 -This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375em`) which is below to the permissible minimum, given the default pixel size is 16 pixels. +This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375em`) which is below to the recommended minimum, given the default pixel size is 16 pixels. ```html @@ -161,7 +161,7 @@ This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375 #### Failed Example 3 -This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.15625em` ) which is below the permissible value, given the default pixel size is 16 pixels. +This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.15625em` ) which is below the recommended minimum, given the default pixel size is 16 pixels. ```html @@ -183,7 +183,7 @@ This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.1562 #### Inapplicable Example 1 -This `p` element is not [visible][] because of `display: none` . +This `p` element is not [visible][] because of `display: none`. ```html

From a6ea5905de216d149296715aa16ad014a36b2c45 Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 6 Jul 2020 15:07:04 +0100 Subject: [PATCH 28/35] update rule --- _rules/text-spacing-not-important-b8bb68.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index b43fbcd61f..0996e9f28b 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -25,19 +25,19 @@ This rule applies to any HTML element that is [visible][] and has a [declared va - [word-spacing][], - [letter-spacing][], - [line-height][]; - which are set by the `style` attribute, and have the [important flag][]. + which are set by the `style` attribute. ## Expectation 1 -The test target's [computed][] [word-spacing][] is at least `0.16` times its [computed][] [font-size][]. +The test target's [computed][] [word-spacing][] either does not have the [important flag][] or is at least `0.16` times its [computed][] [font-size][]. ## Expectation 2 -The test target's [computed][] [letter-spacing][] is at least `0.12` times its [computed][] [font-size][]. +The test target's [computed][] [letter-spacing][] either does not have the [important flag][] or is at least `0.12` times its [computed][] [font-size][]. ## Expectation 3 -The test target's [computed][] [line-height][] is at least `1.5` times its [computed][] [font-size][] of the test target. +The test target's [computed][] [line-height][] either does not have the [important flag][] or is at least `1.5` times its [computed][] [font-size][] of the test target. ## Assumptions From 4c8c9cb794a75a4389ec153801521ab4b8d95cdf Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 6 Jul 2020 23:01:24 +0100 Subject: [PATCH 29/35] update rule --- _rules/text-spacing-not-important-b8bb68.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 0996e9f28b..fd42fcd3aa 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -20,7 +20,7 @@ acknowledgments: ## Applicability -This rule applies to any HTML element that is [visible][] and has a [declared value][] for any of the following CSS properties: +This rule applies to any HTML element that is [visible][] and has a [declared][] value for any of the following CSS properties: - [word-spacing][], - [letter-spacing][], @@ -29,15 +29,24 @@ This rule applies to any HTML element that is [visible][] and has a [declared va ## Expectation 1 -The test target's [computed][] [word-spacing][] either does not have the [important flag][] or is at least `0.16` times its [computed][] [font-size][]. +For the test target's [word-spacing][] property, either: + +- its [declared][] value does not have the [important flag][]; or +- its [computed][] value is at least `0.16` times its [computed][] [font-size][]. ## Expectation 2 -The test target's [computed][] [letter-spacing][] either does not have the [important flag][] or is at least `0.12` times its [computed][] [font-size][]. +For the test target's [letter-spacing][] property, either: + +- its [declared][] value does not have the [important flag][]; or +- its [computed][] value is at least `0.12` times its [computed][] [font-size][]. ## Expectation 3 -The test target's [computed][] [line-height][] either does not have the [important flag][] or is at least `1.5` times its [computed][] [font-size][] of the test target. +For the test target's [line-height][] property, either: + +- its [declared][] value does not have the [important flag][]; or +- its [computed][] value is at least `1.5` times its [computed][] [font-size][]. ## Assumptions @@ -249,4 +258,4 @@ This `p` element has a [line-height][] of `24px` specified via the style attribu [user origin]: https://drafts.csswg.org/css-cascade-4/#cascade-origin-user 'CSS Cascading and Inheritance Level 4 - Cascading Origins - User Origin' [font-size]: https://www.w3.org/TR/css-fonts-3/#propdef-font-size 'CSS Fonts Module Level 3- Font size: the font-size property' [important flag]: https://www.w3.org/TR/cssom/#css-declaration-important-flag 'CSS Object Model (CSSOM) - important flag' -[declared value]: https://drafts.csswg.org/css-cascade/#declared 'CSS Cascading and Inheritance Level 4 - Declared Values' +[declared]: https://www.w3.org/TR/css-cascade-3/#declared 'CSS Cascading and Inheritance Level 3 - Declared Values' From 7e5bab3991cb2570b8664e8819ed7f1abdcf8537 Mon Sep 17 00:00:00 2001 From: Jey Date: Tue, 7 Jul 2020 08:53:07 -0400 Subject: [PATCH 30/35] Apply suggestions from code review Co-authored-by: Jean-Yves Moyen --- _rules/text-spacing-not-important-b8bb68.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index fd42fcd3aa..c6a3d7cdf7 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -31,6 +31,7 @@ This rule applies to any HTML element that is [visible][] and has a [declared][] For the test target's [word-spacing][] property, either: +- it has no [declared][] value; or - its [declared][] value does not have the [important flag][]; or - its [computed][] value is at least `0.16` times its [computed][] [font-size][]. @@ -38,6 +39,7 @@ For the test target's [word-spacing][] property, either: For the test target's [letter-spacing][] property, either: +- it has no [declared][] value; or - its [declared][] value does not have the [important flag][]; or - its [computed][] value is at least `0.12` times its [computed][] [font-size][]. @@ -45,6 +47,7 @@ For the test target's [letter-spacing][] property, either: For the test target's [line-height][] property, either: +- it has no [declared][] value; or - its [declared][] value does not have the [important flag][]; or - its [computed][] value is at least `1.5` times its [computed][] [font-size][]. From a0fedfa202a216dec75e8a2550c42cc09c425709 Mon Sep 17 00:00:00 2001 From: jkodu Date: Thu, 9 Jul 2020 01:20:51 +0100 Subject: [PATCH 31/35] fix: expectation --- _rules/text-spacing-not-important-b8bb68.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index c6a3d7cdf7..9240bee503 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -25,14 +25,14 @@ This rule applies to any HTML element that is [visible][] and has a [declared][] - [word-spacing][], - [letter-spacing][], - [line-height][]; - which are set by the `style` attribute. + which are specified via the `style` attribute. ## Expectation 1 For the test target's [word-spacing][] property, either: - it has no [declared][] value; or -- its [declared][] value does not have the [important flag][]; or +- its [declared][] value specified via the `style` attribute does not have the [important flag][]; or - its [computed][] value is at least `0.16` times its [computed][] [font-size][]. ## Expectation 2 @@ -40,7 +40,7 @@ For the test target's [word-spacing][] property, either: For the test target's [letter-spacing][] property, either: - it has no [declared][] value; or -- its [declared][] value does not have the [important flag][]; or +- its [declared][] value specified via the `style` attribute does not have the [important flag][]; or - its [computed][] value is at least `0.12` times its [computed][] [font-size][]. ## Expectation 3 @@ -48,7 +48,7 @@ For the test target's [letter-spacing][] property, either: For the test target's [line-height][] property, either: - it has no [declared][] value; or -- its [declared][] value does not have the [important flag][]; or +- its [declared][] value specified via the `style` attribute does not have the [important flag][]; or - its [computed][] value is at least `1.5` times its [computed][] [font-size][]. ## Assumptions From 7677c90258bdc446c81e1dca9b0ee5b6717bce9c Mon Sep 17 00:00:00 2001 From: Jey Date: Thu, 9 Jul 2020 08:27:13 -0400 Subject: [PATCH 32/35] Apply suggestions from code review Co-authored-by: Carlos --- _rules/text-spacing-not-important-b8bb68.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 9240bee503..fd901fb2bd 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -20,12 +20,11 @@ acknowledgments: ## Applicability -This rule applies to any HTML element that is [visible][] and has a [declared][] value for any of the following CSS properties: +This rule applies to any HTML element that is [visible][] and has a [declared][] value specified via the `style` attribute for any of the following CSS properties: - [word-spacing][], - [letter-spacing][], -- [line-height][]; - which are specified via the `style` attribute. +- [line-height][]. ## Expectation 1 @@ -71,7 +70,7 @@ While some assistive technologies are able to set [user origin][] styles, others #### Passed Example 1 -This `p` element has a `line-height` of `32px` (equals `2em` ) which is above the recommended metric, given the default pixel size is 16 pixels. +This `p` element has a `line-height` of `32px` (equals `2em` ) which is above the recommended metric, given the specified font size is 16 pixels. ```html From 8cfe4c5b9e38e59a27c83b728ac35b1c27abc468 Mon Sep 17 00:00:00 2001 From: jkodu Date: Thu, 9 Jul 2020 13:32:39 +0100 Subject: [PATCH 33/35] update rule --- _rules/text-spacing-not-important-b8bb68.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index fd901fb2bd..beede4798d 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -90,7 +90,7 @@ This `p` element has a `line-height` of `32px` (equals `2em` ) which is above th #### Passed Example 2 -This `div` element has a `letter-spacing` of `0.12em` which is equal to the recommended minimum, given the default pixel size is 16 pixels. +This `div` element has a `letter-spacing` of `0.12em` which is equal to the recommended minimum, given the specified font size is 16 pixels. ```html @@ -110,7 +110,7 @@ This `div` element has a `letter-spacing` of `0.12em` which is equal to the reco #### Passed Example 3 -This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the recommended minimum, given the default pixel size is 16 pixels. +This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12em`) which is equal to the recommended minimum, given the specified font size is 16 pixels. ```html @@ -132,7 +132,7 @@ This `strong` element has a `word-spacing` of `1.92pt !important` (equals `0.12e #### Failed Example 1 -This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) which is below the recommended minimum, given the default pixel size of the body is 16 pixels. +This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) which is below the recommended minimum, given the specified font size of the body is 16 pixels. ```html @@ -152,7 +152,7 @@ This `p` element has a `line-height` of `10px !important` (equals `0.625em` ) wh #### Failed Example 2 -This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375em`) which is below to the recommended minimum, given the default pixel size is 16 pixels. +This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375em`) which is below to the recommended minimum, given the specified font size is 16 pixels. ```html @@ -172,7 +172,7 @@ This `div` element has a `letter-spacing` of `1.5px !important` (equals `0.09375 #### Failed Example 3 -This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.15625em` ) which is below the recommended minimum, given the default pixel size is 16 pixels. +This `strong` element has a `word-spacing` of `2.5px !important` (equals `0.15625em` ) which is below the recommended minimum, given the specified font size is 16 pixels. ```html From 27ad8357819d1bb689cce11be059f3726a15a59a Mon Sep 17 00:00:00 2001 From: jkodu Date: Mon, 13 Jul 2020 13:58:31 +0100 Subject: [PATCH 34/35] editorial changes --- _rules/text-spacing-not-important-b8bb68.md | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index beede4798d..1e1ddd547b 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -22,33 +22,33 @@ acknowledgments: This rule applies to any HTML element that is [visible][] and has a [declared][] value specified via the `style` attribute for any of the following CSS properties: -- [word-spacing][], -- [letter-spacing][], +- [word-spacing][]; or +- [letter-spacing][]; or - [line-height][]. ## Expectation 1 -For the test target's [word-spacing][] property, either: +For the test target's [word-spacing][] property, one of the following is true: -- it has no [declared][] value; or -- its [declared][] value specified via the `style` attribute does not have the [important flag][]; or -- its [computed][] value is at least `0.16` times its [computed][] [font-size][]. +- has no [declared][] value; or +- the [declared][] value specified via the `style` attribute does not have the [important flag][]; or +- the [computed][] value is at least `0.16` times its [computed][] [font-size][]. ## Expectation 2 -For the test target's [letter-spacing][] property, either: +For the test target's [letter-spacing][] property, one of the following is true: -- it has no [declared][] value; or -- its [declared][] value specified via the `style` attribute does not have the [important flag][]; or -- its [computed][] value is at least `0.12` times its [computed][] [font-size][]. +- has no [declared][] value; or +- the [declared][] value specified via the `style` attribute does not have the [important flag][]; or +- the [computed][] value is at least `0.12` times its [computed][] [font-size][]. ## Expectation 3 -For the test target's [line-height][] property, either: +For the test target's [line-height][] property, one of the following is true: -- it has no [declared][] value; or -- its [declared][] value specified via the `style` attribute does not have the [important flag][]; or -- its [computed][] value is at least `1.5` times its [computed][] [font-size][]. +- no [declared][] value; or +- the [declared][] value specified via the `style` attribute does not have the [important flag][]; or +- the [computed][] value is at least `1.5` times its [computed][] [font-size][]. ## Assumptions From 5f5dbbe0d9441508de683c5eb0b6fb55b5355d4d Mon Sep 17 00:00:00 2001 From: jkodu Date: Tue, 21 Jul 2020 02:19:55 +0100 Subject: [PATCH 35/35] update rule --- _rules/text-spacing-not-important-b8bb68.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_rules/text-spacing-not-important-b8bb68.md b/_rules/text-spacing-not-important-b8bb68.md index 1e1ddd547b..82b94a9da3 100644 --- a/_rules/text-spacing-not-important-b8bb68.md +++ b/_rules/text-spacing-not-important-b8bb68.md @@ -20,11 +20,11 @@ acknowledgments: ## Applicability -This rule applies to any HTML element that is [visible][] and has a [declared][] value specified via the `style` attribute for any of the following CSS properties: +This rule applies to any HTML element that is [visible][], for which one of the following is true: -- [word-spacing][]; or -- [letter-spacing][]; or -- [line-height][]. +- the `style` attribute [declares][declared][][word-spacing][] CSS property; or +- the `style` attribute [declares][declared][][letter-spacing][] CSS property; or +- the `style` attribute [declares][declared][][line-height][] CSS property. ## Expectation 1