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

SC2-2-1+SC3-2-5-meta-refresh #91

Closed
annethyme opened this issue Apr 11, 2018 · 7 comments
Closed

SC2-2-1+SC3-2-5-meta-refresh #91

annethyme opened this issue Apr 11, 2018 · 7 comments
Assignees

Comments

@annethyme
Copy link
Collaborator

annethyme commented Apr 11, 2018


name: Meta-refresh no delay
description: |
This rule checks that the meta element is not used for delayed redirecting or refreshing.

success_criterion:

  • 2.2.1 # Timing Adjustable
  • 3.2.5 # Change on Request

test_aspects:

  • DOM Tree

authors:

  • Anne Thyme Nørregaard

Test procedure

Applicability

The rule applies to any content attribute in a meta element that contains the http-equiv attribute with value "refresh" (case-insensitive).

Expectation

The value before the first semicolon or comma (representing seconds) of the value of the content attribute is not a number greater than 0.

Note: Semi-colon or comma is optional in the content attribute. When none is present, the value of the attribute should be considered as a whole. See meta-refresh for parsing instructions.

Assumptions

  • This test assumes no functionality was provided by the website for the user to adjust the timer.

Accessibility Support

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

Background

  • H76: Using meta refresh to create an instant client-side redirect
  • F40: Failure of Success Criterion 2.2.1 and 2.2.4 due to using meta redirect with a time limit
  • F41: Failure of Success Criterion 2.2.1, 2.2.4, and 3.2.5 due to using meta refresh with a time-out

Test Cases

Passed

  <head>           
    <meta http-equiv="refresh" content="0; URL='https://auto-wcag.github.io/auto-wcag/'" />    
  </head>  
  <head>           
    <meta http-equiv="refresh" content="foo; URL='https://auto-wcag.github.io/auto-wcag/'" />    
  </head>  
<head>
<meta http-equiv=refresh content=" -00.12 foo">
</head>
<head>
<meta http-equiv="refresh" content="; 30">
</head>

Failed

<head>
<meta http-equiv="refresh" content="30">
</head>
<head>
<meta http-equiv="refresh" content="30; URL='https://auto-wcag.github.io/auto-wcag/'">
</head>

Inapplicable

<head>
<meta http-equiv="refresh">
</head>
<head>
<meta http-equiv="">
</head>
<head>
<meta content="30">
</head>
<head>
<meta>
</head>
@annethyme
Copy link
Collaborator Author

@jribbens
Copy link
Collaborator

Parsing the number needs to be more specific I think. The HTML 5 spec is pretty lax about what is allowed. e.g. <meta http-equiv=refresh content=" -00.12 foo"> should probably fail. I would suggest searching for ^\s*[+-]?([0-9]+) and if there is a match and there are no non-zero digits in the group then it's a fail. https://www.w3.org/TR/html51/document-metadata.html#statedef-http-equiv-refresh

@WilcoFiers
Copy link
Member

Agreed. We maybe should have this point to the parser in the HTML spec.

I think this needs a few more test cases:

  • Non-numeric value in content
  • No http-equiv attribute
  • No "refresh" value in the http-equiv attribute

@annethyme
Copy link
Collaborator Author

@jribbens: We have tried to factor in your comment into the Expectation, but with the new ACT Rules Format, the Expectations have to be written in plain (though unambiguous) language. I hope we succeeded here. Your example has been added as a test case.

@WilcoFiers: Test cases updated with your suggestions.

@jribbens
Copy link
Collaborator

@annethyme My example was an example of a fail, not a pass, and it didn't contain a comma. The expectation should probably not be mentioning commas or semicolons as they are not relevant (even your own example of "30" has no punctuation).

@WilcoFiers
Copy link
Member

@jribbens This content=" -00.12" should pass, since this is treated as 0 by the browser.

@annethyme annethyme changed the title SC2-2-1-client-side-refresh SC2-2-1+SC3-2-5-meta-refresh Apr 30, 2018
@annethyme
Copy link
Collaborator Author

Pull request created: #111

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

4 participants