@markuplint/ml-core 3.0.0-alpha.66 → 3.0.0-dev.24

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.
Files changed (94) hide show
  1. package/README.md +12 -3
  2. package/lib/configs.browser.d.ts +2 -0
  3. package/lib/configs.browser.js +12 -0
  4. package/lib/configs.js +5 -1
  5. package/lib/ml-core.d.ts +3 -3
  6. package/lib/ml-core.js +13 -7
  7. package/lib/ml-dom/helper/accname.d.ts +2 -1
  8. package/lib/ml-dom/helper/accname.js +51 -2
  9. package/lib/ml-dom/helper/create-node.d.ts +2 -2
  10. package/lib/ml-dom/helper/create-node.js +1 -1
  11. package/lib/ml-dom/helper/debug.js +1 -1
  12. package/lib/ml-dom/helper/getIndent.d.ts +1 -1
  13. package/lib/ml-dom/helper/walkers.d.ts +2 -2
  14. package/lib/ml-dom/index.d.ts +1 -0
  15. package/lib/ml-dom/node/attr.d.ts +5 -5
  16. package/lib/ml-dom/node/attr.js +18 -12
  17. package/lib/ml-dom/node/block.d.ts +1 -1
  18. package/lib/ml-dom/node/character-data.d.ts +2 -2
  19. package/lib/ml-dom/node/child-node.d.ts +1 -1
  20. package/lib/ml-dom/node/document-fragment.d.ts +2 -2
  21. package/lib/ml-dom/node/document-type.d.ts +1 -1
  22. package/lib/ml-dom/node/document.d.ts +66 -21
  23. package/lib/ml-dom/node/document.js +72 -17
  24. package/lib/ml-dom/node/dom-token-list.d.ts +3 -3
  25. package/lib/ml-dom/node/dom-token-list.js +6 -6
  26. package/lib/ml-dom/node/element.d.ts +105 -30
  27. package/lib/ml-dom/node/element.js +279 -58
  28. package/lib/ml-dom/node/node-list.d.ts +1 -1
  29. package/lib/ml-dom/node/node-store.d.ts +3 -3
  30. package/lib/ml-dom/node/node.d.ts +21 -14
  31. package/lib/ml-dom/node/node.js +38 -29
  32. package/lib/ml-dom/node/parent-node.d.ts +2 -2
  33. package/lib/ml-dom/node/rule-mapper.d.ts +2 -2
  34. package/lib/ml-dom/node/types.d.ts +25 -15
  35. package/lib/ml-dom/token/token.d.ts +1 -1
  36. package/lib/ml-rule/ml-rule-context.d.ts +2 -1
  37. package/lib/ml-rule/ml-rule-context.js +19 -2
  38. package/lib/ml-rule/ml-rule.d.ts +5 -5
  39. package/lib/ml-rule/ml-rule.js +11 -12
  40. package/lib/ml-rule/types.d.ts +7 -7
  41. package/lib/plugin/types.d.ts +3 -3
  42. package/lib/test/index.d.ts +3 -2
  43. package/lib/test/index.js +5 -3
  44. package/lib/types.d.ts +5 -4
  45. package/package.json +14 -12
  46. package/tsconfig.tsbuildinfo +1 -1
  47. package/lib/ml-dom/document.d.ts +0 -94
  48. package/lib/ml-dom/document.js +0 -273
  49. package/lib/ml-dom/helper/index.d.ts +0 -4
  50. package/lib/ml-dom/helper/index.js +0 -12
  51. package/lib/ml-dom/helper/mapped-nodes.d.ts +0 -52
  52. package/lib/ml-dom/helper/mapped-nodes.js +0 -2
  53. package/lib/ml-dom/helper/match-selector.d.ts +0 -20
  54. package/lib/ml-dom/helper/match-selector.js +0 -233
  55. package/lib/ml-dom/helper/node-store.d.ts +0 -12
  56. package/lib/ml-dom/helper/node-store.js +0 -28
  57. package/lib/ml-dom/helper/selector.d.ts +0 -11
  58. package/lib/ml-dom/helper/selector.js +0 -549
  59. package/lib/ml-dom/rule-mapper.d.ts +0 -16
  60. package/lib/ml-dom/rule-mapper.js +0 -57
  61. package/lib/ml-dom/tokens/abstract-element.d.ts +0 -54
  62. package/lib/ml-dom/tokens/abstract-element.js +0 -249
  63. package/lib/ml-dom/tokens/attribute.d.ts +0 -42
  64. package/lib/ml-dom/tokens/attribute.js +0 -85
  65. package/lib/ml-dom/tokens/comment.d.ts +0 -12
  66. package/lib/ml-dom/tokens/comment.js +0 -15
  67. package/lib/ml-dom/tokens/doctype.d.ts +0 -18
  68. package/lib/ml-dom/tokens/doctype.js +0 -32
  69. package/lib/ml-dom/tokens/element-close-tag.d.ts +0 -27
  70. package/lib/ml-dom/tokens/element-close-tag.js +0 -45
  71. package/lib/ml-dom/tokens/element.d.ts +0 -26
  72. package/lib/ml-dom/tokens/element.js +0 -66
  73. package/lib/ml-dom/tokens/index.d.ts +0 -10
  74. package/lib/ml-dom/tokens/index.js +0 -26
  75. package/lib/ml-dom/tokens/node.d.ts +0 -46
  76. package/lib/ml-dom/tokens/node.js +0 -126
  77. package/lib/ml-dom/tokens/omitted-element.d.ts +0 -13
  78. package/lib/ml-dom/tokens/omitted-element.js +0 -12
  79. package/lib/ml-dom/tokens/preprocessor-specific-attribute.d.ts +0 -24
  80. package/lib/ml-dom/tokens/preprocessor-specific-attribute.js +0 -37
  81. package/lib/ml-dom/tokens/preprocessor-specific-block.d.ts +0 -14
  82. package/lib/ml-dom/tokens/preprocessor-specific-block.js +0 -16
  83. package/lib/ml-dom/tokens/text.d.ts +0 -19
  84. package/lib/ml-dom/tokens/text.js +0 -26
  85. package/lib/ml-dom/tokens/token.d.ts +0 -16
  86. package/lib/ml-dom/tokens/token.js +0 -55
  87. package/lib/ml-dom/types.d.ts +0 -49
  88. package/lib/ml-dom/types.js +0 -2
  89. package/lib/selector/is-pure-html-element.d.ts +0 -1
  90. package/lib/selector/is-pure-html-element.js +0 -7
  91. package/lib/selector/match-selector.d.ts +0 -14
  92. package/lib/selector/match-selector.js +0 -230
  93. package/lib/selector/selector.d.ts +0 -9
  94. package/lib/selector/selector.js +0 -561
