Attributes are not duplicated

  • Rule Typeatomic
  • Rule ID: e6952f
  • Last modified: Aug 21, 2019
  • Accessibility Requirements Mapping
    • 4.1.1 Parsing (Level: A)
      • Learn More about 4.1.1 (Parsing)
      • Required for conformance to WCAG 2.0 and above on level A and above
      • Outcome mapping:
        • Any failed outcomes: not satisfied
        • All passed outcomes: further testing is needed
        • An inapplicable outcome: further testing is needed
  • Input Aspects

Description

This rule checks that HTML and SVG starting tags do not contain duplicated attributes.

Applicability

The 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.

Assumptions

There are currently no assumptions.

Accessibility Support

There are no major accessibility support issues known for this rule.

Background

Test Cases

Passed

Passed Example 1

No attributes are duplicated.

<img src="image.jpg" alt="" />

Passed Example 2

No attributes, therefore no attributes are duplicated.

<br />

Passed Example 3

Empty attributes, no attributes are duplicated.

<input type="checkbox" disabled readonly />

Passed Example 4

SVG, no attributes are duplicated.

<svg>
	<line x1="0" y1="0" x2="200" y2="200" style="stroke-width:2" />
</svg>

Passed Example 5

Script, no attributes are duplicated. HTML or SVG code within a script should be ignored.

<script>
	var foo = '<img src="image.jpg" alt="" alt="image" />'
</script>

Failed

Failed Example 1

At least one attribute is duplicated.

<img src="image.jpg" alt="" alt="image" />

Failed Example 2

Empty attributes, at least one attribute is duplicated.

<input type="checkbox" disabled="disabled" disabled readonly />

Failed Example 3

SVG, at least one attribute is duplicated.

<svg>
	<line x1="0" y1="0" x1="200" y1="200" style="stroke-width:2" />
</svg>

Inapplicable

Inapplicable Example 1

Code is XML, and not HTML or SVG.

<?xml version="1.0" encoding="UTF-8"?>
<earl:TestResult rdf:about="#result"></earl>

Inapplicable Example 2

Code is JavaScript, and not HTML or SVG.

var foo = '<img src="image.jpg" alt="" alt="image" />'

Glossary

Outcome

key: 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 three 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

Note: A rule has one passed or failed outcome for every test target. When there are no test targets the rule has one inapplicable outcome. This means that each test subject will have one or more outcomes.

Note: Implementers using the EARL10-Schema can express the outcome with the outcome property. In addition to passed, failed and inapplicable, EARL 1.0 also defined an incomplete outcome. While this cannot be the outcome of an ACT Rule when applied in its entirety, it often happens that rules are only partially evaluated. For example, when applicability was automated, but the expectations have to be evaluated manually. Such "interim" results can be expressed with the incomplete outcome.


Changelog

Aug 21, 2019fix: update links to WCAG21 resources (#776)
Jul 2, 2019chore: Correct various typos (#640)
May 7, 2019Template update - attributes are not duplicated (#528)
Apr 29, 2019chore: rename files and update associations (#489)
Apr 16, 2019chore: add unique id to all rules (#478)
Apr 15, 2019chore: WCAG ACT RULES CG Website Update (#437)
Nov 19, 2018Rule: SC4-1-1-unique-attrs (#332)
Jun 14, 2018FINAL: Glossary generation in rules & reverse linking in algorithms (#147)
Feb 8, 2018Add "for each selected item" line to every rule (#62)
May 4, 2017Format update (#32)
Jul 28, 2016add default author fields
Jul 27, 2016Merge branch 'jekyll' into algorithms
Jul 27, 2016simplify the rule metadata some more
Jul 27, 2016Simplify how to list criteria
Jul 24, 2016Update the remaining rules
Jul 24, 2016updated rule ref
Jul 24, 2016update spacing in rules
Jul 24, 2016Fixed test mode rename issue
May 24, 2016Removed old wiki markup
May 24, 2016Dropped test-belongs-to line
May 24, 2016Create test mode links in rules
Apr 2, 2016renamed specs dir to rules
Apr 2, 2016Insert name into spec
Apr 2, 2016cleanup
Feb 28, 2016more format updates
Feb 28, 2016First insert of specs

Useful Links



Acknowledgements