Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Repository files navigation

DEPRECATED - use accesslint.js instead


accesslint.rb Gem VersionCode Climate

Run web accessibility audits on urls or files, from the command line or within Ruby.

About

AccessLint uses the Accessibility Developer Tools javascript library to make assertions on the DOM via PhantomJS. The rules that are applied are listed below.

Installation

First, install PhantomJS (full guide). On OS X:

$ brew install phantomjs

Then install the rubygem:

$ gem install access_lint

Usage

Command Line

From the command line, specify a url or filename to be audited:

$ access_lint audit http://twitter.com # url or a path to a file
# results ...

Ruby

Run the audit from a Ruby application like so

$ irb
> require 'access_lint'
=> true
> AccessLint::Audit.new('http://twitter.com').run
=> results ...

Results Object

{
"PASS": [ # Status group
{
"element_names": ["<p class=\"foo\">relevant element</p>"], # applicable DOM elements
"severity": "WARNING", # 'WARNING' or 'SEVERE'
"status": "PASS", # 'PASS', 'FAIL', or 'NA'
"title": "Some description" # rule description
},
{ ... }
],
"NA": [ { ... } ],
"FAIL": [ { ... }]
]

Rules

For full descriptions of the audit rules, visit the Accessibility Developer Tools project wiki.

CodeTitle
AX_ARIA_01Elements with ARIA roles must use a valid, non-abstract ARIA role.
AX_ARIA_02ARIA attributes which refer to other elements by ID should refer to elements which exist in the DOM.
AX_ARIA_03Elements with ARIA roles must have all required attributes for that role.
AX_ARIA_04ARIA state and property values must be valid.
AX_ARIA_05role=main should only appear on significant elements.
AX_ARIA_06aria-owns should not be used if ownership is implicit in the DOM.
AX_ARIA_07An element's ID must not be present in more that one aria-owns attribute at any time.
AX_ARIA_08Elements with ARIA roles must ensure required owned elements are present.
AX_ARIA_09Elements with ARIA roles must be in the correct scope.
AX_ARIA_10This element has an unsupported ARIA attribute.
AX_ARIA_11This element has an invalid ARIA attribute.
AX_ARIA_12This element does not support ARIA roles, states and properties.
AX_AUDIO_01Audio elements should have controls.
AX_COLOR_01Text elements should have a reasonable contrast ratio.
AX_FOCUS_01These elements are focusable but either invisible or obscured by another element.
AX_FOCUS_02Elements with onclick handlers must be focusable.
AX_FOCUS_03Avoid positive integer values for tabIndex.
AX_HTML_01The web page should have the content's human language indicated in the markup.
AX_HTML_02An element's ID must be unique in the DOM.
AX_IMAGE_01Meaningful images should not be used in element backgrounds.
AX_TEXT_01Controls and media elements should have labels.
AX_TEXT_02Images should have an alt attribute.
AX_TEXT_04The purpose of each link should be clear from the link text.
AX_TITLE_01The web page should have a title that describes topic or purpose.
AX_VIDEO_01Video elements should use elements to provide captions.

Roadmap

Visit the project backlog: https://www.pivotaltracker.com/s/projects/985186.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

[use www.accesslint.com instead - this library is no longer maintained]

Resources

Stars

162 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages