Sc3 1 1 Html
Created by: Annika Nietzio
Description
This test checks that the primary language of the web content can be programmatically determined.
Background
- H57: Using language attributes on the html element
- eGovMon test for H57
- BCP 47: Tags for the Identification of Languages
Assumptions
- The comparison of language codes does not look for exact matches. Technique H57 states: “Use of the primary code is important for this technique.” which means that region subtags can be ignored in the comparison, i.e. “en-GB” is the same as “en”.
- This test checks the
langattribute of thehtmlelement. The xml:lang attribute is not taken into account because tests have shown, that xml:lang is ignored by screenreaders. (Both Jaws 15 with FF and IE and NVDA with FF go by lang attribute, xml:lang is ignored.) Thexml:langattribute is checked by a separate test: SC3-1-1-xml-lang.
Test properties
| Property | Value |
|---|---|
| Test name | Primary language of page |
| Success Criterion | 3.1.1 Language of Page |
| Test mode | Automatic |
| Test environment | DOM |
| Test subject | single web page |
Test procedure
Selector
Test mode: automatic
Select the html element.
Step 1
Test mode: automatic
If lang attribute exists:
L1 = value of lang attribute.
Continue with Step2.
else if neither lang nor xml:lang are specified, return
| Outcome | Failed |
|---|---|
| Testcase | SC3-1-1-html |
| ID | SC3-1-1-html-fail1 |
| Error | No language attribute found. |
else (only xml:lang exists)
Do nothing. (This case is covered by SC3-1-1-xml-lang.)
Step 2
Test mode: automatic
Compare L1 to BCP 47.
If L1 is not on the list, return
| Outcome | Failed |
|---|---|
| Testcase | SC3-1-1-html |
| ID | SC3-1-1-html-fail2 |
| Error | Unknown language code. |
| Info | L1 |
Note that this step also fails if L1 contains only whitespace or is empty.
Else, return
| Outcome | Passed |
|---|---|
| Testcase | SC3-1-1-html |
| ID | SC3-1-1-html-pass1 |