Skip to content
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

Update Links with identical accessible names and context serve equivalent purpose rule #2007

Conversation

giacomo-petri
Copy link
Collaborator

@giacomo-petri giacomo-petri commented Jan 17, 2023

Our current failed scenarios are ambiguous to users in general, which conflicts with 1st assumption.
With these changes I've:

  • Moved "not ambiguous to users in general" from Assumptions to Applicability and updated Expectations adding a new one.
  • Updated failed scenarios, providing a clear visual context for sighted users, that doesn't reflect in an equal semantic context for AT users, resulting in links with same acc name and context, but not ambiguous to users in general.
  • Added 2 png files to make the examples more "realistic" (they have been created from scratch, so we have full rights).
  • Updated the definition of "programmatically determined link context, adding note about punctuation (which in my opinion is relevant).
  • Created 2 inapplicable example for:
    • scenario where one of the links in set is not in the acc tree.
    • scenario which is ambiguous to users in general.

Closes issue(s): #1999

Need for Call for Review:
This will require a 2 weeks Call for Review
I'm note sure about the timing here as multiple failed cases have been updated. I've set 2 weeks but feel free to update if needed.


Pull Request Etiquette

When creating PR:

  • Make sure you're requesting to pull a branch (right side) to the develop branch (left side).
  • Make sure you do not remove the "How to Review and Approve" section in your pull request description

After creating PR:

  • Add yourself (and co-authors) as "Assignees" for PR.
  • Add label to indicate if it's a Rule, Definition or Chore.
  • Link the PR to any issue it solves. This will be done automatically by referencing the issue at the top of this comment in the indicated place.
  • Optionally request feedback from anyone in particular by assigning them as "Reviewers".

When merging a PR:

  • Close any issue that the PR resolves. This will happen automatically upon merging if the PR was correctly linked to the issue, e.g. by referencing the issue at the top of this comment.

How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Call for Review period. In case of disagreement, the longer period wins.

@giacomo-petri giacomo-petri added the Rule Update Use this label for an existing rule that is being updated label Jan 17, 2023
@giacomo-petri giacomo-petri self-assigned this Jan 17, 2023
@giacomo-petri
Copy link
Collaborator Author

Just reviewed Carlos' feedback here #1999 (comment).

I'll update it asap.

@giacomo-petri
Copy link
Collaborator Author

@carlosapaduarte, updated per your request in #1999 (comment).

Ready for review

@giacomo-petri
Copy link
Collaborator Author

giacomo-petri commented Jan 17, 2023

TODO: create very simple static demo pages for failed examples that reflect the link acc name (Contact Us).

Note: we still need to update the context definition to handle scenarios where the meaning of the sentence make the purpose of the link clear without ambiguity (with a different PR?).

e.g.
<div><a href="#">contact us</a> via chat, or <a href="#">contact us</a> via email.</div>

Punctuation might be covered by the note I've added in "ambiguous to users in general" definition, but link might be enough meaningful and distinguishable within its context also without punctuation.

Copy link
Member

@carlosapaduarte carlosapaduarte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, but some issues still left to address

Feel free to add yourself to the list of authors of this rule

