Proposed Attribute is not duplicated
Deprecated
This rule has been deprecated because success criterion 4.1.1 has been removed in WCAG 2.2 and for WCAG 2.1 and 2.0 should be considered to always pass.
Description
This rule checks that HTML and SVG starting tags do not contain duplicated attributes.
Applicability
This rule applies to any starting tag in an HTML or SVG document.
Note: This rule cannot be tested on the DOM Tree because the browser removes duplicates of any attribute that is already present on an element.
Expectation
For each test target, there are no duplicated attributes.
Background
Assumptions
There are no assumptions.
Accessibility Support
There are no accessibility support issues known.
Other Resources
Accessibility Requirements Mapping
4.1.1 Parsing (Level A)
- Learn more about 4.1.1 Parsing
- Required for conformance to WCAG 2.0 and later on level A and higher.
- Outcome mapping:
- Any
failedoutcomes: success criterion is not satisfied - All
passedoutcomes: success criterion needs further testing - An
inapplicableoutcome: success criterion needs further testing
- Any
H94: Ensuring that elements do not contain duplicate attributes
- Learn more about technique H94
- Not required for conformance to any W3C accessibility recommendation.
- Outcome mapping:
- Any
failedoutcomes: technique is not satisfied - All
passedoutcomes: technique is satisfied - An
inapplicableoutcome: technique is satisfied
- Any
Input Aspects
The following aspects are required in using this rule.
Examples
Passed
Passed Example 1
This img element contains no duplicated attributes.
<img src="/test-assets/shared/w3c-logo.png" alt="W3C logo" />
Passed Example 2
This br element contains no attributes, so there is no duplicated attribute.
<br />
Passed Example 3
This input element contains three different attributes, two of them being empty.
<input type="checkbox" disabled readonly />
Passed Example 4
This SVG element contains no attributes.
<svg>
<line x1="0" y1="0" x2="200" y2="200" style="stroke-width:2" />
</svg>
Passed Example 5
This script element contains duplicated attributes, but they are ignored because they are placed within the script tag.
<script>
var foo = '<img src="/test-assets/shared/w3c-logo.png" alt="" alt="W3C logo" />'
</script>
Failed
Failed Example 1
This img element contains a duplicated alt attribute.
<img src="/test-assets/shared/w3c-logo.png" alt="" alt="W3C logo" />
Failed Example 2
This input element contains a duplicate disabled attribute.
<input type="checkbox" disabled="disabled" disabled readonly />
Failed Example 3
This line element contains duplicate x1 and duplicate y1 attributes.
<svg>
<line x1="0" y1="0" x1="200" y1="200" style="stroke-width:2" />
</svg>
Inapplicable
Inapplicable Example 1
This code is XML, not HTML or SVG.
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:earl="http://www.w3.org/ns/earl#">
<earl:TestResult rdf:about="#result"></earl:TestResult>
</rdf:RDF>
Inapplicable Example 2
This code is JavaScript, not HTML or SVG.
var foo = '<img src="/test-assets/shared/w3c-logo.png" alt="W3C logo" />'
Glossary
Outcome
A conclusion that comes from evaluating an ACT Rule on a test subject or one of its constituent test target. An outcome can be one of the five following types:
- Inapplicable: No part of the test subject matches the applicability
- Passed: A test target meets all expectations
- Failed: A test target does not meet all expectations
- cantTell: Whether the rule is applicable, or not all expectations were met could not be fully determined by the tester.
- Untested: The tester has not attempted to evaluate the test subject.
Note: A rule has one passed or failed outcome for every test target. When a tester evaluates a test target it can also be reported as cantTell if the rule cannot be tested in its entirety. For example, when applicability was automated, but the expectations have to be evaluated manually.
When there are no test targets the rule has one inapplicable outcome. If the tester is unable to determine whether there are test targets there will be one cantTell outcome. And when no evaluation has occurred the test target has one untested outcome. This means that each test subject always has one or more outcomes.
Outcomes used in ACT Rules can be expressed using the outcome property of the EARL10-Schema.
Rule Versions
This is the first version of this ACT rule.