Skip to content

Commit

Permalink
Merge branch 'mask-properties' of github.com:Siteimprove/alfa into ma…
Browse files Browse the repository at this point in the history
…sk-properties
  • Loading branch information
rcj-siteimprove committed Dec 6, 2024
2 parents 216928d + 758da49 commit f6ac94f
Show file tree
Hide file tree
Showing 199 changed files with 2,593 additions and 1,546 deletions.
5 changes: 0 additions & 5 deletions .changeset/beige-walls-fetch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pretty-scissors-explode.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/quick-months-do.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/short-bees-behave.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/twenty-boxes-complain.md

This file was deleted.

28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Alfa changelog

## [0.96.0](../../compare/v0.95.0...v0.96.0) (2024-12-06)

### Added

- [@siteimprove/alfa-rules](packages/alfa-rules/CHANGELOG.md#0960): A new experimental rule SIA-R115: "Heading is descriptive" is now available. ([#1722](https://github.com/Siteimprove/alfa/pull/1722))

- [@siteimprove/alfa-dom](packages/alfa-dom/CHANGELOG.md#0960): An `Element<"summary">#isSummaryForItsParentDetails` predicate is now available. ([#1728](https://github.com/Siteimprove/alfa/pull/1728))

- [@siteimprove/alfa-rules](packages/alfa-rules/CHANGELOG.md#0960): SIA-R116: "`<summary>` element has non-empty accessible name" is now available. ([#1728](https://github.com/Siteimprove/alfa/pull/1728))

- [@siteimprove/alfa-cache](packages/alfa-cache/CHANGELOG.md#0960): A `Cache.memoize` decorator is now available. ([#1720](https://github.com/Siteimprove/alfa/pull/1720))

- [@siteimprove/alfa-dom](packages/alfa-dom/CHANGELOG.md#0960): An `Attribute.Autocomplete` namespace is now available, grouping functionalities around the `autocomplete` attribute. ([#1724](https://github.com/Siteimprove/alfa/pull/1724))

- [@siteimprove/alfa-rules](packages/alfa-rules/CHANGELOG.md#0960), [@siteimprove/alfa-aria](packages/alfa-aria/CHANGELOG.md#0960): Expose `allowedAttributes` on ARIA Element type. ([#1721](https://github.com/Siteimprove/alfa/pull/1721))

### Fixed

- [@siteimprove/alfa-aria](packages/alfa-aria/CHANGELOG.md#0960): `<summary>` elements that are not summary for their parent details are now correctly treated as `generic` role. ([#1728](https://github.com/Siteimprove/alfa/pull/1728))

- [@siteimprove/alfa-aria](packages/alfa-aria/CHANGELOG.md#0960): `<details>` elements now correctly have an implicit role of `group`. ([#1728](https://github.com/Siteimprove/alfa/pull/1728))

- [@siteimprove/alfa-device](packages/alfa-device/CHANGELOG.md#0960): Values of undefined user preferences are now correctly set to their default. ([#1725](https://github.com/Siteimprove/alfa/pull/1725))

- [@siteimprove/alfa-aria](packages/alfa-aria/CHANGELOG.md#0960): `<summary>` elements that are summary for their parent details now correctly have their name computed from content. ([#1728](https://github.com/Siteimprove/alfa/pull/1728))

- [@siteimprove/alfa-css-feature](packages/alfa-css-feature/CHANGELOG.md#0960): Matching of user-preferences in the boolean context now correctly handles `none` defaults. ([#1725](https://github.com/Siteimprove/alfa/pull/1725))

## [0.95.0](../../compare/v0.94.1...v0.95.0) (2024-11-28)

### Breaking
Expand Down
17 changes: 17 additions & 0 deletions docs/api/alfa-aria.element.allowedattributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@siteimprove/alfa-aria](./alfa-aria.md) &gt; [Element](./alfa-aria.element.md) &gt; [allowedAttributes](./alfa-aria.element.allowedattributes.md)

## Element.allowedAttributes() method

The attributes that are allowed on this element, taking into consideration ARIA in HTML conformance requirements. See [https://w3c.github.io/html-aria/\#docconformance](https://w3c.github.io/html-aria/#docconformance)

**Signature:**

```typescript
allowedAttributes(): ReadonlyArray<Attribute.Name>;
```
**Returns:**

ReadonlyArray&lt;[Attribute.Name](./alfa-aria.attribute.name.md)<!-- -->&gt;

22 changes: 22 additions & 0 deletions docs/api/alfa-aria.element.isattributeallowed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@siteimprove/alfa-aria](./alfa-aria.md) &gt; [Element](./alfa-aria.element.md) &gt; [isAttributeAllowed](./alfa-aria.element.isattributeallowed.md)

## Element.isAttributeAllowed() method

**Signature:**

```typescript
isAttributeAllowed(attribute: Attribute.Name): boolean;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| attribute | [Attribute.Name](./alfa-aria.attribute.name.md) | |

**Returns:**

boolean

4 changes: 3 additions & 1 deletion docs/api/alfa-cache.cache.empty.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

## Cache.empty() method

Creates an empty cache.

**Signature:**

```typescript
static empty<K extends object, V>(): Cache<K, V>;
static empty<K extends Cache.Key, V>(): Cache<K, V>;
```
**Returns:**
Expand Down
4 changes: 3 additions & 1 deletion docs/api/alfa-cache.cache.from.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

## Cache.from() function

Creates a new cache from an iterable of key-value pairs.

**Signature:**

```typescript
function from<K extends object, V>(iterable: Iterable<readonly [K, V]>): Cache<K, V>;
function from<K extends Key, V>(iterable: Iterable<readonly [K, V]>): Cache<K, V>;
```

## Parameters
Expand Down
2 changes: 2 additions & 0 deletions docs/api/alfa-cache.cache.get.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Cache.get() method

Returns the value (if it exists) associated with the given key.

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/alfa-cache.cache.get_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Cache.get() method

Returns the value associated with the given key; if it does not exist, evaluates `ifMissing`<!-- -->, store the result in the cache and returns it.

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/alfa-cache.cache.has.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Cache.has() method

Tests whether a given key exists in the cache.

**Signature:**

```typescript
Expand Down
13 changes: 13 additions & 0 deletions docs/api/alfa-cache.cache.key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@siteimprove/alfa-cache](./alfa-cache.md) &gt; [Cache](./alfa-cache.cache.md) &gt; [Key](./alfa-cache.cache.key.md)

## Cache.Key type

Allowed keys in a Cache.

**Signature:**

```typescript
type Key = object;
```
10 changes: 9 additions & 1 deletion docs/api/alfa-cache.cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,13 @@ export declare namespace Cache
| Function | Description |
| --- | --- |
| [from(iterable)](./alfa-cache.cache.from.md) | |
| [from(iterable)](./alfa-cache.cache.from.md) | Creates a new cache from an iterable of key-value pairs. |
| [memoize(target)](./alfa-cache.cache.memoize.md) | Memoizes a method. |
| [memoize(target)](./alfa-cache.cache.memoize_1.md) | Memoizes a function |
## Type Aliases
| Type Alias | Description |
| --- | --- |
| [Key](./alfa-cache.cache.key.md) | Allowed keys in a Cache. |
24 changes: 24 additions & 0 deletions docs/api/alfa-cache.cache.memoize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@siteimprove/alfa-cache](./alfa-cache.md) &gt; [Cache](./alfa-cache.cache.md) &gt; [memoize](./alfa-cache.cache.memoize.md)

## Cache.memoize() function

Memoizes a method.

**Signature:**

```typescript
function memoize<This, Args extends Array<Key>, Return>(target: (this: This, ...args: Args) => Return): (this: This, ...args: Args) => Return;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| target | (this: This, ...args: Args) =&gt; Return | |

**Returns:**

(this: This, ...args: Args) =&gt; Return

28 changes: 28 additions & 0 deletions docs/api/alfa-cache.cache.memoize_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@siteimprove/alfa-cache](./alfa-cache.md) &gt; [Cache](./alfa-cache.cache.md) &gt; [memoize](./alfa-cache.cache.memoize_1.md)

## Cache.memoize() function

Memoizes a function

**Signature:**

```typescript
function memoize<Args extends Array<Key>, Return>(target: (...args: Args) => Return): (...args: Args) => Return;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| target | (...args: Args) =&gt; Return | |

**Returns:**

(...args: Args) =&gt; Return

## Remarks

When memoizing a recursive function, care must be taken to also memoize the recursive calls. This is best done by wrapping an anonymous function that recurses on the memoized function: `const foo = Cache.memoize(function (x: A): B { … foo(x2) … }`

2 changes: 2 additions & 0 deletions docs/api/alfa-cache.cache.merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Cache.merge() method

Merges a cache with an iterable of key-value pairs.

**Signature:**

```typescript
Expand Down
6 changes: 6 additions & 0 deletions docs/api/alfa-cache.cache.set.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Cache.set() method

Adds a key-value pair to a cache.

**Signature:**

```typescript
Expand All @@ -21,3 +23,7 @@ set(key: K, value: V): this;

this

## Remarks

Avoid using this. Prefer using the `ifMissing` parameter of `get()` instead.

2 changes: 1 addition & 1 deletion docs/api/alfa-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

| Class | Description |
| --- | --- |
| [Cache](./alfa-cache.cache.md) | |
| [Cache](./alfa-cache.cache.md) | Caches are wrapper around Javascript's <code>WeakMap</code> to store transient values. |

## Namespaces

Expand Down
2 changes: 1 addition & 1 deletion docs/api/alfa-rules.alfaversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
**Signature:**

```typescript
alfaVersion = "0.95.0"
alfaVersion = "0.96.0"
```
1 change: 1 addition & 0 deletions docs/api/alfa-rules.experimentalrules.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
| [ER87](./alfa-rules.experimentalrules.er87.md) | This version of R87 ask questions whose subject is not the target of the rule. The context of the question is still the test target (the document), but the subjects can be various elements (the first focusable element, or its destination once it's been identified as a link). This needs changes in Dory, Nemo, and likely databases to be stored; this needs changes in the Page Report to be able to highlight an element different from the test target. |
| [R109](./alfa-rules.experimentalrules.r109.md) | This rule always asks for the language of the page, and compares it with the <code>lang</code> attribute. This is not a nice experience for the end user and shouldn't be used until backend can automatically determine the answer. |
| [R114](./alfa-rules.experimentalrules.r114.md) | This rule always asks Whether the <code>&lt;title&gt;</code> of the page is descriptive. This is not a nice experience for the end user and shouldn't be used until backend can automatically determine the answer. |
| [R115](./alfa-rules.experimentalrules.r115.md) | This rule always asks Whether the heading is descriptive. This is not a nice experience for the end user and shouldn't be used until backend can automatically determine the answer. |
| [R82](./alfa-rules.experimentalrules.r82.md) | R82 ask questions whose subject is not the target of the rule. The context of the question is still the test target, but the subjects can be various other elements. This needs changes in Dory, Nemo, and likely databases to be stored; this needs changes in the Page Report to be able to highlight an element different from the test target. |

13 changes: 13 additions & 0 deletions docs/api/alfa-rules.experimentalrules.r115.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@siteimprove/alfa-rules](./alfa-rules.md) &gt; [experimentalRules](./alfa-rules.experimentalrules.md) &gt; [R115](./alfa-rules.experimentalrules.r115.md)

## experimentalRules.R115 variable

This rule always asks Whether the heading is descriptive. This is not a nice experience for the end user and shouldn't be used until backend can automatically determine the answer.

**Signature:**

```typescript
_default: Rule.Atomic<Page, Element<string>, Question.Metadata, Element<string>>
```
4 changes: 4 additions & 0 deletions docs/api/alfa-rules.question.data.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,9 @@ Data: {
readonly type: "boolean";
readonly message: "Does this title describe the content of the document?";
};
readonly "is-heading-descriptive": {
readonly type: "boolean";
readonly message: "Does this heading describe the following content?";
};
}
```
18 changes: 7 additions & 11 deletions docs/review/api/alfa-cache.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,22 @@ import { Iterable as Iterable_2 } from '@siteimprove/alfa-iterable';
import type { Mapper } from '@siteimprove/alfa-mapper';
import { Option } from '@siteimprove/alfa-option';

// @public (undocumented)
export class Cache<K extends object, V> {
// (undocumented)
static empty<K extends object, V>(): Cache<K, V>;
// (undocumented)
// @public
export class Cache<K extends Cache.Key, V> {
static empty<K extends Cache.Key, V>(): Cache<K, V>;
get(key: K): Option<V>;
// (undocumented)
get<U extends V = V>(key: K, ifMissing: Mapper<this, U>): V;
// (undocumented)
has(key: K): boolean;
// (undocumented)
merge(iterable: Iterable_2<readonly [K, V]>): this;
// (undocumented)
set(key: K, value: V): this;
}

// @public (undocumented)
export namespace Cache {
// (undocumented)
export function from<K extends object, V>(iterable: Iterable_2<readonly [K, V]>): Cache<K, V>;
export function from<K extends Key, V>(iterable: Iterable_2<readonly [K, V]>): Cache<K, V>;
export type Key = object;
export function memoize<This, Args extends Array<Key>, Return>(target: (this: This, ...args: Args) => Return): (this: This, ...args: Args) => Return;
export function memoize<Args extends Array<Key>, Return>(target: (...args: Args) => Return): (...args: Args) => Return;
}

// (No @packageDocumentation comment for this package)
Expand Down
2 changes: 1 addition & 1 deletion docs/review/api/alfa-rules.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Tag } from '@siteimprove/alfa-act';
import { Text } from '@siteimprove/alfa-dom';

// @public (undocumented)
export const alfaVersion = "0.95.0";
export const alfaVersion = "0.96.0";

// @public (undocumented)
export class ARIA extends Requirement<"ARIA"> {
Expand Down
Loading

0 comments on commit f6ac94f

Please sign in to comment.