@@ -30,14 +30,15 @@ class MLDocument extends parent_node_1.MLParentNode {
30
30
  /**
31
31
  *
32
32
  */
33
- _MLDocument_filename.set(this, void 0);
34
- _MLDocument_tokenList.set(this, null);
33
+ this.currentRule = null;
35
34
  /**
36
35
  *
37
36
  */
38
- this.currentRule = null;
37
+ _MLDocument_filename.set(this, void 0);
38
+ _MLDocument_tokenList.set(this, null);
39
39
  this.isFragment = ast.isFragment;
40
40
  this.specs = (0, ml_spec_1.schemaToSpec)(schemas);
41
+ this.booleanish = (options === null || options === void 0 ? void 0 : options.booleanish) || false;
41
42
  this.endTag = (_a = options === null || options === void 0 ? void 0 : options.endTag) !== null && _a !== void 0 ? _a : 'omittable';
42
43
  tslib_1.__classPrivateFieldSet(this, _MLDocument_filename, options === null || options === void 0 ? void 0 : options.filename, "f");
43
44
  // console.log(ast.nodeList.map((n, i) => `${i}: ${n.uuid} "${n.raw.trim()}"(${n.type})`));
@@ -49,8 +50,18 @@ class MLDocument extends parent_node_1.MLParentNode {
49
50
  return (0, create_node_1.createNode)(astNode, this);
50
51
  })
51
52
  .filter((n) => !!n));
53
+ this._pretending(options === null || options === void 0 ? void 0 : options.pretenders);
52
54
  this._ruleMapping(ruleset);
53
55
  }
