Skip to content

Commit

Permalink
Merge branch 'main' into api-extractor
Browse files Browse the repository at this point in the history
* main:
  Unbranch ARIA types (#729)
  Update change log
  Track ARIA editors draft (#728)
  Update workflows
  Shuffle around some change logs
  v0.12.0
  Prepare release
  Normalize computed accessible names in SIA-R41 and SIA-R81
  Make `Text#toString()` a little better
  Simplify empty `role` check
  Don't overwrite the source of inherited property values
  Accept spaces around CSS variable names in `var()` functions (#725)
  Deal with accessible names that are only whitespace
  Rework media query and handle media ranges (#722)
  • Loading branch information
kasperisager committed Mar 1, 2021
2 parents f0759e0 + ad94f5b commit 29a69fb
Show file tree
Hide file tree
Showing 141 changed files with 4,522 additions and 3,222 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Integrate
on:
push:
branches:
- master
- main
pull_request:
branches:
- "*"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Scan
on:
push:
branches:
- master
- main
pull_request:
branches:
- "*"
Expand Down
48 changes: 40 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ Items that are related, such as breaking changes, new features, or changes to ex

## [Unreleased]

## [0.11.0](../../compare/v0.10.0...v0.11.0) (2021-02-23)

### Breaking

- [@siteimprove/alfa-css](packages/alfa-css): `Lexer.lex()` now returns `Slice<Token>` as the returned array would always be wrapped in a slice by the caller.
- [@siteimprove/alfa-aria](packages/alfa-aria): `Role#requiredParent()` now returns `Iterable<Iterable<Role.Name>>` to make it possible to model the nested parent requirements that have been introduced in the Editor's Draft of WAI-ARIA. ([#728](../../pull/728))

- [@siteimprove/alfa-selector](packages/alfa-selector): `Selector.parse()` is now an instance of `Parser<Slice<Token>, Selector, string>` to allow it being used in parser combinators.
### Changed

- [@siteimprove/alfa-media](packages/alfa-media): `Media.parse()` is now an instance of `Parser<Slice<Token>, Media.List, string>` to allow it being used in parser combinators.
- [@siteimprove/alfa-aria](packages/alfa-aria): We now track the latest Editor's Draft of WAI-ARIA, which contains several fixes already implemented by browsers and assistive technologies. ([#728](../../pull/728))

- [@siteimprove/alfa-cache](packages/alfa-cache): `Cache<K, V>` now requires that `K` be an object type.
## [0.12.0](../../compare/v0.11.0...v0.12.0) (2021-02-26)

### Breaking

- [@siteimprove/alfa-media](packages/alfa-media): A new `Media.Value` type has been introduced and is now used for the `Feature#value` property. The new type is used for modelling both discrete and range values which was not previously possible. Additionally, the `Media.Condition` type has been split into `Media.And` and `Media.Or`, and `Media.Negation` has been renamed `Media.Not`. `Media.Condition` is now an alias for `Media.And | Media.Or | Media.Not`. ([#722](../../pull/722))

- [@siteimprove/alfa-act](packages/alfa-act): The `Oracle<Q>` type has now become `Oracle<I, T, Q>`. As such, the input type `I` and test target type `T` must now be declared up front. Additionally, the `Question<Q, A, S, T>` type has now become `Question<Q, S, A, T>` to ensure alignment with the remaining types of the package. ([#699](../../pull/699))

Expand All @@ -41,6 +43,38 @@ Items that are related, such as breaking changes, new features, or changes to ex

### Added

- [@siteimprove/alfa-media](packages/alfa-media): The new range syntax for media features, such as `100px < width <= 900px`, is now supported. ([#109](../../issue/109), [#722](../../pull/722))

- [@siteimprove/alfa-css](packages/alfa-css): The `Dimension` and `Numeric` types now provide implementations of `Comparable`. The `Dimension#canonicalUnit` property is now also available to facilitate comparisons between units of same dimensional type. ([#722](../../pull/722))

- [@siteimprove/alfa-interviewer](packages/alfa-interviewer): A new package has been added with types for modelling ACT rule interviewers and functionality for loading these from external and local modules. ([#699](../../pull/699))

### Fixed

- [@siteimprove/alfa-media](packages/alfa-media): Several issues related to parsing and matching of media queries have been fixed. ([#722](../../pull/722))

- [@siteimprove/alfa-rules](packages/alfa-rules): Accessible names are now also considered empty when they consist exclusively of whitespace.

- [@siteimprove/alfa-style](packages/alfa-style): `var()` functions now accept spaces around variable names. ([#725](../../pull/725))

- [@siteimprove/alfa-style](packages/alfa-style): The source of inherited property values are no longer overwritten by the source of the `inherit` declaration.

- [@siteimprove/alfa-rules](packages/alfa-rules): SIA-R41 and SIA-R81 now correctly normalize computed accessible names.

## [0.11.0](../../compare/v0.10.0...v0.11.0) (2021-02-23)

### Breaking

- [@siteimprove/alfa-css](packages/alfa-css): `Lexer.lex()` now returns `Slice<Token>` as the returned array would always be wrapped in a slice by the caller.

- [@siteimprove/alfa-selector](packages/alfa-selector): `Selector.parse()` is now an instance of `Parser<Slice<Token>, Selector, string>` to allow it being used in parser combinators.

- [@siteimprove/alfa-media](packages/alfa-media): `Media.parse()` is now an instance of `Parser<Slice<Token>, Media.List, string>` to allow it being used in parser combinators.

- [@siteimprove/alfa-cache](packages/alfa-cache): `Cache<K, V>` now requires that `K` be an object type.

### Added

- [@siteimprove/alfa-predicate](packages/alfa-predicate): `Predicate.tee()` is now available.

- [@siteimprove/alfa-result](packages/alfa-result): `Result#tee()` and `Result#teeErr()` are now available.
Expand Down Expand Up @@ -69,8 +103,6 @@ Items that are related, such as breaking changes, new features, or changes to ex

- [@siteimprove/alfa-sarif](packages/alfa-sarif): A package has been added with types for working with SARIF serialisable structures. ([#694](../../pull/694))

- [@siteimprove/alfa-interviewer](packages/alfa-interviewer): A new package has been added with types for modelling ACT rule interviewers and functionality for loading these from external and local modules. ([#699](../../pull/699))

### Changed

- [@siteimprove/alfa-rules](packages/alfa-rules): SIA-R65 now automatically accepts difference in `background-color` or `color`, and presence/absence of a `box-shadow` as a valid focus indicator. ([#658](../../issues/658), [#713](../../pull/713), [#714](../../pull/714), [#715](../../pull/715))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Alfa is distributed through [GitHub Packages](../../packages) as a set of separa
$ npm install @siteimprove/alfa-<package-name>
```

> :warning: Make sure to instruct your client to pull packages belonging to the `@siteimprove` scope from GitHub by adding the line `@siteimprove:registry=https://npm.pkg.github.com` to your `.npmrc` file.
> :warning: Make sure to instruct your client to pull packages belonging to the `@siteimprove` scope from GitHub by adding the line `@siteimprove:registry=https://npm.pkg.github.com/siteimprove` to your `.npmrc` file.
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!

Expand Down
38 changes: 19 additions & 19 deletions packages/alfa-act/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json.schemastore.org/package",
"name": "@siteimprove/alfa-act",
"homepage": "https://siteimprove.com",
"version": "0.11.0",
"version": "0.12.0",
"license": "MIT",
"description": "Functionality for implementing rules specified in the ACT Rules Format",
"repository": {
Expand All @@ -18,26 +18,26 @@
"src/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-earl": "workspace:^0.11.0",
"@siteimprove/alfa-equatable": "workspace:^0.11.0",
"@siteimprove/alfa-functor": "workspace:^0.11.0",
"@siteimprove/alfa-future": "workspace:^0.11.0",
"@siteimprove/alfa-iterable": "workspace:^0.11.0",
"@siteimprove/alfa-json": "workspace:^0.11.0",
"@siteimprove/alfa-list": "workspace:^0.11.0",
"@siteimprove/alfa-mapper": "workspace:^0.11.0",
"@siteimprove/alfa-monad": "workspace:^0.11.0",
"@siteimprove/alfa-option": "workspace:^0.11.0",
"@siteimprove/alfa-performance": "workspace:^0.11.0",
"@siteimprove/alfa-record": "workspace:^0.11.0",
"@siteimprove/alfa-result": "workspace:^0.11.0",
"@siteimprove/alfa-sarif": "workspace:^0.11.0",
"@siteimprove/alfa-sequence": "workspace:^0.11.0",
"@siteimprove/alfa-thunk": "workspace:^0.11.0",
"@siteimprove/alfa-trilean": "workspace:^0.11.0"
"@siteimprove/alfa-earl": "workspace:^0.12.0",
"@siteimprove/alfa-equatable": "workspace:^0.12.0",
"@siteimprove/alfa-functor": "workspace:^0.12.0",
"@siteimprove/alfa-future": "workspace:^0.12.0",
"@siteimprove/alfa-iterable": "workspace:^0.12.0",
"@siteimprove/alfa-json": "workspace:^0.12.0",
"@siteimprove/alfa-list": "workspace:^0.12.0",
"@siteimprove/alfa-mapper": "workspace:^0.12.0",
"@siteimprove/alfa-monad": "workspace:^0.12.0",
"@siteimprove/alfa-option": "workspace:^0.12.0",
"@siteimprove/alfa-performance": "workspace:^0.12.0",
"@siteimprove/alfa-record": "workspace:^0.12.0",
"@siteimprove/alfa-result": "workspace:^0.12.0",
"@siteimprove/alfa-sarif": "workspace:^0.12.0",
"@siteimprove/alfa-sequence": "workspace:^0.12.0",
"@siteimprove/alfa-thunk": "workspace:^0.12.0",
"@siteimprove/alfa-trilean": "workspace:^0.12.0"
},
"devDependencies": {
"@siteimprove/alfa-test": "workspace:^0.11.0"
"@siteimprove/alfa-test": "workspace:^0.12.0"
},
"publishConfig": {
"access": "public",
Expand Down
12 changes: 6 additions & 6 deletions packages/alfa-affine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json.schemastore.org/package",
"name": "@siteimprove/alfa-affine",
"homepage": "https://siteimprove.com",
"version": "0.11.0",
"version": "0.12.0",
"license": "MIT",
"description": "Functionality for working with affine transformations",
"repository": {
Expand All @@ -18,13 +18,13 @@
"src/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-equatable": "workspace:^0.11.0",
"@siteimprove/alfa-json": "workspace:^0.11.0",
"@siteimprove/alfa-math": "workspace:^0.11.0",
"@siteimprove/alfa-option": "workspace:^0.11.0"
"@siteimprove/alfa-equatable": "workspace:^0.12.0",
"@siteimprove/alfa-json": "workspace:^0.12.0",
"@siteimprove/alfa-math": "workspace:^0.12.0",
"@siteimprove/alfa-option": "workspace:^0.12.0"
},
"devDependencies": {
"@siteimprove/alfa-test": "workspace:^0.11.0"
"@siteimprove/alfa-test": "workspace:^0.12.0"
},
"publishConfig": {
"access": "public",
Expand Down
14 changes: 7 additions & 7 deletions packages/alfa-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json.schemastore.org/package",
"name": "@siteimprove/alfa-angular",
"homepage": "https://siteimprove.com",
"version": "0.11.0",
"version": "0.12.0",
"license": "MIT",
"description": "Integrations and utilities for the Angular application framework",
"repository": {
Expand All @@ -19,16 +19,16 @@
],
"dependencies": {
"@angular/core": "^11.0.0",
"@siteimprove/alfa-device": "workspace:^0.11.0",
"@siteimprove/alfa-dom": "workspace:^0.11.0",
"@siteimprove/alfa-http": "workspace:^0.11.0",
"@siteimprove/alfa-option": "workspace:^0.11.0",
"@siteimprove/alfa-web": "workspace:^0.11.0",
"@siteimprove/alfa-device": "workspace:^0.12.0",
"@siteimprove/alfa-dom": "workspace:^0.12.0",
"@siteimprove/alfa-http": "workspace:^0.12.0",
"@siteimprove/alfa-option": "workspace:^0.12.0",
"@siteimprove/alfa-web": "workspace:^0.12.0",
"rxjs": "^6.6.3",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@siteimprove/alfa-test": "workspace:^0.11.0"
"@siteimprove/alfa-test": "workspace:^0.12.0"
},
"publishConfig": {
"access": "public",
Expand Down
6 changes: 3 additions & 3 deletions packages/alfa-applicative/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json.schemastore.org/package",
"name": "@siteimprove/alfa-applicative",
"homepage": "https://siteimprove.com",
"version": "0.11.0",
"version": "0.12.0",
"license": "MIT",
"description": "Types for modelling applicative functors",
"repository": {
Expand All @@ -18,10 +18,10 @@
"src/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-mapper": "workspace:^0.11.0"
"@siteimprove/alfa-mapper": "workspace:^0.12.0"
},
"devDependencies": {
"@siteimprove/alfa-test": "workspace:^0.11.0"
"@siteimprove/alfa-test": "workspace:^0.12.0"
},
"publishConfig": {
"access": "public",
Expand Down
48 changes: 24 additions & 24 deletions packages/alfa-aria/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json.schemastore.org/package",
"name": "@siteimprove/alfa-aria",
"homepage": "https://siteimprove.com",
"version": "0.11.0",
"version": "0.12.0",
"license": "MIT",
"description": "Functionality for working with ARIA and the accessibility tree",
"repository": {
Expand All @@ -21,31 +21,31 @@
"generate": "node scripts/attributes.js && node scripts/roles.js"
},
"dependencies": {
"@siteimprove/alfa-array": "workspace:^0.11.0",
"@siteimprove/alfa-branched": "workspace:^0.11.0",
"@siteimprove/alfa-cache": "workspace:^0.11.0",
"@siteimprove/alfa-compatibility": "workspace:^0.11.0",
"@siteimprove/alfa-device": "workspace:^0.11.0",
"@siteimprove/alfa-dom": "workspace:^0.11.0",
"@siteimprove/alfa-equatable": "workspace:^0.11.0",
"@siteimprove/alfa-graph": "workspace:^0.11.0",
"@siteimprove/alfa-hash": "workspace:^0.11.0",
"@siteimprove/alfa-iterable": "workspace:^0.11.0",
"@siteimprove/alfa-json": "workspace:^0.11.0",
"@siteimprove/alfa-lazy": "workspace:^0.11.0",
"@siteimprove/alfa-map": "workspace:^0.11.0",
"@siteimprove/alfa-mapper": "workspace:^0.11.0",
"@siteimprove/alfa-option": "workspace:^0.11.0",
"@siteimprove/alfa-predicate": "workspace:^0.11.0",
"@siteimprove/alfa-refinement": "workspace:^0.11.0",
"@siteimprove/alfa-sequence": "workspace:^0.11.0",
"@siteimprove/alfa-set": "workspace:^0.11.0",
"@siteimprove/alfa-style": "workspace:^0.11.0",
"@siteimprove/alfa-table": "workspace:^0.11.0",
"@siteimprove/alfa-thunk": "workspace:^0.11.0"
"@siteimprove/alfa-array": "workspace:^0.12.0",
"@siteimprove/alfa-branched": "workspace:^0.12.0",
"@siteimprove/alfa-cache": "workspace:^0.12.0",
"@siteimprove/alfa-compatibility": "workspace:^0.12.0",
"@siteimprove/alfa-device": "workspace:^0.12.0",
"@siteimprove/alfa-dom": "workspace:^0.12.0",
"@siteimprove/alfa-equatable": "workspace:^0.12.0",
"@siteimprove/alfa-graph": "workspace:^0.12.0",
"@siteimprove/alfa-hash": "workspace:^0.12.0",
"@siteimprove/alfa-iterable": "workspace:^0.12.0",
"@siteimprove/alfa-json": "workspace:^0.12.0",
"@siteimprove/alfa-lazy": "workspace:^0.12.0",
"@siteimprove/alfa-map": "workspace:^0.12.0",
"@siteimprove/alfa-mapper": "workspace:^0.12.0",
"@siteimprove/alfa-option": "workspace:^0.12.0",
"@siteimprove/alfa-predicate": "workspace:^0.12.0",
"@siteimprove/alfa-refinement": "workspace:^0.12.0",
"@siteimprove/alfa-sequence": "workspace:^0.12.0",
"@siteimprove/alfa-set": "workspace:^0.12.0",
"@siteimprove/alfa-style": "workspace:^0.12.0",
"@siteimprove/alfa-table": "workspace:^0.12.0",
"@siteimprove/alfa-thunk": "workspace:^0.12.0"
},
"devDependencies": {
"@siteimprove/alfa-test": "workspace:^0.11.0"
"@siteimprove/alfa-test": "workspace:^0.12.0"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/alfa-aria/scripts/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const puppeteer = require("puppeteer");
puppeteer.launch().then(async (browser) => {
const page = await browser.newPage();

await page.goto("https://www.w3.org/TR/wai-aria-1.2/");
await page.goto("https://w3c.github.io/aria/");

const attributes = await page.evaluate(() =>
Object.fromEntries(
Expand Down
35 changes: 25 additions & 10 deletions packages/alfa-aria/scripts/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const prettier = require("prettier");
const puppeteer = require("puppeteer");

const specifications = [
"https://www.w3.org/TR/wai-aria-1.2/",
"https://w3c.github.io/aria/",
"https://www.w3.org/TR/graphics-aria/",
"https://www.w3.org/TR/dpub-aria/",
];
Expand Down Expand Up @@ -55,11 +55,18 @@ puppeteer.launch().then(async (browser) => {
.implicit-values .property-reference,
.implicit-values .state-reference
`),
].map((reference) => {
const key = hash(reference.getAttribute("href"));
const value = reference.nextElementSibling.textContent;

return [key, value];
].flatMap((reference) => {
const href = reference.getAttribute("href");
const key = hash(href);
const value = reference.parentElement.querySelector(
`[href="${href}"] + .default`
);

if (value === null) {
return [];
}

return [[key, value.textContent]];
})
);

Expand All @@ -80,7 +87,8 @@ puppeteer.launch().then(async (browser) => {
.querySelector(".role-namefrom")
?.textContent.trim()
.split(/\s+/)
.filter((from) => from !== "n/a") ?? [];
.filter((from) => from !== "n/a")
.sort() ?? [];

const name = {
required:
Expand All @@ -94,10 +102,17 @@ puppeteer.launch().then(async (browser) => {

const parent = {
required: [
...role.querySelectorAll(".role-scope .role-reference"),
...role.querySelectorAll(".role-scope, .role-scope li"),
]
.map((reference) => hash(reference.getAttribute("href")))
.sort(),
.map((scope) => [
...scope.querySelectorAll(":scope > .role-reference"),
])
.filter((references) => references.length > 0)
.map((references) =>
references.map((reference) =>
hash(reference.getAttribute("href"))
)
),
};

const children = {
Expand Down
Loading

0 comments on commit 29a69fb

Please sign in to comment.