Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Siteimprove/alfa
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/Siteimprove/alfa:
  Correctly account for whitespace
  Include declaration diagnostics
  Improve Jasmine error messages
  Add test case for `<template>` tag
  Adjust argument name
  Adjust some ARIA roles
  No need for a `WeakMap`
  Add missing files to TypeScript configs
  Lint files
  Move some doc files around
  Update dependencies
  Closes #57: Adding support for AnB Microsyntax (#131)
  README updates
  Update README.md
  Closes #78: Generate TODO.md from @todo (and similar) comments (#125)
  Closes #132: Added a few tests regarding the svg aria mappings (#133)
  Closes #112: Implement ARIA role mappings for SVG (#129)
  • Loading branch information
kasperisager committed Aug 9, 2019
2 parents bbeddc2 + b8d57e8 commit 83da929
Show file tree
Hide file tree
Showing 256 changed files with 3,402 additions and 1,174 deletions.
File renamed without changes.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Alfa is an open and standards-based accessibility conformance testing engine used for testing websites built using HTML, CSS, and JavaScript against accessibility standards such as the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG/). It is the result of distilling the best parts of Siteimprove's proprietary accessibility conformance testing engine and implementing them on top of the open [Accessibility Conformance Testing (ACT) Rules Format](https://www.w3.org/TR/act-rules-format/). In comparison to Siteimprove's proprietary engine, Alfa also brings several improvements that make it possible to implement and execute advanced rules without relying on Siteimprove infrastructure.

> :warning: Alfa is still in the very early stages of development. Nothing is final, nothing is published, and breaking API changes are swift and unforgiving. You should however not let it deter you from exploring the project and some of the new ideas we're trying to bring to the table.
> :warning: Alfa is still in the early stages of development. Nothing is final, nothing is published, and breaking API changes are swift and unforgiving. You should however not let it deter you from exploring the project and some of the new ideas we're trying to bring to the table.
## Contents

Expand All @@ -27,7 +27,7 @@ Alfa is an open and standards-based accessibility conformance testing engine use

- Alfa is committed to complete transparency on how test results came to be. Every line of code that has the potential to influence test results will therefore always reside within Alfa itself and never with a third-party. However, this does not mean that Alfa does not rely on third-party dependencies, only that there are limitations to what third-party dependencies may be used for.

- Alfa wants to foster a thriving ecosystem with people from many different backgrounds contributing where they can. To this end, high-quality documentation is paramount to the success of Alfa. Picking up and contributing to any one of the many subsystems within Alfa should be a straightforward experience with every subsystem clearly stating its purpose and structure.
- Alfa wants to foster a thriving ecosystem with people from many different backgrounds contributing where they can. To this end, high-quality documentation is paramount to the success of Alfa. Picking up and contributing to any one of the many subsystems within Alfa should be a straightforward experience with every subsystem clearly stating its purpose and structure. **This goal is currently far from met and will be prioritised**.

## Usage