@@ -16,6 +16,8 @@ The _programmatically determined context_ of a link (or _programmatically determ
- being a header cell [assigned][] to the closest [ancestor][] of the link in the [flat tree][] that has a [semantic role][] of `cell` or `gridcell`; or
- being referenced by an `aria-describedby` attribute of the link.

**Note**: Since screen readers interpret punctuation, they can also provide the context from the current sentence, when the focus is on a link in that sentence.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you added this note to the definition. Why is mentioning the sentence relevant here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my previous content

Note: we still need to update the context definition to handle scenarios where the meaning of the sentence make the purpose of the link clear without ambiguity (with a different PR?).

e.g. <div><a href="#">contact us</a> via chat, or <a href="#">contact us</a> via email.</div>

Punctuation might be covered by the note I've added in "ambiguous to users in general" definition, but link might be enough meaningful and distinguishable within its context also without punctuation.

I was trying to partially address the example provided, but I understand that as is, it is only more confusing. I remove it but I think we should address it in a separate PR.

Copy link
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would work 💯

giacomo-petri and others added 2 commits January 19, 2023 21:00
Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
…-purpose-fd3a94.md

Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
@@ -42,7 +42,8 @@ This rule applies to any set of two or more [HTML or SVG elements][] for which a
- the elements are in the same [web page (HTML)][]; and
- the elements are [included in the accessibility tree][included in the accessibility tree]; and
- the elements have [matching][] [accessible names][accessible name] that are not empty (`""`); and
- have the same [programmatically determined link context][].
- the elements have the same [programmatically determined link context][]; and
- the purpose of the elements is not [ambiguous to users in general](https://www.w3.org/TR/WCAG21/#dfn-ambiguous-to-users-in-general).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having second thoughts about this. The definition is

the purpose cannot be determined from the link and all information of the Web page presented to the user simultaneously with the link

I don't think this is objective. I agree it is unambiguous, so we might rewrite the rule in a way that moves this condition from the applicability to the expectation (and update the examples accordingly).

What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlosapaduarte ,

I agree, even more considering that the definition of "ambiguous to users in general" is far away from our definition of "programmatically determined link context".

On it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion would be to update the current expectation to something like

For the links in each set of target elements, one of the following is true:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The we don't even need the exception in the first bullet:

either

  • the links resolve to the same resource; or
  • the links are ambiguous

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Links not ambiguous to users in general has been removed from Applicability
  • Added expectation as per suggestions
  • Slightly changed the background note about ambiguous links to reflect new applicability
  • Moved Inapplicable example n.8 to passed example 9 (changing a bit the description).

wcag20:1.1.1: # Non-text Content (A)
secondary: This success criterion is mapped as a Secondary requirement because the SC applies only to non-text content. When links have visual information as context, a failed outcome for this rule may result in SC 1.1.1 Non-text Content being not satisfied.
wcag20:1.3.1: # Info and Relationships (A)
secondary: This success criterion is mapped as a Secondary requirement because the SC applies to information and relationships conveyed through presentation. When links rely on visual cues for conveying information and/or relationships, and these cues are not programmatically determined or available in text, a failed outcome for this rule may result in SC 1.3.1 Info and Relationships being not satisfied.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should follow the format for secondary requirements. Please have a look at the design doc.

Comment on lines +256 to +257
<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/contact-us.html?page=1" style="display:inline-block; background: url(/test-assets/shared/chat.png) 0 / 40px no-repeat; padding: 20px 0 20px 50px;">Contact Us</a>
<a href="/test-assets/links-with-identical-names-serve-equivalent-purpose-b20e66/contact-us.html?page=2" style="display:inline-block; background: url(/test-assets/shared/phone.png) 0 / 40px no-repeat; padding: 20px 0 20px 50px; margin-left: 40px;">Contact Us</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be an HTML page that changes based on the query string. Actually having two HTML files would be better. There is nothing in this rule that requires a tester to compare the query string of two resources. So having an example that checks that you do that feels to me like a disconnect between what we say needs to be tested, and how we in practice want people to test.

I don't think these examples are wrong, but they're not quite right either. They have a complexity to them which they either don't need, or which hint that we don't think this rule is tested in the way we say it is. Neither of which is quite right I think.

@@ -16,13 +16,18 @@ accessibility_requirements:
failed: not satisfied
passed: further testing needed
inapplicable: further testing needed
wcag20:1.1.1: # Non-text Content (A)
secondary: true
wcag20:1.3.1: # Info and Relationships (A)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to have 1.3.1 / 1.1.1 in here any more than the link has accessible name rule does. Sure if 1.1.1 fails you might also fail 2.4.4 but it's entirely possible to for an image with a link in it to pass 1.1.1 and fail 2.4.4 and vice versa. That's not the case for something like an image button which always fails both 1.1.1 and 4.1.2, or something like a 2:1 text contrast which always fails both 1.4.3 and 1.4.5.

Rule of thumb here is if you can separate them, it's not a secondary requirement. There has to be some element for which its not possible to fail one without failing the other SC, or to pass one without passing the other.

@@ -229,80 +243,124 @@ These two HTML `a` elements have the same [accessible name][] and [context][prog
</html>
```

### Failed

#### Failed Example 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind having one or two examples of images in here. I don't think the examples should be exclusively about images. The far more common scenario is with just link text. I think the examples we had before did a better job of demonstrating that problem than the new examples do.

@giacomo-petri
Copy link
Collaborator Author

I will promptly go through all the feedback. Regarding your specific point:

I don't mind having one or two examples of images in here. I don't think the examples should be exclusively about images. The far more common scenario is with just link text. I think the examples we had before did a better job of demonstrating that problem than the new examples do.

It's worth noting that the earlier examples posed a challenge for users in general, which is an exception for the 2.4.4 criterion evaluation.

Honestly, I never seen an example of a couple of links with identical accessible names and context serving different purposes without being ambiguous to users in general, except for the ones where something visual (background, icon, image) is making clear the difference.

@WilcoFiers WilcoFiers removed the Review call 2 weeks Call for review for new rules and big changes label Oct 26, 2023
@giacomo-petri
Copy link
Collaborator Author

@WilcoFiers,

  • updated "content of the page" with ACT "web page" definition;
  • removed 1.1.1 and 1.3.1 from secondary requirements as they are incidental;
  • added 2 failing examples for textual elements without including images.

Only query parameters topic is left out (pending agenda), then we should be ready to go for the call for review :D

Jym77 and others added 3 commits December 7, 2023 15:45
…and-context-serve-equivalent-purpose-patch-1
…and-context-serve-equivalent-purpose-patch-1
…and-context-serve-equivalent-purpose-patch-1
@giacomo-petri
Copy link
Collaborator Author

Call for Review ends on February 23rd.

…and-context-serve-equivalent-purpose-patch-1
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ giacomo-petri
❌ Carlos Duarte


Carlos Duarte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Jym77 Jym77 added Review call 2 weeks Call for review for new rules and big changes and removed Agenda item reviewers wanted labels Feb 12, 2024
Copy link
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Links to WCAG 2.1 need to be updated. This doesn't block the Call for Review but does block merging.

giacomo-petri and others added 4 commits February 12, 2024 10:45
…-purpose-fd3a94.md

Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
…-purpose-fd3a94.md

Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
…-purpose-fd3a94.md

Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
@giacomo-petri giacomo-petri requested a review from Jym77 February 12, 2024 09:50
…and-context-serve-equivalent-purpose-patch-1
@giacomo-petri
Copy link
Collaborator Author

@Jym77

this seems to be ready to merge.

@Jym77
Copy link
Collaborator

Jym77 commented Mar 22, 2024

Call for review has ended, merging.

…and-context-serve-equivalent-purpose-patch-1
@Jym77 Jym77 merged commit 5b6cdb4 into act-rules:develop Mar 22, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review call 2 weeks Call for review for new rules and big changes Rule Update Use this label for an existing rule that is being updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants