Technique F70:Failure of Success Criterion 4.1.1 due to incorrect use of start and end tags or attribute markup
Applicability
Markup languages: HTML, XHTML, and other SGML or XML-based technologies.
This technique relates to 4.1.1: Parsing (Obsolete and removed) (Failure).
Description
The objective of this failure is to identify examples of markup errors in element tags that could cause assistive technology to be unable to generate a satisfactory model of the page. Different user agents may implement different heuristics to recover from errors, resulting in inconsistent presentations of the page between user agents.
Some common types of problems with start and end tags that lead to this failure condition (though this is not an exhaustive list):
- Opening and closing tags that are missing the opening < and closing > brackets.
- Closing tag missing the initial / to indicate it is a closing tag.
- Attribute values that have an opening quote but not a closing quote. Attribute values must be either fully quoted or, in some markup languages, may be unquoted.
- Lack of whitespace between attributes.
- Unquoted attribute values that have whitespace in the value.
- Failure to provide a closing element tag for elements that do not accept empty-element syntax.
Examples
Example 1: Missing angle brackets in XHTML
The following code fails because the opening tag is missing an angle bracket, and the intended boundary of the tag is unclear.
<p This is a paragraph</p>
Example 2: Missing slash on closing tag in XHTML
The following code fails because the closing tag is missing the slash, making it look like it is in fact another opening tag.
<p>This is a paragraph<p>
Example 3: Unbalanced attribute quoting
The following code fails because the attribute value is missing the closing quote, which makes the boundary of the attribute-value pair unclear.
<input title="name type="text">
Example 4: Lack of whitespace between attributes
The following code fails because the there is not whitespace between attributes, which makes the boundary between attribute-value pairs unclear.
<input title="name"type="text">
Example 5: Unquoted attribute with whitespace value
The following code fails because an attribute value is not quoted and contains whitespace, which makes the boundary of the attribute-value pair unclear.
<input title=Enter name here type=text>
Example 6: Missing end tags in XHTML
The following code fails because the closing tag of the first paragraph is missing, making it unclear whether the second paragraph is a child or sibling of the first.
<p>This is a paragraph <p>This is another paragraph</p>
Tests
Procedure
- Check the source code of pages implemented in markup languages.
- Check whether any opening tags, closing tags or attributes are malformed.
Expected Results
- If check #2 is true, then the failure condition applies and the content does not meet this Success Criterion.