56
+ /**
57
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
58
+ *
59
+ * @unsupported
60
+ * @implements DOM API: `Document`
61
+ */
62
+ get URL() {
63
+ throw new unexpected_call_error_1.default('Not supported "URL" property');
64
+ }
54
65
  /**
55
66
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
56
67
  *
@@ -60,6 +71,15 @@ class MLDocument extends parent_node_1.MLParentNode {
60
71
  get activeElement() {
61
72
  throw new unexpected_call_error_1.default('Not supported "activeElement" property');
62
73
  }
74
+ /**
75
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
76
+ *
77
+ * @unsupported
78
+ * @implements DOM API: `Document`
79
+ */
80
+ get adoptedStyleSheets() {
81
+ throw new unexpected_call_error_1.default('Not supported "adoptedStyleSheets" property');
82
+ }
63
83
  /**
64
84
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
65
85
  *
@@ -320,7 +340,7 @@ class MLDocument extends parent_node_1.MLParentNode {
320
340
  * @implements DOM API: `Document`
321
341
  */
322
342
  get fullscreenEnabled() {
323
- throw new unexpected_call_error_1.default('Not supported "UfullscreenEnabledRL" property');
343
+ throw new unexpected_call_error_1.default('Not supported "FullscreenEnabledURL" property');
324
344
  }
325
345
  /**
326
346
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
@@ -479,6 +499,16 @@ class MLDocument extends parent_node_1.MLParentNode {
479
499
  get onauxclick() {
480
500
  throw new unexpected_call_error_1.default('Not supported "onauxclick" property');
481
501
  }
502
+ /**
503
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
504
+ *
505
+ * @deprecated
506
+ * @unsupported
507
+ * @implements DOM API: `Document`
508
+ */
509
+ get onbeforeinput() {
510
+ throw new unexpected_call_error_1.default('Not supported "onbeforeinput" property');
511
+ }
482
512
  /**
483
513
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
484
514
  *
@@ -489,6 +519,16 @@ class MLDocument extends parent_node_1.MLParentNode {
489
519
  get onblur() {
490
520
  throw new unexpected_call_error_1.default('Not supported "onblur" property');
491
521
  }
522
+ /**
523
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
524
+ *
525
+ * @deprecated
526
+ * @unsupported
527
+ * @implements DOM API: `Document`
528
+ */
529
+ get oncancel() {
530
+ throw new unexpected_call_error_1.default('Not supported "oncanplay" property');
531
+ }
492
532
  /**
493
533
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
494
534
  *
@@ -1481,15 +1521,6 @@ class MLDocument extends parent_node_1.MLParentNode {
1481
1521
  get title() {
1482
1522
  throw new unexpected_call_error_1.default('Not supported "title" property');
1483
1523
  }
1484
- /**
1485
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
1486
- *
1487
- * @unsupported
1488
- * @implements DOM API: `Document`
1489
- */
1490
- get URL() {
1491
- throw new unexpected_call_error_1.default('Not supported "URL" property');
1492
- }
1493
1524
  /**
1494
1525
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1495
1526
  *
@@ -1643,8 +1674,8 @@ class MLDocument extends parent_node_1.MLParentNode {
1643
1674
  * @unsupported
1644
1675
  * @implements DOM API: `Document`
1645
1676
  */
