Sc1 4 1 A

Created by: Wilco Fiers

Please note, this is a draft

Description

SC1-4-1-a checks if a elements meet 1.4.1 Use of Color.

This test checks if links within text are visually evident before they receive focus, in which case the test passes. If not, the test checks if the links have a significant contrast difference with the surrounding text. If this is the case, and if the link becomes visually evident when it receives focus and when it is hovered by a cursor, it also passes.

Background

Assumptions

Test properties

Property Value
Test name Inline links are distinguishable
Success Criterion 1.4.1 Use of Color
Test mode Automatic
Test environment Remote Controlled User Agent
Test subject Single web page or DOM document fragment

Note: Tools only able to process HTML + CSS can implement the first two step and ignore step 3 through 4, returning ‘cantTell’ instead. A tool could ask the user to perform step 3 and 4 manually, in which case the test would be semi-automatic instead.

Test procedure

Selector

Test mode: automatic

Select each element that matches a[href] that meets the following requirements:

Step 1

Test mode: automatic

Determine computed style for the link and of the surrounding text. The background must be determined by finding the closest ancestor element with the css background property set, either containing an image or a color with a transparency great than 0.

If Step 1a or Step 1b was true, return:

Outcome Passed
Testcase SC1-4-1-a
ID SC1-4-1-a-pass1

Else continue with Step 2

Step 2

Test mode: automatic

Determine color and background-color of the link and the surrounding text and compute<

  1. C1 = contrast difference of surrounding text color and link color
  2. C2 = contrast difference surrounding text background-colo and link background-color

If C1 or C2 is more than 3:1, continue to Step 3

Else return

Outcome Failed
Testcase SC1-4-1-a
ID SC1-4-1-a-fail1
Error The link is not sufficiently distinguishable from the surrounding text

Step 3

Test mode: automatic

Give focus to the link.

(As in step 1:) Determine computed style for the link and the surrounding text. The background must be determined by finding the closest ancestor element with its background set.

If Step 3a or Step 3b was true: Continue to Step 4

Else return:

Outcome Failed
Testcase SC1-4-1-a
ID SC1-4-1-a-fail2
Error The link is not sufficiently distinguishable from the surrounding text when it receives focus.

Step 4

Test mode: automatic

Remove the focus from the link.

Move the mouse pointer to the center of the link. (As in step 1:) Determine computed style for the link and the surrounding text. The background must be determined by finding the closest ancestor element with its background set.

If Step 4a or Step 4b was true, return:

Outcome Passed
Testcase SC1-4-1-a
ID SC1-4-1-a-pass2

Else return:

Outcome Failed
Testcase SC1-4-1-a
ID SC1-4-1-a-fail3
Error The link is not sufficiently distinguishable from the surrounding text when it is hovered over with the mouse pointer.