-
Notifications
You must be signed in to change notification settings - Fork 75
New rule: Text nodes have minimal contrast #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@WilcoFiers Let me know what you think: 83161d2 |
pages/glossary/disabled.md
Outdated
key: disabled | ||
--- | ||
|
||
An element that is normally [perceivable][] and [operable][], but has been rendered [inoperable][operable] either temporarily or permanently, is considered disabled. While there exists several techniques through which elements can be disabled, the most typical are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kasperisager This definition is ambiguous, as it leaves room for other unspecified ways of disabling elements. That's not allowed in the applicability of a rule. I suggest we keep it simpler and stick to the two items you have here, leave out the part about perceivable / (in)operable. If you want to leave room for a future "disabled" definition that does include those, we can call this definition "programatically disabled" or something along those lines. Not my preference, I'd rather not try to anticipate the future, but I wouldn't be opposed to it either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be fine with sticking to disabled
and aria-disabled
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WilcoFiers Let me know if 174c64e does the trick. I've left in "perceivable" and "operable" but otherwise restricted the ways in which elements can be "disabled".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick review. many editorials and some questions.
--- | ||
|
||
All colors of the pixels not part of the [foreground colors](#foreground-colors-of-text) pixels, in an bounding box around each [visible](#visible) character in a [text node](https://dom.spec.whatwg.org/#text), where the width is the [advance width](https://www.w3.org/TR/css-values/#length-advance-measure | ||
), plus one pixel on the left and right, and the height is the [advance height](https://www.w3.org/TR/css-values/#length-advance-measure). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an extra newline at the start of this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One outstanding issue on the "decorative"/"font example" test case. We might be faster discussing this over a call.
Several nitpicking or polishing editorials…
_rules/text-contrast-afw4f7.md
Outdated
|
||
#### Passed Example 4 | ||
|
||
This dark grey text has a contrast ratio between 6.1:1 and 9:1 on white background with grey text shadow on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if I get it correctly, the bounding box of, says, the 'o' does include the inside of the character which is far away from the shadow and thus has color #737373
and a contrast ratio of 4.42 with the black text.
Which is OK because the rule only considers the highest contrast ratio.
Co-Authored-By: Jean-Yves Moyen <jym@siteimprove.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/act-rules/act-rules.github.io/pull/833/files/243deec0535bb3d4f2a3dfc12944f7d000075a97#r358815636
is a leftover editorial change.
The rest looks good.
shadowRoot.textContent = 'Some text in English' | ||
</script> | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the text is decorative.
I do not understand why a decorative text is relevant for 1.4.11 (as pointed out by the note in Passed Example 7).
(it is not a UI component, and it is not a "Graphical Object" either; so 1.4.11 does not apply)
This is not important enough to block that PR…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, nice job :-)
Co-Authored-By: Jean-Yves Moyen <jym@siteimprove.com>
_rules/text-contrast-afw4f7.md
Outdated
|
||
- [Success criterion 1.4.3: Contrast (Minimum)](https://www.w3.org/TR/WCAG21/#contrast-minimum) also has an exception for logos and brand names. Since logos and brand names are usually displayed through images to ensure correct rendering, this rule does not take logos or brand names into consideration. If a logo or brand name is included using [text nodes](https://dom.spec.whatwg.org/#text), this rule may produce incorrect results. | ||
|
||
- Text that has the same foreground and background color (a contrast ratio of 1:1) is assumed to be [purely decorative](). The text is assumed to not convey information that is meant for users. Hiding text in this way is sometimes used for search engine optimisation. Text with a contrast of 1:1 does not fail this rule, but may not satisfy [Success criterion 1.4.3: Contrast (Minimum)](https://www.w3.org/TR/WCAG21/#contrast-minimum) if it is not decorative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is good wording to add. It isn't something to encourage and frowned upon by modern search engine algorithms.
``` | ||
|
||
#### Passed Example 8 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Passed Example 8 intended to be an example of something non-meaningful or decorative? If so, should it not be an Inapplicable Example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is an exception mentioned in the expectation. This is because "decorative" is subjective, and the ACT rules format requires the applicability to be objective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So passed example 7 is including text that can be considered decorative (visual only), and passed example 8 is including text that is not conveying meaning.
And in this instance the exceptions are passing examples rather than inapplicable examples because ... ? The only reason I can determine is because the exception is in the expectation rather than the applicability. Is this consistent across rules? Should it be added to the rule guidance docs?
Cause in my understanding, a rule is inapplicable to something that is an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me now 😄
Co-Authored-By: EmmaJP <emma.richens@bbc.co.uk>
Co-Authored-By: EmmaJP <emma.richens@bbc.co.uk>
Congratulations on completing that one! |
Pull Request Etiquette
When creating PR:
develop
branch (left side).After creating PR:
Rule
,Definition
orChore
.How to Review And Approve