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

Closes #112: Implement ARIA role mappings for SVG #129

Merged
merged 9 commits into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { hasAttribute } from "@siteimprove/alfa-dom";
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#ahref
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#abbr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#address
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { hasAttribute } from "@siteimprove/alfa-dom";
import * as Roles from "../roles";
import { Feature, None } from "../types";
import * as Roles from "../../roles";
import { Feature, None } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#areahref
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Feature } from "../types";
import * as Roles from "../../roles";
import { Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#article
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Feature } from "../types";
import * as Roles from "../../roles";
import { Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#aside
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Feature } from "../types";
import * as Roles from "../../roles";
import { Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#audio
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#text-level-semantics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Attributes from "../attributes";
import * as Roles from "../roles";
import { Feature, None } from "../types";
import * as Attributes from "../../attributes";
import * as Roles from "../../roles";
import { Feature, None } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#text-level-semantics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#text-level-semantics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#p-pre-blockquote
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Feature, None } from "../types";
import * as Roles from "../../roles";
import { Feature, None } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#body
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#text-level-semantics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Feature } from "../types";
import * as Roles from "../../roles";
import { Feature } from "../../types";

/**
* NB: Though the specification defines separate logic for `<button>` with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#canvas
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Feature, None } from "../types";
import * as Roles from "../../roles";
import { Feature, None } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#caption
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#text-level-semantics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Roles from "../roles";
import { Any, Feature } from "../types";
import * as Roles from "../../roles";
import { Any, Feature } from "../../types";

/**
* @see https://www.w3.org/TR/html-aria/#text-level-semantics
Expand Down
Loading