1646
- createNodeIterator(root, whatToShow, filter) {
1647
- throw new unexpected_call_error_1.default('Not supported "createNodeIterator" method');
1677
+ createNSResolver(nodeResolver) {
1678
+ throw new unexpected_call_error_1.default('Not supported "createNSResolver" method');
1648
1679
  }
1649
1680
  /**
1650
1681
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
@@ -1652,8 +1683,8 @@ class MLDocument extends parent_node_1.MLParentNode {
1652
1683
  * @unsupported
1653
1684
  * @implements DOM API: `Document`
1654
1685
  */
1655
- createNSResolver(nodeResolver) {
1656
- throw new unexpected_call_error_1.default('Not supported "createNSResolver" method');
1686
+ createNodeIterator(root, whatToShow, filter) {
1687
+ throw new unexpected_call_error_1.default('Not supported "createNodeIterator" method');
1657
1688
  }
1658
1689
  /**
1659
1690
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
@@ -1945,6 +1976,17 @@ class MLDocument extends parent_node_1.MLParentNode {
1945
1976
  requestStorageAccess() {
1946
1977
  throw new unexpected_call_error_1.default('Not supported "requestStorageAccess" method');
1947
1978
  }
1979
+ /**
1980
+ * @implements `@markuplint/ml-core` API: `MLDocument`
1981
+ */
1982
+ searchNodeByLocation(line, col) {
1983
+ for (const node of this.nodeList) {
1984
+ if (node.startLine <= line && line <= node.endLine && node.startCol <= col && col <= node.endCol) {
1985
+ return node;
1986
+ }
1987
+ }
1988
+ return null;
1989
+ }
1948
1990
  /**
1949
1991
  * @implements `@markuplint/ml-core` API: `MLDocument`
1950
1992
  */
@@ -2001,6 +2043,19 @@ class MLDocument extends parent_node_1.MLParentNode {
2001
2043
  writeln(...text) {
2002
2044
  throw new unexpected_call_error_1.default('Not supported "writeln" method');
2003
2045
  }
2046
+ _pretending(pretenders) {
2047
+ if (docLog.enabled) {
2048
+ docLog('Pretending: %O', pretenders);
2049
+ }
2050
+ if (!pretenders) {
2051
+ return;
2052
+ }
2053
+ for (const node of this.nodeList) {
2054
+ if (node.is(node.ELEMENT_NODE)) {
2055
+ node.pretending(pretenders);
2056
+ }
2057
+ }
2058
+ }
2004
2059
  _ruleMapping(ruleset) {
2005
2060
  if (docLog.enabled) {
2006
2061
  docLog('Rule Mapping: %O', Object.keys(ruleset.rules));
@@ -1,6 +1,6 @@
1
1
  import type { MLAttr } from './attr';
2
2
  import type { RuleInfo } from '@markuplint/ml-config';
3
- declare type Scope = {
3
+ type Scope = {
4
4
  raw: string;
5
5
  startOffset: number;
6
6
  startLine: number;
@@ -9,8 +9,8 @@ declare type Scope = {
9
9
  };
10
10
  export declare class MLDomTokenList extends Array<string> implements DOMTokenList {
11
11
  #private;
12
- get value(): string;
13
12
  constructor(tokens: string, ownerAttrs: MLAttr<any, any>[]);
13
+ get value(): string;
14
14
  add(...tokens: string[]): void;
15
15
  /**
16
16
  * @implements `@markuplint/ml-core` API: `MLDomTokenList`
@@ -26,8 +26,8 @@ export declare class MLDomTokenList extends Array<string> implements DOMTokenLis
26
26
  remove(...tokens: string[]): void;
27
27
  replace(token: string, newToken: string): boolean;
28
28
  supports(token: string): boolean;
29
- toggle(token: string, force?: boolean): boolean;
30
29
  toString(): string;
30
+ toggle(token: string, force?: boolean): boolean;
31
31
  private _pick;
32
32
  }
33
33
  export {};
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var _MLDomTokenList_set, _MLDomTokenList_origin, _MLDomTokenList_ownerAttrs;
2
+ var _MLDomTokenList_origin, _MLDomTokenList_ownerAttrs, _MLDomTokenList_set;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MLDomTokenList = void 0;
5
5
  const tslib_1 = require("tslib");
@@ -12,13 +12,13 @@ class MLDomTokenList extends Array {
12
12
  .map(t => t.trim())
13
13
  .filter(t => !!t);
14
14
  super(...list);
15
- _MLDomTokenList_set.set(this, void 0);
16
15
  _MLDomTokenList_origin.set(this, void 0);
17
16
  /**
18
17
  * In some cases, an author specifies multiple attributes or directives.
19
18
  * The reference is not always one.
20
19
  */
21
20
  _MLDomTokenList_ownerAttrs.set(this, void 0);
21
+ _MLDomTokenList_set.set(this, void 0);
22
22
  tslib_1.__classPrivateFieldSet(this, _MLDomTokenList_origin, tokens, "f");
23
23
  tslib_1.__classPrivateFieldSet(this, _MLDomTokenList_ownerAttrs, ownerAttrs, "f");
24
24
  tslib_1.__classPrivateFieldSet(this, _MLDomTokenList_set, new Set(list), "f");
@@ -99,12 +99,12 @@ class MLDomTokenList extends Array {
99
99
  supports(token) {
100
100
  throw new unexpected_call_error_1.default('Not supported "supports" method');
101
101
  }
102
- toggle(token, force) {
103
- throw new unexpected_call_error_1.default('Not supported "toggle" method');
104
- }
105
102
  toString() {
106
103
  return this.value;
107
104
  }
105
+ toggle(token, force) {
106
+ throw new unexpected_call_error_1.default('Not supported "toggle" method');
107
+ }
108
108
  _pick(token, _offset = 0) {
109
109
  var _a, _b, _c, _d, _e, _f;
110
110
  token = token.trim().split(/\s+/g)[0];
@@ -134,4 +134,4 @@ class MLDomTokenList extends Array {
134
134
  }
135
135
  }
136
136
  exports.MLDomTokenList = MLDomTokenList;
137
- _MLDomTokenList_set = new WeakMap(), _MLDomTokenList_origin = new WeakMap(), _MLDomTokenList_ownerAttrs = new WeakMap();
137
+ _MLDomTokenList_origin = new WeakMap(), _MLDomTokenList_ownerAttrs = new WeakMap(), _MLDomTokenList_set = new WeakMap();
@@ -1,9 +1,10 @@
1
1
  import type { MLDocument } from './document';
2
2
  import type { MLNamedNodeMap } from './named-node-map';
3
3
  import type { MLText } from './text';
4
- import type { ElementNodeType } from './types';
5
- import type { MLASTElement, NamespaceURI } from '@markuplint/ml-ast';
6
- import type { RuleConfigValue } from '@markuplint/ml-config';
4
+ import type { ElementNodeType, PretenderContext } from './types';
5
+ import type { ElementType, MLASTElement, NamespaceURI } from '@markuplint/ml-ast';
6
+ import type { Pretender, RuleConfigValue, RuleInfo } from '@markuplint/ml-config';
7
+ import type { ARIAVersion } from '@markuplint/ml-spec';
7
8
  import { MLToken } from '../token/token';
8
9
  import { MLAttr } from './attr';
9
10
  import { MLDomTokenList } from './dom-token-list';
@@ -11,9 +12,9 @@ import { MLParentNode } from './parent-node';
11
12
  export declare class MLElement<T extends RuleConfigValue, O = null> extends MLParentNode<T, O, MLASTElement> implements Element, HTMLOrSVGElement, HTMLElement {
12
13
  #private;
13
14
  readonly closeTag: MLToken | null;
15
+ readonly elementType: ElementType;
14
16
  readonly endSpace: MLToken | null;
15
17
  readonly hasSpreadAttr: boolean;
16
- readonly isCustomElement: boolean;
17
18
  readonly isForeignElement: boolean;
18
19
  readonly isOmitted: boolean;
19
20
  readonly namespaceURI: NamespaceURI;
@@ -21,7 +22,9 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
21
22
  readonly ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
22
23
  readonly ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
23
24
  readonly ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
25
+ pretenderContext: PretenderContext<MLElement<T, O>, T, O> | null;
24
26
  readonly selfClosingSolidus: MLToken | null;
27
+ constructor(astNode: MLASTElement, document: MLDocument<T, O>);
25
28
  /**
26
29
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
27
30
  *
@@ -86,6 +89,14 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
86
89
  * @implements DOM API: `Element`
87
90
  */
88
91
  get ariaColIndex(): string | null;
92
+ /**
93
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
94
+ *
95
+ * @deprecated
96
+ * @unsupported
97
+ * @implements DOM API: `Element`
98
+ */
99
+ get ariaColIndexText(): string | null;
89
100
  /**
90
101
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
91
102
  *
@@ -134,6 +145,14 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
134
145
  * @implements DOM API: `Element`
135
146
  */
136
147
  get ariaHidden(): string | null;
148
+ /**
149
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
150
+ *
151
+ * @deprecated
152
+ * @unsupported
153
+ * @implements DOM API: `Element`
154
+ */
155
+ get ariaInvalid(): string | null;
137
156
  /**
138
157
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
139
158
  *
@@ -262,6 +281,14 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
262
281
  * @implements DOM API: `Element`
263
282
  */
264
283
  get ariaRowIndex(): string | null;
284
+ /**
285
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
286
+ *
287
+ * @deprecated
288
+ * @unsupported
289
+ * @implements DOM API: `Element`
290
+ */
291
+ get ariaRowIndexText(): string | null;
265
292
  /**
266
293
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
267
294
  *
@@ -454,6 +481,15 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
454
481
  * @see https://dom.spec.whatwg.org/#ref-for-dom-element-id%E2%91%A0
455
482
  */
456
483
  get id(): string;
484
+ /**
485
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
486
+ *
487
+ * @deprecated
488
+ * @unsupported
489
+ * @implements DOM API: `Element`
490
+ * @see https://html.spec.whatwg.org/multipage/interaction.html#dom-inert
491
+ */
492
+ get inert(): boolean;
457
493
  /**
458
494
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
459
495
  *
@@ -624,6 +660,14 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
624
660
  * @implements DOM API: `Element`
625
661
  */
626
662
  get onauxclick(): ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
663
+ /**
664
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
665
+ *
666
+ * @deprecated
667
+ * @unsupported
668
+ * @implements DOM API: `Element`
669
+ */
670
+ get onbeforeinput(): ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
627
671
  /**
628
672
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
629
673
  *
@@ -632,6 +676,14 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
632
676
  * @implements DOM API: `Element`
633
677
  */
634
678
  get onblur(): ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
679
+ /**
680
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
681
+ *
682
+ * @deprecated
683
+ * @unsupported
684
+ * @implements DOM API: `Element`
685
+ */
686
+ get oncancel(): ((this: GlobalEventHandlers, ev: Event) => any) | null;
635
687
  /**
636
688
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
637
689
  *
@@ -1341,6 +1393,18 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1341
1393
  * @implements `@markuplint/ml-core` API: `MLElement`
1342
1394
  */
1343
1395
  get rawName(): string;
1396
+ /**
1397
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
1398
+ *
1399
+ * @unsupported
1400
+ * @implements DOM API: `Element`
1401
+ * @see https://w3c.github.io/aria/#ARIAMixin
1402
+ */
1403
+ get role(): string;
1404
+ /**
1405
+ * @implements `@markuplint/ml-core` API: `MLNode`
1406
+ */
1407
+ get rule(): RuleInfo<T, O>;
1344
1408
  /**
1345
1409
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1346
1410
  *
@@ -1444,7 +1508,6 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1444
1508
  * @implements DOM API: `Element`
1445
1509
  */
1446
1510
  get translate(): boolean;
1447
- constructor(astNode: MLASTElement, document: MLDocument<T, O>);
1448
1511
  /**
1449
1512
  * @implements DOM API: `Element`
1450
1513
  */
@@ -1510,7 +1573,7 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1510
1573
  /**
1511
1574
  * @implements `@markuplint/ml-core` API: `MLElement`
1512
1575
  */
1513
- getAccessibleName(): string;
1576
+ getAccessibleName(version: ARIAVersion): string;
1514
1577
  /**
1515
1578
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1516
1579
  *
@@ -1524,6 +1587,14 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1524
1587
  * @see https://dom.spec.whatwg.org/#ref-for-dom-element-getattribute%E2%91%A0
1525
1588
  */
1526
1589
  getAttribute(attrName: string): string | null;
1590
+ /**
1591
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
1592
+ *
1593
+ * @unsupported
1594
+ * @implements DOM API: `Element`
1595
+ * @see https://dom.spec.whatwg.org/#dom-element-getattributenodens
1596
+ */
1597
+ getAttributeNS(namespace: string | null, localName: string): string | null;
1527
1598
  /**
1528
1599
  * @implements DOM API: `Element`
1529
1600
  * @see https://dom.spec.whatwg.org/#ref-for-dom-element-getattributenames%E2%91%A0
@@ -1543,13 +1614,9 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1543
1614
  */
1544
1615
  getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
1545
1616
  /**
1546
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
1547
- *
1548
- * @unsupported
1549
- * @implements DOM API: `Element`
1550
- * @see https://dom.spec.whatwg.org/#dom-element-getattributenodens
1617
+ * @implements `@markuplint/ml-core` API: `MLElement`
1551
1618
  */
1552
- getAttributeNS(namespace: string | null, localName: string): string | null;
1619
+ getAttributePretended(attrName: string): string | null;
1553
1620
  /**
1554
1621
  * @implements `@markuplint/ml-core` API: `MLElement`
1555
1622
  */
@@ -1665,11 +1732,19 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1665
1732
  * @implements `@markuplint/ml-core` API: `MLElement`
1666
1733
  */
1667
1734
  isDescendantByUUIDList(uuidList: string[]): boolean;
1735
+ /**
1736
+ * @implements `@markuplint/ml-core` API: `MLElement`
1737
+ */
1738
+ isEmpty(): boolean;
1668
1739
  /**
1669
1740
  * @implements DOM API: `Element`
1670
1741
  * @see https://dom.spec.whatwg.org/#ref-for-dom-element-matches%E2%91%A0
1671
1742
  */
1672
1743
  matches(selector: string): boolean;
1744
+ /**
1745
+ * Pretenders Initialization
1746
+ */
1747
+ pretending(pretenders: Pretender[]): void;
1673
1748
  /**
1674
1749
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1675
1750
  *
@@ -1695,17 +1770,17 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1695
1770
  *
1696
1771
  * @unsupported
1697
1772
  * @implements DOM API: `Element`
1698
- * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-D589198
1773
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-element-removeattributens%E2%91%A0
1699
1774
  */
1700
- removeAttributeNode(attr: Attr): Attr;
1775
+ removeAttributeNS(namespace: string | null, localName: string): void;
1701
1776
  /**
1702
1777
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1703
1778
  *
1704
1779
  * @unsupported
1705
1780
  * @implements DOM API: `Element`
1706
- * @see https://dom.spec.whatwg.org/#ref-for-dom-element-removeattributens%E2%91%A0
1781
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-D589198
1707
1782
  */
1708
- removeAttributeNS(namespace: string | null, localName: string): void;
1783
+ removeAttributeNode(attr: Attr): Attr;
1709
1784
  /**
1710
1785
  * @implements DOM API: `Element`
1711
1786
  */
@@ -1771,25 +1846,25 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1771
1846
  *
1772
1847
  * @unsupported
1773
1848
  * @implements DOM API: `Element`
1774
- * @see https://dom.spec.whatwg.org/#dom-element-setattributenode
1849
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-element-setattributens%E2%91%A0
1775
1850
  */
1776
- setAttributeNode(attr: Attr): Attr | null;
1851
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
1777
1852
  /**
1778
1853
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1779
1854
  *
1780
1855
  * @unsupported
1781
1856
  * @implements DOM API: `Element`
1782
- * @see https://dom.spec.whatwg.org/#dom-element-setattributenodens
1857
+ * @see https://dom.spec.whatwg.org/#dom-element-setattributenode
1783
1858
  */
1784
- setAttributeNodeNS(attr: Attr): Attr | null;
1859
+ setAttributeNode(attr: Attr): Attr | null;
1785
1860
  /**
1786
1861
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1787
1862
  *
1788
1863
  * @unsupported
1789
1864
  * @implements DOM API: `Element`
1790
- * @see https://dom.spec.whatwg.org/#ref-for-dom-element-setattributens%E2%91%A0
1865
+ * @see https://dom.spec.whatwg.org/#dom-element-setattributenodens
1791
1866
  */
1792
- setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
1867
+ setAttributeNodeNS(attr: Attr): Attr | null;
1793
1868
  /**
1794
1869
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1795
1870
  *
@@ -1798,14 +1873,6 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1798
1873
  * @see https://www.w3.org/TR/pointerevents2/#idl-def-element-setpointercapture-pointerid
1799
1874
  */
1800
1875
  setPointerCapture(pointerId: number): void;
1801
- /**
1802
- * **IT THROWS AN ERROR WHEN CALLING THIS.**
1803
- *
1804
- * @unsupported
1805
- * @implements DOM API: `Element`
1806
- * @see https://dom.spec.whatwg.org/#ref-for-dom-element-toggleattribute%E2%91%A0
1807
- */
1808
- toggleAttribute(qualifiedName: string, force?: boolean): boolean;
1809
1876
  /**
1810
1877
  * @implements `@markuplint/ml-core` API: `MLElement`
1811
1878
  */
@@ -1814,6 +1881,14 @@ export declare class MLElement<T extends RuleConfigValue, O = null> extends MLPa
1814
1881
  * @implements `@markuplint/ml-core` API: `MLElement`
1815
1882
  */
1816
1883
  toString(): string;
1884
+ /**
1885
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
1886
+ *
1887
+ * @unsupported
1888
+ * @implements DOM API: `Element`
1889
+ * @see https://dom.spec.whatwg.org/#ref-for-dom-element-toggleattribute%E2%91%A0
1890
+ */
1891
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
1817
1892
  /**
1818
1893
  * **IT THROWS AN ERROR WHEN CALLING THIS.**
1819
1894
  *