-
Notifications
You must be signed in to change notification settings - Fork 75
New Rule: inline link in paragraph is distinguishable be4d0c #1010
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
base: develop
Are you sure you want to change the base?
New Rule: inline link in paragraph is distinguishable be4d0c #1010
Conversation
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.
Some initial feedback. Looking good so far! 👌
|
||
- they have [distinguishing borders](#distinguishing-borders) | ||
- they have [distinguishing box-shadows](#distinguishing-box-shadows) | ||
- they have different `background-image`, |
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.
What's meant by "different"? Are two images with the same URI different, whether it be a data URI or a URL? Do they have to contain different byte sequences? Do they have to subjectively differ in what they depict?
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.
We've added an assumption to the definition.
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.
OK, so I don't know if I caught it all, but I caught a bunch. :-)
This rule applies to any HTML element which: | ||
|
||
- has the [semantic role][] of ['link'][link] or a [semantic role][] that inherits from the ['link'][link] role; and | ||
- is a [descendant][] of a `p` element; and |
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.
Why is this limited to p
elements? Wouldn't this apply just as well to td
or li
or even just div
elements? It seems to me like you didn't quite capture the essence of what you need to test. I think we should come up with a definition of inline links.
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.
The initial version used "block of text" which we found to be ambiguous. So we opted to focus this rule on paragraphs (it's even in the name). When we get this done, we can then move to another "blocks of text".
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.
We're including li
and td
but leaving out div
because you can have all content of a page being a descendant of the same div
.
- An icon immediately before, after or in the link denoting it as a link | ||
- Text immediately before, after or in the link denoting it as a link | ||
- a [distinguishing style][] compared to the other text not based on color alone | ||
- a different color compared to the rest of the text in the paragraph that has at least a 3:1 [contrast ratio](https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio) difference with the rest of the text and a [distinguishing style][] both when the target element [gains focus][gain focus] and the target element is [hovered][] |
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.
This is assuming the rest of the text has a single color.
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.
That is correct. If the rest of the text has more than one color then color can't be a distinguishing factor. Need to add that assumption to the text of the expectation.
- An icon immediately before, after or in the link denoting it as a link | ||
- Text immediately before, after or in the link denoting it as a link | ||
- a [distinguishing style][] compared to the other text not based on color alone | ||
- a different color compared to the rest of the text in the paragraph that has at least a 3:1 [contrast ratio](https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio) difference with the rest of the text and a [distinguishing style][] both when the target element [gains focus][gain focus] and the target element is [hovered][] |
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.
This needs a definition that describes what the color of text is.
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.
Even if the text is all of the same color?
|
||
## Assumptions | ||
|
||
This rule assumes that the link is distinguishable from the rest of the text with color, which means it fails SC 1.4.1 when there is not another way to distinguish 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.
I don't understand this assumption. The expectation tests for color.
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.
The expectation is indeed testing for color, but it needs to be a contrast ratio of at least 3:1 for the expectation to be met.
If we leave this assumption out of it; there could be a scenario where the link is not(!) a different color from the rest of the text and this rule would fail it even though it should not fail the SC. (Because you should only fail this SC if you communicate something with color without communicating it in a different way.
Does that help you understand this assumption?
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.
indeed, if the link is the same color as the surrounding text, this rule is not applicable (it's an odd gap in WCAG since in those cases it's deemed that the link is indistinguishable for all sighted users, not just those with color deficiency/vision impairment that requires at least a 3:1 contrast - though paradoxically keyboard/AT users are advantages because THEY can get to the links without any problem)
@@ -0,0 +1,11 @@ | |||
-- | |||
title: Distinguishing Styles |
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.
Instead of having this definition use three other definitions, I think this should be a single definition. I don't think we currently have a use for those three as separate definitions. Even if at some point in the future we need it, we can split it out then.
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.
Even if don't have another use for these defintions, it is much easier to read the definitions if they are split like this. Don't you think that it makes it worth to have them split?
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 also prefer the split up version, but it's mainly a personal choice.
|
||
- An icon immediately before, after or in the link denoting it as a link | ||
- Text immediately before, after or in the link denoting it as a link | ||
- a [distinguishing style][] compared to the other text not based on color alone |
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.
The distinguishing style definition compares two elements, here you are comparing the link element to text nodes. I don't think that works. Do you mean to compare the link element to the parent element of the text node? If so, there are a bunch of problems with the distinguishing style definition that needs to be worked through. For example:
<style>
* { box-shadow: #F00 0 0 5px; color: black; }
a { text-decoration: none; }
style>
<p>Lorem ipsum <a href="">dolar sit ameta> consectetur.p>
This link is still distinguishable, because it's shadow is an inline one, whereas the shadow of the rest of the text is on the block.
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.
Updated the expectation (and assumptions) for
- comparing elements instead of element and text nodes
- usage of border and box-shadow as distinguishing factors
Rule updated based on changes requested
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.
Some editorials.
New rule
Blocked: waiting for decision on how to handle states in rules
Need for Final Call:
This will require a 2 weeks Final Call << new rule, or substantial changes affecting a large number of test cases, if in doubt, use this. >>
Pull Request Etiquette
When creating PR:
develop
branch (left side).After creating PR:
Rule
,Definition
orChore
.How to Review And Approve