Sc3 1 2 Lang

Created by: Annika Nietzio

Description

This test checks that lang attributes within the body of a web page are correct.

Background

Assumptions

Test properties

Property Value
Test name Languages within the body
Success Criterion 3.1.2 Language of Parts
Test mode Automatic
Test environment DOM
Test subject Single web page

Test procedure

Selector

Test mode: automatic

descendent-or-self::body[@lang]

This test is applied to all elements with lang attribute in the body of the web page (including the body element itself).

Step 1

Test mode: automatic

L1 = value of lang attribute.

Compare L1 to BCP 47.

If L1 is not on the list, return

Outcome Failed
Testcase SC312-lang
ID SC312-lang-fail1
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 SC312-lang
ID SC312-lang-pass1