@siteimprove/alfa-dom 0.112.0 → 0.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/h.d.ts +14 -13
- package/dist/h.js +15 -13
- package/dist/index.d.ts +2 -28
- package/dist/index.js +2 -28
- package/dist/jsx.d.ts +2 -3
- package/dist/native.d.ts +10 -2
- package/dist/native.js +18 -2
- package/dist/node/attribute/predicate/has-name.d.ts +1 -1
- package/dist/node/attribute/predicate/has-name.js +2 -3
- package/dist/node/attribute.d.ts +9 -13
- package/dist/node/attribute.js +3 -10
- package/dist/node/comment.d.ts +7 -11
- package/dist/node/comment.js +2 -9
- package/dist/node/document.d.ts +11 -14
- package/dist/node/document.js +8 -23
- package/dist/node/element/augment.d.ts +1 -1
- package/dist/node/element/augment.js +1 -1
- package/dist/node/element/predicate/has-attribute.d.ts +1 -1
- package/dist/node/element/predicate/has-display-size.d.ts +1 -1
- package/dist/node/element/predicate/has-id.d.ts +1 -1
- package/dist/node/element/predicate/has-input-type.d.ts +1 -1
- package/dist/node/element/predicate/has-name.d.ts +1 -1
- package/dist/node/element/predicate/has-namespace.d.ts +1 -1
- package/dist/node/element/predicate/has-tab-index.d.ts +1 -1
- package/dist/node/element/predicate/has-unique-id.d.ts +3 -2
- package/dist/node/element/predicate/has-unique-id.js +21 -20
- package/dist/node/element/predicate/index.d.ts +19 -0
- package/dist/node/element/predicate/index.js +19 -0
- package/dist/node/element/predicate/is-actually-disabled.d.ts +4 -2
- package/dist/node/element/predicate/is-actually-disabled.js +37 -38
- package/dist/node/element/predicate/is-browsing-context-container.d.ts +1 -1
- package/dist/node/element/predicate/is-content.d.ts +5 -2
- package/dist/node/element/predicate/is-content.js +3 -4
- package/dist/node/element/predicate/is-document-element.d.ts +3 -2
- package/dist/node/element/predicate/is-document-element.js +2 -3
- package/dist/node/element/predicate/is-draggable.d.ts +1 -1
- package/dist/node/element/predicate/is-editing-host.d.ts +1 -1
- package/dist/node/element/predicate/is-fallback.d.ts +5 -2
- package/dist/node/element/predicate/is-fallback.js +5 -6
- package/dist/node/element/predicate/is-replaced.d.ts +1 -1
- package/dist/node/element/predicate/is-scoped-to.d.ts +3 -2
- package/dist/node/element/predicate/is-scoped-to.js +5 -5
- package/dist/node/element/predicate/is-suggested-focusable.d.ts +1 -1
- package/dist/node/element/predicate/is-suggested-focusable.js +3 -3
- package/dist/node/fragment.d.ts +6 -9
- package/dist/node/fragment.js +5 -20
- package/dist/node/index.d.ts +54 -0
- package/dist/node/index.js +74 -0
- package/dist/{node.d.ts → node/node.d.ts} +40 -160
- package/dist/{node.js → node/node.js} +57 -92
- package/dist/node/predicate/has-box.d.ts +1 -2
- package/dist/node/predicate/has-child.d.ts +1 -1
- package/dist/node/predicate/has-child.js +2 -2
- package/dist/node/predicate/has-descendant.d.ts +1 -1
- package/dist/node/predicate/has-descendant.js +2 -2
- package/dist/node/predicate/has-inclusive-descendant.d.ts +1 -1
- package/dist/node/predicate/has-inclusive-descendant.js +2 -2
- package/dist/node/predicate/has-text-content.d.ts +1 -1
- package/dist/node/predicate/has-text-content.js +2 -2
- package/dist/node/predicate/index.d.ts +7 -0
- package/dist/node/predicate/index.js +7 -0
- package/dist/node/predicate/is-root.d.ts +1 -1
- package/dist/node/query/descendants.d.ts +3 -3
- package/dist/node/query/descendants.js +6 -6
- package/dist/node/query/element-id-map.d.ts +2 -2
- package/dist/node/query/index.d.ts +2 -2
- package/dist/node/shadow.d.ts +11 -14
- package/dist/node/shadow.js +9 -24
- package/dist/node/{element.d.ts → slotable/element.d.ts} +28 -27
- package/dist/node/{element.js → slotable/element.js} +40 -51
- package/dist/node/slotable/index.d.ts +12 -0
- package/dist/node/slotable/index.js +15 -0
- package/dist/node/slotable/slot.d.ts +21 -0
- package/dist/node/slotable/slot.js +23 -0
- package/dist/node/slotable/slotable.d.ts +31 -0
- package/dist/node/slotable/slotable.js +16 -0
- package/dist/node/{text.d.ts → slotable/text.d.ts} +8 -11
- package/dist/node/{text.js → slotable/text.js} +13 -10
- package/dist/node/traversal/get-nodes-between.d.ts +1 -1
- package/dist/node/traversal/get-nodes-between.js +3 -3
- package/dist/node/traversal/index.d.ts +2 -0
- package/dist/node/traversal/index.js +2 -0
- package/dist/node/traversal/lowest-common-ancestor.d.ts +1 -1
- package/dist/node/traversal/lowest-common-ancestor.js +2 -2
- package/dist/node/type.d.ts +6 -10
- package/dist/node/type.js +2 -9
- package/dist/style/declaration.d.ts +2 -2
- package/dist/style/index.d.ts +5 -0
- package/dist/style/index.js +5 -0
- package/dist/style/rule/condition.d.ts +1 -1
- package/dist/style/rule/font-face.d.ts +3 -3
- package/dist/style/rule/font-face.js +2 -2
- package/dist/style/rule/grouping.d.ts +4 -3
- package/dist/style/rule/grouping.js +2 -2
- package/dist/style/rule/import.d.ts +3 -3
- package/dist/style/rule/import.js +2 -4
- package/dist/style/rule/index.d.ts +65 -0
- package/dist/style/rule/index.js +83 -0
- package/dist/style/rule/keyframe.d.ts +3 -3
- package/dist/style/rule/keyframe.js +2 -2
- package/dist/style/rule/keyframes.d.ts +2 -2
- package/dist/style/rule/keyframes.js +2 -3
- package/dist/style/rule/layer.d.ts +5 -4
- package/dist/style/rule/layer.js +4 -4
- package/dist/style/rule/media.d.ts +2 -2
- package/dist/style/rule/media.js +2 -3
- package/dist/style/rule/namespace.d.ts +3 -3
- package/dist/style/rule/namespace.js +2 -2
- package/dist/style/rule/page.d.ts +3 -3
- package/dist/style/rule/page.js +2 -2
- package/dist/style/rule/rule.d.ts +42 -0
- package/dist/style/rule/rule.js +64 -0
- package/dist/style/rule/style.d.ts +3 -3
- package/dist/style/rule/style.js +2 -2
- package/dist/style/rule/supports.d.ts +2 -2
- package/dist/style/rule/supports.js +2 -3
- package/dist/style/sheet.d.ts +1 -1
- package/dist/style/sheet.js +2 -2
- package/package.json +29 -30
- package/dist/node/element/predicate.d.ts +0 -19
- package/dist/node/element/predicate.js +0 -19
- package/dist/node/predicate.d.ts +0 -7
- package/dist/node/predicate.js +0 -7
- package/dist/node/slot.d.ts +0 -29
- package/dist/node/slot.js +0 -41
- package/dist/node/slotable.d.ts +0 -29
- package/dist/node/slotable.js +0 -40
- package/dist/node/traversal.d.ts +0 -2
- package/dist/node/traversal.js +0 -2
- package/dist/style/rule.d.ts +0 -60
- package/dist/style/rule.js +0 -109
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Array } from "@siteimprove/alfa-array";
|
|
2
2
|
import { Option } from "@siteimprove/alfa-option";
|
|
3
3
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
4
|
-
import { Rule } from "
|
|
4
|
+
import type { Rule } from "./index.js";
|
|
5
|
+
import { BaseRule } from "./rule.js";
|
|
5
6
|
import { GroupingRule } from "./grouping.js";
|
|
6
7
|
/**
|
|
7
8
|
* Model for CSS layers
|
|
@@ -21,7 +22,7 @@ export declare namespace Layer {
|
|
|
21
22
|
* {@link https://drafts.csswg.org/css-cascade-5/#layer-empty}
|
|
22
23
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerStatementRule}
|
|
23
24
|
*/
|
|
24
|
-
class StatementRule extends
|
|
25
|
+
class StatementRule extends BaseRule<"layer-statement"> {
|
|
25
26
|
static of(layers: Iterable<string>): StatementRule;
|
|
26
27
|
private readonly _layers;
|
|
27
28
|
protected constructor(layers: Array<string>);
|
|
@@ -30,7 +31,7 @@ export declare namespace Layer {
|
|
|
30
31
|
toString(): string;
|
|
31
32
|
}
|
|
32
33
|
namespace StatementRule {
|
|
33
|
-
interface JSON extends
|
|
34
|
+
interface JSON extends BaseRule.JSON<"layer-statement"> {
|
|
34
35
|
layers: Array<string>;
|
|
35
36
|
}
|
|
36
37
|
function fromLayerStatementRule(json: JSON): Trampoline<StatementRule>;
|
|
@@ -54,7 +55,7 @@ export declare namespace Layer {
|
|
|
54
55
|
interface JSON extends GroupingRule.JSON<"layer-block"> {
|
|
55
56
|
layer: string | null;
|
|
56
57
|
}
|
|
57
|
-
function fromLayerBlockRule(json: JSON): Trampoline<BlockRule>;
|
|
58
|
+
function fromLayerBlockRule(json: JSON, fromRule: (json: Rule.JSON) => Trampoline<Rule>): Trampoline<BlockRule>;
|
|
58
59
|
function isLayerBlockRule(value: unknown): value is BlockRule;
|
|
59
60
|
}
|
|
60
61
|
}
|
package/dist/style/rule/layer.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Array } from "@siteimprove/alfa-array";
|
|
|
2
2
|
import { Option } from "@siteimprove/alfa-option";
|
|
3
3
|
import { String } from "@siteimprove/alfa-string";
|
|
4
4
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
5
|
-
import {
|
|
5
|
+
import { BaseRule } from "./rule.js";
|
|
6
6
|
import { GroupingRule } from "./grouping.js";
|
|
7
7
|
/**
|
|
8
8
|
* Model for CSS layers
|
|
@@ -23,7 +23,7 @@ export var Layer;
|
|
|
23
23
|
* {@link https://drafts.csswg.org/css-cascade-5/#layer-empty}
|
|
24
24
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerStatementRule}
|
|
25
25
|
*/
|
|
26
|
-
class StatementRule extends
|
|
26
|
+
class StatementRule extends BaseRule {
|
|
27
27
|
static of(layers) {
|
|
28
28
|
return new StatementRule(Array.from(layers));
|
|
29
29
|
}
|
|
@@ -93,8 +93,8 @@ export var Layer;
|
|
|
93
93
|
}
|
|
94
94
|
Layer.BlockRule = BlockRule;
|
|
95
95
|
(function (BlockRule) {
|
|
96
|
-
function fromLayerBlockRule(json) {
|
|
97
|
-
return Trampoline.traverse(json.rules,
|
|
96
|
+
function fromLayerBlockRule(json, fromRule) {
|
|
97
|
+
return Trampoline.traverse(json.rules, fromRule).map((rules) => BlockRule.of(rules, json.layer));
|
|
98
98
|
}
|
|
99
99
|
BlockRule.fromLayerBlockRule = fromLayerBlockRule;
|
|
100
100
|
function isLayerBlockRule(value) {
|
|
@@ -3,7 +3,7 @@ import type { Device } from "@siteimprove/alfa-device";
|
|
|
3
3
|
import type { Iterable } from "@siteimprove/alfa-iterable";
|
|
4
4
|
import type { Predicate } from "@siteimprove/alfa-predicate";
|
|
5
5
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
6
|
-
import { Rule } from "
|
|
6
|
+
import type { Rule } from "./index.js";
|
|
7
7
|
import { ConditionRule } from "./condition.js";
|
|
8
8
|
/**
|
|
9
9
|
* @public
|
|
@@ -27,6 +27,6 @@ export declare namespace MediaRule {
|
|
|
27
27
|
/**
|
|
28
28
|
* @internal
|
|
29
29
|
*/
|
|
30
|
-
function fromMediaRule(json: JSON): Trampoline<MediaRule>;
|
|
30
|
+
function fromMediaRule(json: JSON, fromRule: (json: Rule.JSON) => Trampoline<Rule>): Trampoline<MediaRule>;
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=media.d.ts.map
|
package/dist/style/rule/media.js
CHANGED
|
@@ -2,7 +2,6 @@ import { Lexer } from "@siteimprove/alfa-css";
|
|
|
2
2
|
import { Feature } from "@siteimprove/alfa-css-feature";
|
|
3
3
|
import { String } from "@siteimprove/alfa-string";
|
|
4
4
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
5
|
-
import { Rule } from "../rule.js";
|
|
6
5
|
import { ConditionRule } from "./condition.js";
|
|
7
6
|
/**
|
|
8
7
|
* @public
|
|
@@ -46,8 +45,8 @@ export class MediaRule extends ConditionRule {
|
|
|
46
45
|
/**
|
|
47
46
|
* @internal
|
|
48
47
|
*/
|
|
49
|
-
function fromMediaRule(json) {
|
|
50
|
-
return Trampoline.traverse(json.rules,
|
|
48
|
+
function fromMediaRule(json, fromRule) {
|
|
49
|
+
return Trampoline.traverse(json.rules, fromRule).map((rules) => MediaRule.of(json.condition, rules));
|
|
51
50
|
}
|
|
52
51
|
MediaRule.fromMediaRule = fromMediaRule;
|
|
53
52
|
})(MediaRule || (MediaRule = {}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Option } from "@siteimprove/alfa-option";
|
|
2
2
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
3
|
-
import {
|
|
3
|
+
import { BaseRule } from "./rule.js";
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
export declare class NamespaceRule extends
|
|
7
|
+
export declare class NamespaceRule extends BaseRule<"namespace"> {
|
|
8
8
|
static of(namespace: string, prefix: Option<string>): NamespaceRule;
|
|
9
9
|
private readonly _namespace;
|
|
10
10
|
private readonly _prefix;
|
|
@@ -18,7 +18,7 @@ export declare class NamespaceRule extends Rule<"namespace"> {
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare namespace NamespaceRule {
|
|
21
|
-
interface JSON extends
|
|
21
|
+
interface JSON extends BaseRule.JSON<"namespace"> {
|
|
22
22
|
namespace: string;
|
|
23
23
|
prefix: string | null;
|
|
24
24
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Option } from "@siteimprove/alfa-option";
|
|
2
2
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
3
|
-
import {
|
|
3
|
+
import { BaseRule } from "./rule.js";
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
export class NamespaceRule extends
|
|
7
|
+
export class NamespaceRule extends BaseRule {
|
|
8
8
|
static of(namespace, prefix) {
|
|
9
9
|
return new NamespaceRule(namespace, prefix);
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
2
2
|
import { Block } from "../block.js";
|
|
3
3
|
import type { Declaration } from "../declaration.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BaseRule } from "./rule.js";
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export declare class PageRule extends
|
|
8
|
+
export declare class PageRule extends BaseRule<"page"> {
|
|
9
9
|
static of(selector: string, declarations: Iterable<Declaration>): PageRule;
|
|
10
10
|
private readonly _selector;
|
|
11
11
|
private readonly _style;
|
|
@@ -19,7 +19,7 @@ export declare class PageRule extends Rule<"page"> {
|
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
21
|
export declare namespace PageRule {
|
|
22
|
-
interface JSON extends
|
|
22
|
+
interface JSON extends BaseRule.JSON<"page"> {
|
|
23
23
|
selector: string;
|
|
24
24
|
style: Block.JSON | string;
|
|
25
25
|
}
|
package/dist/style/rule/page.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { String } from "@siteimprove/alfa-string";
|
|
2
2
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
3
3
|
import { Block } from "../block.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BaseRule } from "./rule.js";
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export class PageRule extends
|
|
8
|
+
export class PageRule extends BaseRule {
|
|
9
9
|
static of(selector, declarations) {
|
|
10
10
|
return new PageRule(selector, Array.from(declarations));
|
|
11
11
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Equatable } from "@siteimprove/alfa-equatable";
|
|
2
|
+
import { Iterable } from "@siteimprove/alfa-iterable";
|
|
3
|
+
import type { Serializable } from "@siteimprove/alfa-json";
|
|
4
|
+
import { Option } from "@siteimprove/alfa-option";
|
|
5
|
+
import * as json from "@siteimprove/alfa-json";
|
|
6
|
+
import type { Sheet } from "../sheet.js";
|
|
7
|
+
import type { Rule } from "./index.js";
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class BaseRule<T extends string = string> implements Equatable, Serializable {
|
|
12
|
+
protected _owner: Option<Sheet>;
|
|
13
|
+
protected _parent: Option<Rule>;
|
|
14
|
+
private readonly _type;
|
|
15
|
+
protected constructor(type: T);
|
|
16
|
+
get type(): T;
|
|
17
|
+
get owner(): Option<Sheet>;
|
|
18
|
+
get parent(): Option<Rule>;
|
|
19
|
+
children(): Iterable<Rule>;
|
|
20
|
+
descendants(): Iterable<Rule>;
|
|
21
|
+
ancestors(): Iterable<Rule>;
|
|
22
|
+
equals(value: unknown): value is this;
|
|
23
|
+
toJSON(): BaseRule.JSON<T>;
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
_attachOwner(owner: Sheet): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
_attachParent(parent: Rule): boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare namespace BaseRule {
|
|
37
|
+
interface JSON<T extends string = string> {
|
|
38
|
+
[key: string]: json.JSON;
|
|
39
|
+
type: T;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=rule.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Iterable } from "@siteimprove/alfa-iterable";
|
|
2
|
+
import { None, Option } from "@siteimprove/alfa-option";
|
|
3
|
+
import * as json from "@siteimprove/alfa-json";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export class BaseRule {
|
|
8
|
+
_owner = None;
|
|
9
|
+
_parent = None;
|
|
10
|
+
_type;
|
|
11
|
+
constructor(type) {
|
|
12
|
+
this._type = type;
|
|
13
|
+
}
|
|
14
|
+
get type() {
|
|
15
|
+
return this._type;
|
|
16
|
+
}
|
|
17
|
+
get owner() {
|
|
18
|
+
return this._owner;
|
|
19
|
+
}
|
|
20
|
+
get parent() {
|
|
21
|
+
return this._parent;
|
|
22
|
+
}
|
|
23
|
+
*children() { }
|
|
24
|
+
*descendants() {
|
|
25
|
+
for (const child of this.children()) {
|
|
26
|
+
yield child;
|
|
27
|
+
yield* child.descendants();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
*ancestors() {
|
|
31
|
+
for (const parent of this._parent) {
|
|
32
|
+
yield parent;
|
|
33
|
+
yield* parent.ancestors();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
equals(value) {
|
|
37
|
+
return value === this;
|
|
38
|
+
}
|
|
39
|
+
toJSON() {
|
|
40
|
+
return { type: this._type };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
_attachOwner(owner) {
|
|
46
|
+
if (this._owner.isSome()) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
this._owner = Option.of(owner);
|
|
50
|
+
// Recursively attach the owner to all children.
|
|
51
|
+
return Iterable.every(this.children(), (rule) => rule._attachOwner(owner));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
_attachParent(parent) {
|
|
57
|
+
if (this._parent.isSome()) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
this._parent = Option.of(parent);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=rule.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
2
2
|
import { Block } from "../block.js";
|
|
3
3
|
import type { Declaration } from "../declaration.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BaseRule } from "./rule.js";
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export declare class StyleRule extends
|
|
8
|
+
export declare class StyleRule extends BaseRule<"style"> {
|
|
9
9
|
static of(selector: string, declarations: Iterable<Declaration>, hint?: boolean): StyleRule;
|
|
10
10
|
private readonly _selector;
|
|
11
11
|
private readonly _style;
|
|
@@ -21,7 +21,7 @@ export declare class StyleRule extends Rule<"style"> {
|
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
23
|
export declare namespace StyleRule {
|
|
24
|
-
interface JSON extends
|
|
24
|
+
interface JSON extends BaseRule.JSON<"style"> {
|
|
25
25
|
selector: string;
|
|
26
26
|
style: Block.JSON | string;
|
|
27
27
|
}
|
package/dist/style/rule/style.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { String } from "@siteimprove/alfa-string";
|
|
2
2
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
3
3
|
import { Block } from "../block.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BaseRule } from "./rule.js";
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export class StyleRule extends
|
|
8
|
+
export class StyleRule extends BaseRule {
|
|
9
9
|
static of(selector, declarations, hint = false) {
|
|
10
10
|
return new StyleRule(selector, Array.from(declarations), hint);
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Feature } from "@siteimprove/alfa-css-feature";
|
|
2
2
|
import type { Option } from "@siteimprove/alfa-option";
|
|
3
3
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
4
|
-
import { Rule } from "
|
|
4
|
+
import type { Rule } from "./index.js";
|
|
5
5
|
import { ConditionRule } from "./condition.js";
|
|
6
6
|
import type { Device } from "@siteimprove/alfa-device";
|
|
7
7
|
import type { Predicate } from "@siteimprove/alfa-predicate";
|
|
@@ -27,6 +27,6 @@ export declare namespace SupportsRule {
|
|
|
27
27
|
/**
|
|
28
28
|
* @internal
|
|
29
29
|
*/
|
|
30
|
-
function fromSupportsRule(json: JSON): Trampoline<SupportsRule>;
|
|
30
|
+
function fromSupportsRule(json: JSON, fromRule: (json: Rule.JSON) => Trampoline<Rule>): Trampoline<SupportsRule>;
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=supports.d.ts.map
|
|
@@ -2,7 +2,6 @@ import { Lexer } from "@siteimprove/alfa-css";
|
|
|
2
2
|
import { Feature } from "@siteimprove/alfa-css-feature";
|
|
3
3
|
import { String } from "@siteimprove/alfa-string";
|
|
4
4
|
import { Trampoline } from "@siteimprove/alfa-trampoline";
|
|
5
|
-
import { Rule } from "../rule.js";
|
|
6
5
|
import { ConditionRule } from "./condition.js";
|
|
7
6
|
/**
|
|
8
7
|
* @public
|
|
@@ -48,8 +47,8 @@ export class SupportsRule extends ConditionRule {
|
|
|
48
47
|
/**
|
|
49
48
|
* @internal
|
|
50
49
|
*/
|
|
51
|
-
function fromSupportsRule(json) {
|
|
52
|
-
return Trampoline.traverse(json.rules,
|
|
50
|
+
function fromSupportsRule(json, fromRule) {
|
|
51
|
+
return Trampoline.traverse(json.rules, fromRule).map((rules) => SupportsRule.of(json.condition, rules));
|
|
53
52
|
}
|
|
54
53
|
SupportsRule.fromSupportsRule = fromSupportsRule;
|
|
55
54
|
})(SupportsRule || (SupportsRule = {}));
|
package/dist/style/sheet.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Equatable } from "@siteimprove/alfa-equatable";
|
|
|
2
2
|
import type { Serializable } from "@siteimprove/alfa-json";
|
|
3
3
|
import { Option } from "@siteimprove/alfa-option";
|
|
4
4
|
import type * as json from "@siteimprove/alfa-json";
|
|
5
|
-
import { Rule } from "./rule.js";
|
|
5
|
+
import { Rule } from "./rule/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
package/dist/style/sheet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Option, None } from "@siteimprove/alfa-option";
|
|
2
|
-
import { Rule } from "./rule.js";
|
|
2
|
+
import { Rule } from "./rule/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
@@ -59,7 +59,7 @@ export class Sheet {
|
|
|
59
59
|
*/
|
|
60
60
|
(function (Sheet) {
|
|
61
61
|
function from(json) {
|
|
62
|
-
return Sheet.of(json.rules.map(Rule.from), json.disabled, Option.from(json.condition));
|
|
62
|
+
return Sheet.of(json.rules.map((ruleJson) => Rule.from(ruleJson, Sheet.of)), json.disabled, Option.from(json.condition));
|
|
63
63
|
}
|
|
64
64
|
Sheet.from = from;
|
|
65
65
|
})(Sheet || (Sheet = {}));
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json.schemastore.org/package",
|
|
3
3
|
"name": "@siteimprove/alfa-dom",
|
|
4
4
|
"homepage": "https://alfa.siteimprove.com",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.114.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Implementations of the core DOM and CSSOM node types",
|
|
8
8
|
"repository": {
|
|
@@ -35,37 +35,36 @@
|
|
|
35
35
|
"dist/**/*.d.ts"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@siteimprove/alfa-array": "^0.
|
|
39
|
-
"@siteimprove/alfa-cache": "^0.
|
|
40
|
-
"@siteimprove/alfa-comparable": "^0.
|
|
41
|
-
"@siteimprove/alfa-css": "^0.
|
|
42
|
-
"@siteimprove/alfa-css-feature": "^0.
|
|
43
|
-
"@siteimprove/alfa-device": "^0.
|
|
44
|
-
"@siteimprove/alfa-earl": "^0.
|
|
45
|
-
"@siteimprove/alfa-equatable": "^0.
|
|
46
|
-
"@siteimprove/alfa-flags": "^0.
|
|
47
|
-
"@siteimprove/alfa-iterable": "^0.
|
|
48
|
-
"@siteimprove/alfa-json": "^0.
|
|
49
|
-
"@siteimprove/alfa-lazy": "^0.
|
|
50
|
-
"@siteimprove/alfa-map": "^0.
|
|
51
|
-
"@siteimprove/alfa-option": "^0.
|
|
52
|
-
"@siteimprove/alfa-parser": "^0.
|
|
53
|
-
"@siteimprove/alfa-predicate": "^0.
|
|
54
|
-
"@siteimprove/alfa-rectangle": "^0.
|
|
55
|
-
"@siteimprove/alfa-refinement": "^0.
|
|
56
|
-
"@siteimprove/alfa-result": "^0.
|
|
57
|
-
"@siteimprove/alfa-sarif": "^0.
|
|
58
|
-
"@siteimprove/alfa-
|
|
59
|
-
"@siteimprove/alfa-
|
|
60
|
-
"@siteimprove/alfa-
|
|
61
|
-
"@siteimprove/alfa-
|
|
62
|
-
"@siteimprove/alfa-
|
|
63
|
-
"@siteimprove/alfa-tree": "^0.112.0"
|
|
38
|
+
"@siteimprove/alfa-array": "^0.114.0",
|
|
39
|
+
"@siteimprove/alfa-cache": "^0.114.0",
|
|
40
|
+
"@siteimprove/alfa-comparable": "^0.114.0",
|
|
41
|
+
"@siteimprove/alfa-css": "^0.114.0",
|
|
42
|
+
"@siteimprove/alfa-css-feature": "^0.114.0",
|
|
43
|
+
"@siteimprove/alfa-device": "^0.114.0",
|
|
44
|
+
"@siteimprove/alfa-earl": "^0.114.0",
|
|
45
|
+
"@siteimprove/alfa-equatable": "^0.114.0",
|
|
46
|
+
"@siteimprove/alfa-flags": "^0.114.0",
|
|
47
|
+
"@siteimprove/alfa-iterable": "^0.114.0",
|
|
48
|
+
"@siteimprove/alfa-json": "^0.114.0",
|
|
49
|
+
"@siteimprove/alfa-lazy": "^0.114.0",
|
|
50
|
+
"@siteimprove/alfa-map": "^0.114.0",
|
|
51
|
+
"@siteimprove/alfa-option": "^0.114.0",
|
|
52
|
+
"@siteimprove/alfa-parser": "^0.114.0",
|
|
53
|
+
"@siteimprove/alfa-predicate": "^0.114.0",
|
|
54
|
+
"@siteimprove/alfa-rectangle": "^0.114.0",
|
|
55
|
+
"@siteimprove/alfa-refinement": "^0.114.0",
|
|
56
|
+
"@siteimprove/alfa-result": "^0.114.0",
|
|
57
|
+
"@siteimprove/alfa-sarif": "^0.114.0",
|
|
58
|
+
"@siteimprove/alfa-sequence": "^0.114.0",
|
|
59
|
+
"@siteimprove/alfa-slice": "^0.114.0",
|
|
60
|
+
"@siteimprove/alfa-string": "^0.114.0",
|
|
61
|
+
"@siteimprove/alfa-trampoline": "^0.114.0",
|
|
62
|
+
"@siteimprove/alfa-tree": "^0.114.0"
|
|
64
63
|
},
|
|
65
64
|
"devDependencies": {
|
|
66
|
-
"@siteimprove/alfa-test": "^0.
|
|
67
|
-
"@types/jsdom": "^
|
|
68
|
-
"jsdom": "^
|
|
65
|
+
"@siteimprove/alfa-test": "^0.114.0",
|
|
66
|
+
"@types/jsdom": "^28.0.1",
|
|
67
|
+
"jsdom": "^29.0.1"
|
|
69
68
|
},
|
|
70
69
|
"publishConfig": {
|
|
71
70
|
"access": "public",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./predicate/has-attribute.js";
|
|
2
|
-
export * from "./predicate/has-display-size.js";
|
|
3
|
-
export * from "./predicate/has-id.js";
|
|
4
|
-
export * from "./predicate/has-input-type.js";
|
|
5
|
-
export * from "./predicate/has-name.js";
|
|
6
|
-
export * from "./predicate/has-namespace.js";
|
|
7
|
-
export * from "./predicate/has-tab-index.js";
|
|
8
|
-
export * from "./predicate/has-unique-id.js";
|
|
9
|
-
export * from "./predicate/is-actually-disabled.js";
|
|
10
|
-
export * from "./predicate/is-browsing-context-container.js";
|
|
11
|
-
export * from "./predicate/is-content.js";
|
|
12
|
-
export * from "./predicate/is-document-element.js";
|
|
13
|
-
export * from "./predicate/is-draggable.js";
|
|
14
|
-
export * from "./predicate/is-editing-host.js";
|
|
15
|
-
export * from "./predicate/is-fallback.js";
|
|
16
|
-
export * from "./predicate/is-replaced.js";
|
|
17
|
-
export * from "./predicate/is-scoped-to.js";
|
|
18
|
-
export * from "./predicate/is-suggested-focusable.js";
|
|
19
|
-
//# sourceMappingURL=predicate.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./predicate/has-attribute.js";
|
|
2
|
-
export * from "./predicate/has-display-size.js";
|
|
3
|
-
export * from "./predicate/has-id.js";
|
|
4
|
-
export * from "./predicate/has-input-type.js";
|
|
5
|
-
export * from "./predicate/has-name.js";
|
|
6
|
-
export * from "./predicate/has-namespace.js";
|
|
7
|
-
export * from "./predicate/has-tab-index.js";
|
|
8
|
-
export * from "./predicate/has-unique-id.js";
|
|
9
|
-
export * from "./predicate/is-actually-disabled.js";
|
|
10
|
-
export * from "./predicate/is-browsing-context-container.js";
|
|
11
|
-
export * from "./predicate/is-content.js";
|
|
12
|
-
export * from "./predicate/is-document-element.js";
|
|
13
|
-
export * from "./predicate/is-draggable.js";
|
|
14
|
-
export * from "./predicate/is-editing-host.js";
|
|
15
|
-
export * from "./predicate/is-fallback.js";
|
|
16
|
-
export * from "./predicate/is-replaced.js";
|
|
17
|
-
export * from "./predicate/is-scoped-to.js";
|
|
18
|
-
export * from "./predicate/is-suggested-focusable.js";
|
|
19
|
-
//# sourceMappingURL=predicate.js.map
|
package/dist/node/predicate.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./predicate/has-box.js";
|
|
2
|
-
export * from "./predicate/has-child.js";
|
|
3
|
-
export * from "./predicate/has-descendant.js";
|
|
4
|
-
export * from "./predicate/has-inclusive-descendant.js";
|
|
5
|
-
export * from "./predicate/has-text-content.js";
|
|
6
|
-
export * from "./predicate/is-root.js";
|
|
7
|
-
//# sourceMappingURL=predicate.d.ts.map
|
package/dist/node/predicate.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./predicate/has-box.js";
|
|
2
|
-
export * from "./predicate/has-child.js";
|
|
3
|
-
export * from "./predicate/has-descendant.js";
|
|
4
|
-
export * from "./predicate/has-inclusive-descendant.js";
|
|
5
|
-
export * from "./predicate/has-text-content.js";
|
|
6
|
-
export * from "./predicate/is-root.js";
|
|
7
|
-
//# sourceMappingURL=predicate.js.map
|
package/dist/node/slot.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Element } from "./element.js";
|
|
2
|
-
import { Slotable } from "./slotable.js";
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export interface Slot extends Element {
|
|
7
|
-
/**
|
|
8
|
-
* Get the slotables assigned to this slot.
|
|
9
|
-
*
|
|
10
|
-
* {@link https://html.spec.whatwg.org/#dom-slot-assignednodes}
|
|
11
|
-
*/
|
|
12
|
-
assignedNodes(): Iterable<Slotable>;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export declare namespace Slot {
|
|
18
|
-
function isSlot(element: Element): boolean;
|
|
19
|
-
function isSlot(value: unknown): value is Slot;
|
|
20
|
-
/**
|
|
21
|
-
* {@link https://dom.spec.whatwg.org/#slot-name}
|
|
22
|
-
*/
|
|
23
|
-
function name(slot: Slot): string;
|
|
24
|
-
/**
|
|
25
|
-
* {@link https://dom.spec.whatwg.org/#find-slotables}
|
|
26
|
-
*/
|
|
27
|
-
function findSlotables(slot: Slot): Iterable<Slotable>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=slot.d.ts.map
|
package/dist/node/slot.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Element } from "./element.js";
|
|
2
|
-
import { Shadow } from "./shadow.js";
|
|
3
|
-
import { Slotable } from "./slotable.js";
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export var Slot;
|
|
8
|
-
(function (Slot) {
|
|
9
|
-
function isSlot(value) {
|
|
10
|
-
return Element.isElement(value) && value.name === "slot";
|
|
11
|
-
}
|
|
12
|
-
Slot.isSlot = isSlot;
|
|
13
|
-
/**
|
|
14
|
-
* {@link https://dom.spec.whatwg.org/#slot-name}
|
|
15
|
-
*/
|
|
16
|
-
function name(slot) {
|
|
17
|
-
return slot
|
|
18
|
-
.attribute("name")
|
|
19
|
-
.map((name) => name.value)
|
|
20
|
-
.getOr("");
|
|
21
|
-
}
|
|
22
|
-
Slot.name = name;
|
|
23
|
-
/**
|
|
24
|
-
* {@link https://dom.spec.whatwg.org/#find-slotables}
|
|
25
|
-
*/
|
|
26
|
-
function* findSlotables(slot) {
|
|
27
|
-
const root = slot.root();
|
|
28
|
-
if (Shadow.isShadow(root)) {
|
|
29
|
-
for (const host of root.host) {
|
|
30
|
-
for (const child of host.children()) {
|
|
31
|
-
if (Slotable.isSlotable(child) &&
|
|
32
|
-
child.assignedSlot().includes(slot)) {
|
|
33
|
-
yield child;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
Slot.findSlotables = findSlotables;
|
|
40
|
-
})(Slot || (Slot = {}));
|
|
41
|
-
//# sourceMappingURL=slot.js.map
|
package/dist/node/slotable.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Option } from "@siteimprove/alfa-option";
|
|
2
|
-
import type { Node } from "../node.js";
|
|
3
|
-
import { Slot } from "./slot.js";
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface Slotable extends Node {
|
|
8
|
-
/**
|
|
9
|
-
* Get the slot that this slotable is assigned to.
|
|
10
|
-
*
|
|
11
|
-
* {@link https://dom.spec.whatwg.org/#dom-slotable-assignedslot}
|
|
12
|
-
*/
|
|
13
|
-
assignedSlot(): Option<Slot>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export declare namespace Slotable {
|
|
19
|
-
function isSlotable(value: unknown): value is Slotable;
|
|
20
|
-
/**
|
|
21
|
-
* {@link https://dom.spec.whatwg.org/#slotable-name}
|
|
22
|
-
*/
|
|
23
|
-
function name(slotable: Slotable): string;
|
|
24
|
-
/**
|
|
25
|
-
* {@link https://dom.spec.whatwg.org/#find-a-slot}
|
|
26
|
-
*/
|
|
27
|
-
function findSlot(slotable: Slotable): Option<Slot>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=slotable.d.ts.map
|