lauriii / umami

[Deprecated] Umami is now included in Drupal Core. All further work happens there.
https://www.drupal.org/project/issues/drupal?component=Umami+demo
GNU General Public License v2.0
18 stars 5 forks source link

[a11y][AAA] Link Purpose (Link Only) #147

Closed DuaelFr closed 6 years ago

DuaelFr commented 6 years ago

[Summary rewritten according to @fuzzbomb first comment]

https://www.w3.org/TR/WCAG21/#link-purpose-link-only

Success Criterion 2.4.9 Link Purpose (Link Only) (Level AAA) A mechanism is available to allow the purpose of each link to be identified from link text alone, except where the purpose of the link would be ambiguous to users in general.


The "view recipe" links fall into this criterion. Take a look at the node's "read more" links provided by core to see how you can make better (\Drupal\node\NodeViewBuilder::buildLinks).

fuzzbomb commented 6 years ago

Can you elaborate on the problem, for level-A link purpose?

I don't think it's an instance of F63: Failure of Success Criterion 2.4.4 due to providing link context only in content that is not related to the link because we have context from the preceding heading, which is the recipe name...

Procedure

Locate links where some additional link context is needed to understand the purpose of the link. For each link:

  1. Check whether the context is contained in the same sentence, paragraph, list item, table cell, associated table headers, or preceding heading.
DuaelFr commented 6 years ago

You are right, thanks. I didn't see the part related to preceding headings (which should be in the programatically determined context list, I suppose). I'll retitle this issue to mark it AAA instead and we'll see if we want to invest some time fixing it or not.

fuzzbomb commented 6 years ago

Oh, I just noticed an inconsistency in WCAG 2.0!

The WCAG 2.0 Recommendation and Understanding SC 2.4.4 documents describe "programatically determined link context" in HTML like so:

In HTML, information that is programmatically determinable from a link in English includes text that is in the same paragraph, list, or table cell as the link or in a table header cell that is associated with the table cell that contains the link.

There's no mention of preceding headings providing context here.

However the testing procedure in F63: Failure of Success Criterion 2.4.4 due to providing link context only in content that is not related to the link describes it a bit differently. It DOES mention preceding headings as providing link context (emphasis mine):

Locate links where some additional link context is needed to understand the purpose of the link. For each link:

  1. Check whether the context is contained in the same sentence, paragraph, list item, table cell, associated table headers, or preceding heading.

  2. Check whether the link context can be programmatically determined in some other way, for example, by using a WAI-ARIA property such as aria-label, aria-labelledby or aria-describedby on the link to provide sufficient context

WCAG 2.0 is 10 years old now, and predates the HTML5 elements like article and section, so maybe these WCAG definitions need an update.

I think this discrepancy is worth filing an issue against WCAG in the W3C repo.

markconroy commented 6 years ago

Hi Folks,

I'm a little muddled here. Do I need to do anything on this issue?

fuzzbomb commented 6 years ago

@markconroy Not for now. We're in some doubt as to whether WCAG2 actually requires this at level A. The question is whether the preceding headings provide the context needed for level A. I think we need to research this, and ask the wider a11y community.

fuzzbomb commented 6 years ago

I see we have a Drupal.org issue about this too - Umami Theme - follow-up - is a11y context needed for read more links?

Be careful about filing follow-ups on D.o without referencing existing issues here. We're in danger of having parts of the discussion lost by taking in two places at once. It could make things harder to keep track of, and confusing for new contributors.

fuzzbomb commented 6 years ago

Let's close this one here, not needed for MVP. I've marked the D.O issue as postponed maintainer needs more info

https://www.drupal.org/project/drupal/issues/2937639