Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into #149
Browse files Browse the repository at this point in the history
Conflicts:
	dist/js/axs_testing.js - reverted to master branch file
  • Loading branch information
davidhsv committed Jun 13, 2015
2 parents dc66bb7 + c4f8e2d commit 715c1e6
Show file tree
Hide file tree
Showing 13 changed files with 583 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ extension/Handlebar.js
upload.py
gen/
node_modules/
.tmp/
66 changes: 66 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
### Enhancements:
* Rework findTextAlternatives not to return non-exposed text alternatives.
* Add Bower config (#157)

### Bug fixes:
* Check for any text alternatives when assessing unlabeled images (#154).

## 2.7.0 - 2015-05-15

### New rules
* This element does not support ARIA roles, states and properties (`src/audits/AriaOnReservedElement.js`)
* aria-owns should not be used if ownership is implicit in the DOM (`src/audits/AriaOwnsDescendant.js`)
* Elements with ARIA roles must be in the correct scope (`src/audits/AriaRoleNotScoped.js`)
* An element's ID must be unique in the DOM (`src/audits/DuplicateId.js`)
* The web page should have the content's human language indicated in the markup (`src/audits/HumanLangMissing.js`)
* An element's ID must not be present in more that one aria-owns attribute at any time (`src/audits/MultipleAriaOwners.js`)
* ARIA attributes which refer to other elements by ID should refer to elements which exist in the DOM (`src/audits/NonExistentAriaRelatedElement.js` - previously `src/audits/NonExistentAriaLabeledBy.js`)
* Elements with ARIA roles must ensure required owned elements are present (`src/audits/RequiredOwnedAriaRoleMissing.js`)
* Avoid positive integer values for tabIndex (`src/audits/TabIndexGreaterThanZero.js`)
* This element has an unsupported ARIA attribute (`src/audits/UnsupportedAriaAttribute.js`)

### Enhancements:
* Add configurable blacklist phrases and stop words to LinkWithUnclearPurpose (#99)
* Detect and warn if we reuse the same code for more than one rule. (#133)
* Force focus before testing visibility on focusable elements. (#65)
* Use getDistributedNodes to get nodes distributed into shadowRoots (#128)
* Add section to Audit Rules page for HumanLangMissing and link to it from rule (#119)
* Reference "applied role" in axs.utils.getRoles enhancement (#130)
* Add warning that AX_FOCUS_02 is not available from axs.Audit.run() (#85)

### Bug fixes:
* Incorrect use of nth-of-type against className in utils.getQuerySelectorText (#87)
* AX_TEXT_01 Accessibility Audit test should probably ignore role=presentation elements (#97)
* Fix path to audit rules in phantomjs runner (#108)
* Label audit should fail if form fields lack a label, even with placeholder text (#81)
* False positives for controls without labels with role=presentation (#23)
* Fix "valid" flag on return value of axs.utils.getRoles (#131)

Note: this version number is somewhat arbitrary - just bringing it vaguely in line with [the extension](https://github.com/GoogleChrome/accessibility-developer-tools-extension) since that's where the library originated - but will use semver for version bumps going forward from here.

## 0.0.5 - 2014-02-04

### Enhancements:
* overlapping elements detection code made more sophisticated
* axs.properties.getFocusProperties() returns more information about visibility
* new axs.properties.hasDirectTextDescendant() method with more sophisticated detection of text content

### Bug fixes:
* FocusableElementNotVisibleAndNotAriaHidden audit passes on elements which are brought onscreen on focus
* UnfocusableElementsWithOnclick checks for element.disabled
* Fix infinite loop when getting descendant text content of a label containing an input
* Detect elements which are out of scroll area of any parent element, not just the document scroll area
* findTextAlternatives doesn't throw TypeError if used on a HTMLSelectElement

## 0.0.4 - 2013-10-03

### Enhancements:

* axs.AuditRule.run() has a new signature: it now takes an options object. Please see method documentation for details.
* Audit Rule severity can be overridden (per Audit Rule) in AuditConfig.

### Bug fixes:

* axs.utils.isLowContrast() now rounds to the nearest 0.1 before checking (so `#777` is now a passing value)
* MainRoleOnInappropriateElement was always failing due to accessible name calculation taking the main role into account and not descending into content (now just gets descendant content directly)
* UnfocusableElementsWithOnClick had a dangling if-statement causing very noisy false positives
247 changes: 202 additions & 45 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,205 @@
'use strict';

module.exports = function(grunt) {
'use strict';

require('load-grunt-tasks')(grunt);

grunt.initConfig({
'git-describe': {
options: {
pkg: grunt.file.readJSON('package.json'),
changelog: 'Changelog.md',

'gh-release': {},

},
'run': {}
},
closurecompiler: {
minify: {
requiresConfig: 'git-revision',
files: {
"gen/axs_testing.js": [
"./lib/closure-library/closure/goog/base.js",
"./src/js/axs.js",
"./src/js/BrowserUtils.js",
"./src/js/Constants.js",
"./src/js/AccessibilityUtils.js",
"./src/js/Properties.js",
"./src/js/AuditRule.js",
"./src/js/AuditRules.js",
"./src/js/AuditResults.js",
"./src/js/Audit.js",
"./src/audits/*"
'.tmp/build/axs_testing.js': [
'./lib/closure-library/closure/goog/base.js',
'./src/js/axs.js',
'./src/js/BrowserUtils.js',
'./src/js/Constants.js',
'./src/js/AccessibilityUtils.js',
'./src/js/Properties.js',
'./src/js/AuditRule.js',
'./src/js/AuditRules.js',
'./src/js/AuditResults.js',
'./src/js/Audit.js',
'./src/audits/*'
]
},
options: {
"language_in": "ECMASCRIPT5",
"formatting": "PRETTY_PRINT",
"summary_detail_level": 3,
"warning_level": "VERBOSE",
"compilation_level": "SIMPLE_OPTIMIZATIONS",
"output_wrapper": "<%= grunt.file.read('scripts/output_wrapper.txt') %>",
"externs": "./src/js/externs/externs.js"
'language_in': 'ECMASCRIPT5',
'formatting': 'PRETTY_PRINT',
'summary_detail_level': 3,
'warning_level': 'VERBOSE',
'compilation_level': 'SIMPLE_OPTIMIZATIONS',
'output_wrapper': "<%= grunt.file.read('scripts/output_wrapper.txt') %>",
'externs': './src/js/externs/externs.js'
}
}
},

qunit: {
all: ['test/index.html']
},

copy: {
dist: {
expand: true,
cwd: '.tmp/build',
src: '**/*',
dest: 'dist/js'
}
},

clean: {
all: ['.tmp', 'dist']
},

bump: {
options: {
prereleaseName: 'rc',
files: ['package.json', 'bower.json'],
updateConfigs: ['pkg'],
pushTo: "<%= grunt.config.get('gh-release.remote') %>",
commitFiles: ['package.json', "<%= grunt.config.get('changelog') %>", 'bower.json', 'dist']
}
},

coffee: {
compile: {
files: {
'.tmp/util/gh_repo.js': 'src/util/gh_repo.coffee'
}
}
},

prompt: {
'gh-release': {
options: {
questions: [
{
config: 'gh-release.remote',
type: 'input',
message: 'Git Remote (usually upstream or origin)',
default: 'upstream',
validate: function(val) {
return (grunt.util._.size(val) > 0);
}
},
{
config: 'gh-release.repo',
type: 'input',
message: 'Github Repository',
default: 'GoogleChrome/accessibility-developer-tools',
validate: function(val) {
return (grunt.util._.size(val) > 0);
}
},
{
config: 'gh-release.username',
type: 'input',
message: 'Github Username',
validate: function(val) {
return (grunt.util._.size(val) > 0);
}
},
{
config: 'gh-release.password',
type: 'password',
message: 'Github Password or Token',
validate: function(val) {
return (grunt.util._.size(val) > 0);
}
}
]
}
}
}
});

grunt.loadNpmTasks('grunt-closurecompiler');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.registerTask('changelog', function(type) {
grunt.task.requires('bump-only:' + type);

grunt.registerTask('git-describe', function() {
var _spawn = require("grunt-util-spawn")(grunt);
var config = {
data: {
version: grunt.config.get('pkg.version'),
releaseDate: grunt.template.today("yyyy-mm-dd")
}
};

var stopRegex = /^\#\#\ [0-9]+.*$/m;
var stopIndex = 0;
var releaseNotes = '';
var dest = grunt.config.get('changelog');
var contents = grunt.file.read(dest);
var headerTpl = "## <%= version %> - <%= releaseDate %>\n\n";
var header = grunt.template.process(headerTpl, config);

if (contents.length > 0) {
if ((stopIndex = contents.search(stopRegex)) !== -1) {
releaseNotes = contents.slice(0, stopIndex);
}
}

grunt.config.set("gh-release.release-notes", releaseNotes);

grunt.file.write(dest, "" + header + contents);
grunt.log.ok("Changelog updated, and release notes extracted.");
});

grunt.registerTask('gh-release', function() {
// Compile and load GH Repo manager.
grunt.task.requires('coffee:compile');
var GHRepo = require('./.tmp/util/gh_repo');

var done = this.async();
var config = grunt.config.get('gh-release');
var pkg = grunt.config.get('pkg');
var currentRelease = 'v' + pkg.version;
var nextRelease = currentRelease.replace(/-rc\.[0-9]+/, '');
var repo = new GHRepo(config);
repo.log = function() { grunt.log.writeln.apply(grunt, arguments); };

var payload = {
tag_name: currentRelease,
name: nextRelease,
body: config['release-notes'],
draft: true
};

grunt.log.writeln("Searching for existing GH release:", nextRelease);
repo.getReleaseByName(nextRelease)
.then(function(release) {
if (release) {
payload.body += "\n" + release.body;
repo.updateRelease(release, payload).then(function() {
grunt.log.ok('Github release ' + nextRelease + ' updated successfully.');
done();
});
} else {
repo.createRelease(payload).then(function() {
grunt.log.ok('Github release ' + nextRelease + ' created successfully');
done();
});
}
})
.catch(function(err) {
throw err;
});
});

grunt.registerTask('git-describe', function() {
// Start async task
var done = this.async();

_spawn({
"cmd" : "git",
"args" : [ "rev-parse", "HEAD" ],
"opts" : {
"cwd" : "."
grunt.util.spawn({
'cmd' : 'git',
'args' : [ 'rev-parse', 'HEAD' ],
'opts' : {
'cwd' : '.'
}
}, function(err, result) {
}, function(err, result) {
if (err) {
grunt.log.error(err).verbose.error(result);
done();
Expand All @@ -69,20 +211,35 @@ module.exports = function(grunt) {
});
});

grunt.registerTask('release', function(releaseType) {
if (typeof releaseType === 'undefined' || releaseType === null) {
grunt.fail.fatal('You must specify a release type. i.e. grunt release:prerelease');
}

grunt.task.run([
'prompt:gh-release',
'build',
'test:unit',
'copy:dist',
'bump-only:' + releaseType,
'changelog:' + releaseType,
'bump-commit',
'coffee:compile',
'gh-release'
]);
});

grunt.registerTask('save-revision', function() {
grunt.event.once('git-describe', function (rev) {
grunt.log.writeln("Git Revision: " + rev);
grunt.log.writeln('Git Revision: ' + rev);
grunt.config.set('git-revision', rev);
});
grunt.task.run('git-describe');
});

grunt.registerTask('copy-dist', function() {
grunt.file.copy('gen/axs_testing.js', 'dist/js/axs_testing.js');
});

grunt.registerTask('default', ['save-revision', 'closurecompiler:minify', 'qunit']);
grunt.registerTask('build', ['default', 'copy-dist']);
grunt.registerTask('travis', ['closurecompiler:minify', 'qunit']);
grunt.registerTask('build', ['clean:all', 'save-revision', 'closurecompiler:minify']);
grunt.registerTask('test:unit', ['qunit']);
grunt.registerTask('dist', ['build', 'copy:dist']);
grunt.registerTask('travis', ['closurecompiler:minify', 'test:unit']);
grunt.registerTask('default', ['build', 'test:unit']);
};

29 changes: 29 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "accessibility-developer-tools",
"version": "2.7.0",
"homepage": "https://github.com/GoogleChrome/accessibility-developer-tools",
"authors": [
"Google"
],
"description": "This is a library of accessibility-related testing and utility code.",
"main": "dist/js/axs_testing.js",
"moduleType": [
"globals"
],
"keywords": [
"accessibility",
"testing",
"WCAG"
],
"license": "Apache License 2.0",
"ignore": [
"**/.*",
"lib",
"scripts",
"src",
"test",
"tools",
"Gruntfile.js",
"package.json"
]
}
Empty file removed dist/js/.gitkeep
Empty file.
Loading

0 comments on commit 715c1e6

Please sign in to comment.