Expand All @@ -37,6 +37,8 @@ Alfa is distributed as a set of separate packages that can be installed via your
$ npm install @siteimprove/alfa-<package-name>
```

> :warning: As Alfa is still at a pre-alpha level of stability, no packages have been published. The above command will therefore not work _yet_.
On their own, each of these packages do very little, but when put together they provide a full suite of tools for performing accessibility comformance testing across all stages of the content development and publication workflow. If you are looking for an easy way to started using Alfa, check out the section on [integrations](#integrations); we might already have a ready-made solution for you!

At a high level, Alfa consumes implementations of rules specified in the [Accessibility Conformance Testing (ACT) Rules Format](https://www.w3.org/TR/act-rules-format/) and produces audit results in the [Evaluation and Report Language (EARL) Schema](https://www.w3.org/TR/EARL10-Schema/) encoded as [JSON-LD](https://www.w3.org/TR/json-ld/). More often than not, your only interaction with Alfa will look similar to this:
Expand Down
38 changes: 38 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## [@siteimprove/alfa-css](packages/alfa-css)

### @todo

- [src/properties/text-decoration/color/property.ts:21](packages/alfa-css/src/properties/text-decoration/color/property.ts#L21): Should be currentColor when supported in colorGrammar

## [@siteimprove/alfa-dom](packages/alfa-dom)

### @todo

- [src/is-rendered.ts:19](packages/alfa-dom/src/is-rendered.ts#L19): Handle `display: contents` once it gains wider support.

## [@siteimprove/alfa-aria](packages/alfa-aria)

### @todo

- [src/features/html/th.ts:6](packages/alfa-aria/src/features/html/th.ts#L6): Need to handle the auto state
- [src/features/svg/a.ts:21](packages/alfa-aria/src/features/svg/a.ts#L21): In certain rare circumstances the role will in this case be group. Investigate.
- [src/features/svg/circle.ts:10](packages/alfa-aria/src/features/svg/circle.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate.
- [src/features/svg/ellipse.ts:10](packages/alfa-aria/src/features/svg/ellipse.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate.
- [src/features/svg/foreign-object.ts:10](packages/alfa-aria/src/features/svg/foreign-object.ts#L10): In certain rare circumstances the role will in this case be group. Investigate.
- [src/features/svg/g.ts:10](packages/alfa-aria/src/features/svg/g.ts#L10): In certain rare circumstances the role will in this case be group. Investigate.
- [src/features/svg/image.ts:10](packages/alfa-aria/src/features/svg/image.ts#L10): In certain rare circumstances the role will in this case be group. Investigate.
- [src/features/svg/line.ts:10](packages/alfa-aria/src/features/svg/line.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate.
- [src/features/svg/mesh.ts:10](packages/alfa-aria/src/features/svg/mesh.ts#L10): In certain rare circumstances the role will in this case be img. Investigate.
- [src/features/svg/path.ts:10](packages/alfa-aria/src/features/svg/path.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate.
- [src/features/svg/polygon.ts:10](packages/alfa-aria/src/features/svg/polygon.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate.
- [src/features/svg/polyline.ts:10](packages/alfa-aria/src/features/svg/polyline.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate.
- [src/features/svg/rect.ts:10](packages/alfa-aria/src/features/svg/rect.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate.
- [src/features/svg/symbol.ts:10](packages/alfa-aria/src/features/svg/symbol.ts#L10): In certain rare circumstances the role will in this case be graphics-object. Investigate.
- [src/features/svg/text-path.ts:10](packages/alfa-aria/src/features/svg/text-path.ts#L10): In certain rare circumstances the role will in this case be group. Investigate.
- [src/features/svg/tspan.ts:10](packages/alfa-aria/src/features/svg/tspan.ts#L10): In certain rare circumstances the role will in this case be group. Investigate.
- [src/features/svg/use.ts:10](packages/alfa-aria/src/features/svg/use.ts#L10): In certain rare circumstances the role will in this case be graphics-object. Investigate.

### @bug

- [src/features/svg/text-path.ts:11](packages/alfa-aria/src/features/svg/text-path.ts#L11): There is an open issue regarding the role mapping for textPath
- [src/features/svg/tspan.ts:11](packages/alfa-aria/src/features/svg/tspan.ts#L11): There is an open issue regarding the role mapping for tspan
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions docs/examples/component-testing/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
]
},
"dependencies": {
"@angular/common": "^7.2.15",
"@angular/compiler": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/common": "^8.2.0",
"@angular/compiler": "^8.2.0",
"@angular/core": "^8.2.0",
"@angular/platform-browser": "^8.2.0",
"@angular/platform-browser-dynamic": "^8.2.0",
"core-js": "^3.1.1",
"rxjs": "^6.5.2",
"zone.js": "^0.8.26"
"zone.js": "^0.9.1"
},
"devDependencies": {
"@siteimprove/alfa-angular": "^0.0.0",
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
"devDependencies": {
"@types/node": "^12.0.2",
"@types/prettier": "^1.16.1",
"axios": "^0.18.0",
"axios": "^0.19.0",
"chalk": "^2.4.2",
"gaze": "^1.1.3",
"husky": "^2.3.0",
"husky": "^3.0.2",
"ignore": "^5.0.5",
"prettier": "1.17.1",
"prettier": "1.18.2",
"pretty-ms": "^5.0.0",
"source-map": "^0.7.3",
"source-map-support": "^0.5.10",
Expand Down
4 changes: 2 additions & 2 deletions packages/alfa-act/src/sort-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function sortRules<A extends Aspect, T extends Target>(
): Iterable<Rule<A, T>> {
const result: Array<Rule<A, T>> = [];

const indegrees = new WeakMap<Rule<A, T>, number>();
const indegrees = new Map<Rule<A, T>, number>();

for (const rule of rules) {
if (isComposite(rule)) {
Expand All @@ -29,7 +29,7 @@ export function sortRules<A extends Aspect, T extends Target>(
}
}

const leaves = Array.from(rules).filter(rule => !indegrees.has(rule));
const leaves = [...rules].filter(rule => !indegrees.has(rule));

let next = leaves.pop();

Expand Down
4 changes: 2 additions & 2 deletions packages/alfa-act/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type Aspect = Aspects[keyof Aspects];
* type.
*/
export type AspectKeysFor<A extends Aspect> = {
readonly [P in keyof Aspects]: Aspects[P] extends A ? P : never
readonly [P in keyof Aspects]: Aspects[P] extends A ? P : never;
}[keyof Aspects];

/**
Expand Down Expand Up @@ -181,7 +181,7 @@ export interface Locale {
readonly [P in
| Outcome.Passed
| Outcome.Failed
| Outcome.CantTell]?: Message
| Outcome.CantTell]?: Message;
};
};
readonly questions?: {
Expand Down
4 changes: 2 additions & 2 deletions packages/alfa-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"src/**/*.d.ts"
],
"dependencies": {
"@angular/core": "^7.2.15",
"@angular/core": "^8.2.0",
"@siteimprove/alfa-chai": "^0.0.0",
"@siteimprove/alfa-dom": "^0.0.0",
"@siteimprove/alfa-jasmine": "^0.0.0",
"@siteimprove/alfa-jest": "^0.0.0",
"@siteimprove/alfa-unexpected": "^0.0.0",
"rxjs": "^6.5.2",
"zone.js": "^0.8.29"
"zone.js": "^0.9.1"
},
"devDependencies": {
"@siteimprove/alfa-test": "^0.0.0"
Expand Down
115 changes: 4 additions & 111 deletions packages/alfa-aria/src/features.ts
Original file line number Diff line number Diff line change
@@ -1,111 +1,4 @@
export * from "./features/a";
export * from "./features/abbr";
export * from "./features/address";
export * from "./features/area";
export * from "./features/article";
export * from "./features/aside";
export * from "./features/audio";
export * from "./features/b";
export * from "./features/base";
export * from "./features/bdi";
export * from "./features/bdo";
export * from "./features/blockquote";
export * from "./features/body";
export * from "./features/br";
export * from "./features/button";
export * from "./features/canvas";
export * from "./features/caption";
export * from "./features/cite";
export * from "./features/code";
export * from "./features/col-group";
export * from "./features/col";
export * from "./features/datalist";
export * from "./features/dd";
export * from "./features/del";
export * from "./features/details";
export * from "./features/dfn";
export * from "./features/dialog";
export * from "./features/div";
export * from "./features/dl";
export * from "./features/dt";
export * from "./features/em";
export * from "./features/embed";
export * from "./features/fieldset";
export * from "./features/fig-caption";
export * from "./features/figure";
export * from "./features/footer";
export * from "./features/form";
export * from "./features/h1";
export * from "./features/h2";
export * from "./features/h3";
export * from "./features/h4";
export * from "./features/h5";
export * from "./features/h6";
export * from "./features/head";
export * from "./features/header";
export * from "./features/hr";
export * from "./features/html";
export * from "./features/i";
export * from "./features/iframe";
export * from "./features/img";
export * from "./features/input";
export * from "./features/ins";
export * from "./features/kbd";
export * from "./features/keygen";
export * from "./features/label";
export * from "./features/legend";
export * from "./features/li";
export * from "./features/link";
export * from "./features/main";
export * from "./features/map";
export * from "./features/mark";
export * from "./features/math";
export * from "./features/menu-item";
export * from "./features/menu";
export * from "./features/meta";
export * from "./features/nav";
export * from "./features/noscript";
export * from "./features/object";
export * from "./features/ol";
export * from "./features/optgroup";
export * from "./features/option";
export * from "./features/output";
export * from "./features/p";
export * from "./features/param";
export * from "./features/picture";
export * from "./features/pre";
export * from "./features/progress";
export * from "./features/q";
export * from "./features/rp";
export * from "./features/rt";
export * from "./features/ruby";
export * from "./features/s";
export * from "./features/samp";
export * from "./features/script";
export * from "./features/section";
export * from "./features/select";
export * from "./features/small";
export * from "./features/source";
export * from "./features/span";
export * from "./features/strong";
export * from "./features/style";
export * from "./features/sub";
export * from "./features/summary";
export * from "./features/sup";
export * from "./features/svg";
export * from "./features/table";
export * from "./features/tbody";
export * from "./features/td";
export * from "./features/template";
export * from "./features/textarea";
export * from "./features/tfoot";
export * from "./features/th";
export * from "./features/thead";
export * from "./features/time";
export * from "./features/title";
export * from "./features/track";
export * from "./features/u";
export * from "./features/ul";
export * from "./features/var";
export * from "./features/video";
export * from "./features/wbr";
import * as HTML from "./features/html";
import * as SVG from "./features/svg";

export { HTML, SVG };
123 changes: 111 additions & 12 deletions packages/alfa-aria/src/features/html.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,111 @@
import * as Attributes from "../attributes";
import * as Roles from "../roles";
import { Feature, None } from "../types";

/**
* @see https://www.w3.org/TR/html-aria/#html
*/
export const Html: Feature = {
element: "html",
allowedRoles: () => None(Roles),
allowedAttributes: () => None(Attributes)
};
export * from "./html/a";
export * from "./html/abbr";
export * from "./html/address";
export * from "./html/area";
export * from "./html/article";
export * from "./html/aside";
export * from "./html/audio";
export * from "./html/b";
export * from "./html/base";
export * from "./html/bdi";
export * from "./html/bdo";
export * from "./html/blockquote";
export * from "./html/body";
export * from "./html/br";
export * from "./html/button";
export * from "./html/canvas";
export * from "./html/caption";
export * from "./html/cite";
export * from "./html/code";
export * from "./html/col-group";
export * from "./html/col";
export * from "./html/datalist";
export * from "./html/dd";
export * from "./html/del";
export * from "./html/details";
export * from "./html/dfn";
export * from "./html/dialog";
export * from "./html/div";
export * from "./html/dl";
export * from "./html/dt";
export * from "./html/em";
export * from "./html/embed";
export * from "./html/fieldset";
export * from "./html/fig-caption";
export * from "./html/figure";
export * from "./html/footer";
export * from "./html/form";
export * from "./html/h1";
export * from "./html/h2";
export * from "./html/h3";
export * from "./html/h4";
export * from "./html/h5";
export * from "./html/h6";
export * from "./html/head";
export * from "./html/header";
export * from "./html/hr";
export * from "./html/html";
export * from "./html/i";
export * from "./html/iframe";
export * from "./html/img";
export * from "./html/input";
export * from "./html/ins";
export * from "./html/kbd";
export * from "./html/keygen";
export * from "./html/label";
export * from "./html/legend";
export * from "./html/li";
export * from "./html/link";
export * from "./html/main";
export * from "./html/map";
export * from "./html/mark";
export * from "./html/math";
export * from "./html/menu-item";
export * from "./html/menu";
export * from "./html/meta";
export * from "./html/nav";
export * from "./html/noscript";
export * from "./html/object";
export * from "./html/ol";
export * from "./html/optgroup";
export * from "./html/option";
export * from "./html/output";
export * from "./html/p";
export * from "./html/param";
export * from "./html/picture";
export * from "./html/pre";
export * from "./html/progress";
export * from "./html/q";
export * from "./html/rp";
export * from "./html/rt";
export * from "./html/ruby";
export * from "./html/s";
export * from "./html/samp";
export * from "./html/script";
export * from "./html/section";
export * from "./html/select";
export * from "./html/small";
export * from "./html/source";
export * from "./html/span";
export * from "./html/strong";
export * from "./html/style";
export * from "./html/sub";
export * from "./html/summary";
export * from "./html/sup";
export * from "./html/svg";
export * from "./html/table";
export * from "./html/tbody";
export * from "./html/td";
export * from "./html/template";
export * from "./html/textarea";
export * from "./html/tfoot";
export * from "./html/th";
export * from "./html/thead";
export * from "./html/time";
export * from "./html/title";
export * from "./html/track";
export * from "./html/u";
export * from "./html/ul";
export * from "./html/var";
export * from "./html/video";
export * from "./html/wbr";
Loading

0 comments on commit 83da929

Please sign in to comment.