Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule: SC4-1-1-unique-attrs #328

Closed
WilcoFiers opened this issue Oct 29, 2018 · 2 comments
Closed

New rule: SC4-1-1-unique-attrs #328

WilcoFiers opened this issue Oct 29, 2018 · 2 comments

Comments

@WilcoFiers
Copy link
Member

WilcoFiers commented Oct 29, 2018


name: attributes are not duplicated
rule_type: atomic
description: |
This rule checks that HTML and SVG starting tags do not contain duplicated attributes.

success_criterion:

  • 4.1.1 # Parsing

test_aspects:

  • Source code

authors:

  • Wilco Fiers
  • Emma Pratt Richens

Applicability

The rule applies to any starting tag in an HTML or SVG file.

Note: This rule cannot be tested on the DOM Tree because the browser ignores duplicated attributes.

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 an HTML or SVG document.

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

Inapplicable example 2

Code is JavaScript, and not an HTML or SVG document.

var foo = '<img src="image.jpg" alt="" alt="image" />'
@WilcoFiers
Copy link
Member Author

Source code

A set of instructions and statements to be interpreted by a computer. Each source code file has a file type. The method for determining file type depends on the method through which the file is loaded.

@EmmaJP EmmaJP mentioned this issue Oct 30, 2018
6 tasks
@EmmaJP
Copy link
Collaborator

EmmaJP commented Oct 30, 2018

Resolved by pull request #332

@EmmaJP EmmaJP closed this as completed Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants