Asqatasun v4 - AccessiWeb 2.2 - Rule 3.4.3
This test consists in checking whether the contrast ratio between text and its background is at least 4.5:1 for the normal weighted textual elements with a font size superior to 18px.
Criterion : 3.4
Test : 3.4.3
Test description :
- the contrast ratio between text and its background is at least 4,5:1
- a mechanism allows the user to display text with a contrast ratio of at least 4,5:1
Level : Gold
Scope : page
Decision level : decidable
All the textual elements from the DOM with a font-size superior to 18px and not bold
All the hidden textual elements from the DOM with a font-size superior to 18px and not bold
For each element of Set1, the contrast ratio is computed (regarding the contrast ratio definition) to check whether it is superior to 4.5.
For each element returning false in Test1, if the "ALTERNATIVE_CONTRAST_MECHANISM" is set to true by the user, raise a Message1, raise a Message2 instead.
If an element has a contrast ratio that cannot be determined (background defined with an image or a gradient), raise a Message3
For each element of Set2, the contrast ratio is computed (regarding the contrast ratio definition) to check whether it is superior to 4.5.
For each element returning false in Test2, raise a Message4
- Set1 AND Set2 are empty
- Test1 returns true for all elements AND Set2 AND Set3 are empty
- Test1 returns false for at least one element
- In all other cases
- By approximation, we consider that 1.5em of the default font size is equivalent to 18 px.
- The background color ("background" css property), the font color ("color" css property), the font size ("font-size" css property) and the font weight ("font-weight css property) are determined while fetching the page, through the javacript script. Each html element is analyzed to extract these info, as well as whether it is displayed ("display" css property equals to "none" or "visibility" css property equals to "hidden") and whether it is a textual node.