html-validate 9.4.0 → 9.4.2-rc.1
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/dist/cjs/core-nodejs.js +1 -1
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +227 -160
- package/dist/cjs/core.js.map +1 -1
- package/dist/es/core-nodejs.js +3 -2
- package/dist/es/core-nodejs.js.map +1 -1
- package/dist/es/core.js +227 -160
- package/dist/es/core.js.map +1 -1
- package/dist/es/html-validate.js +1 -0
- package/dist/es/html-validate.js.map +1 -1
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/jest-worker.js +1 -0
- package/dist/es/jest-worker.js.map +1 -1
- package/dist/es/jest.js +1 -0
- package/dist/es/jest.js.map +1 -1
- package/dist/es/vitest.js +1 -0
- package/dist/es/vitest.js.map +1 -1
- package/dist/types/browser.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/es/core.js
CHANGED
|
@@ -1935,15 +1935,15 @@ function nthChild(node, args) {
|
|
|
1935
1935
|
return cur === n;
|
|
1936
1936
|
}
|
|
1937
1937
|
|
|
1938
|
-
function scope(node) {
|
|
1939
|
-
return node.isSameNode(this.scope);
|
|
1938
|
+
function scope$1(node) {
|
|
1939
|
+
return Boolean(this.scope && node.isSameNode(this.scope));
|
|
1940
1940
|
}
|
|
1941
1941
|
|
|
1942
1942
|
const table = {
|
|
1943
1943
|
"first-child": firstChild,
|
|
1944
1944
|
"last-child": lastChild,
|
|
1945
1945
|
"nth-child": nthChild,
|
|
1946
|
-
scope
|
|
1946
|
+
scope: scope$1
|
|
1947
1947
|
};
|
|
1948
1948
|
function factory(name, context) {
|
|
1949
1949
|
const fn = table[name];
|
|
@@ -1954,139 +1954,12 @@ function factory(name, context) {
|
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
1956
|
|
|
1957
|
-
const escapedCodepoints = ["9", "a", "d"];
|
|
1958
|
-
function* splitSelectorElements(selector) {
|
|
1959
|
-
let begin = 0;
|
|
1960
|
-
let end = 0;
|
|
1961
|
-
function initialState(ch, p) {
|
|
1962
|
-
if (ch === "\\") {
|
|
1963
|
-
return 1 /* ESCAPED */;
|
|
1964
|
-
}
|
|
1965
|
-
if (ch === " ") {
|
|
1966
|
-
end = p;
|
|
1967
|
-
return 2 /* WHITESPACE */;
|
|
1968
|
-
}
|
|
1969
|
-
return 0 /* INITIAL */;
|
|
1970
|
-
}
|
|
1971
|
-
function escapedState(ch) {
|
|
1972
|
-
if (escapedCodepoints.includes(ch)) {
|
|
1973
|
-
return 1 /* ESCAPED */;
|
|
1974
|
-
}
|
|
1975
|
-
return 0 /* INITIAL */;
|
|
1976
|
-
}
|
|
1977
|
-
function* whitespaceState(ch, p) {
|
|
1978
|
-
if (ch === " ") {
|
|
1979
|
-
return 2 /* WHITESPACE */;
|
|
1980
|
-
}
|
|
1981
|
-
yield selector.slice(begin, end);
|
|
1982
|
-
begin = p;
|
|
1983
|
-
end = p;
|
|
1984
|
-
return 0 /* INITIAL */;
|
|
1985
|
-
}
|
|
1986
|
-
let state = 0 /* INITIAL */;
|
|
1987
|
-
for (let p = 0; p < selector.length; p++) {
|
|
1988
|
-
const ch = selector[p];
|
|
1989
|
-
switch (state) {
|
|
1990
|
-
case 0 /* INITIAL */:
|
|
1991
|
-
state = initialState(ch, p);
|
|
1992
|
-
break;
|
|
1993
|
-
case 1 /* ESCAPED */:
|
|
1994
|
-
state = escapedState(ch);
|
|
1995
|
-
break;
|
|
1996
|
-
case 2 /* WHITESPACE */:
|
|
1997
|
-
state = yield* whitespaceState(ch, p);
|
|
1998
|
-
break;
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
if (begin !== selector.length) {
|
|
2002
|
-
yield selector.slice(begin);
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
|
|
2006
1957
|
function stripslashes(value) {
|
|
2007
1958
|
return value.replace(/\\(.)/g, "$1");
|
|
2008
1959
|
}
|
|
2009
|
-
|
|
2010
|
-
const replacement = {
|
|
2011
|
-
"\\9 ": " ",
|
|
2012
|
-
"\\a ": "\n",
|
|
2013
|
-
"\\d ": "\r"
|
|
2014
|
-
};
|
|
2015
|
-
return value.replace(
|
|
2016
|
-
/(\\[\u0039\u0061\u0064] )/g,
|
|
2017
|
-
(_, codepoint) => replacement[codepoint]
|
|
2018
|
-
);
|
|
2019
|
-
}
|
|
2020
|
-
function escapeSelectorComponent(text) {
|
|
2021
|
-
const codepoints = {
|
|
2022
|
-
" ": "\\9 ",
|
|
2023
|
-
"\n": "\\a ",
|
|
2024
|
-
"\r": "\\d "
|
|
2025
|
-
};
|
|
2026
|
-
return text.toString().replace(/([\t\n\r]|[^a-z0-9_-])/gi, (_, ch) => {
|
|
2027
|
-
if (codepoints[ch]) {
|
|
2028
|
-
return codepoints[ch];
|
|
2029
|
-
} else {
|
|
2030
|
-
return `\\${ch}`;
|
|
2031
|
-
}
|
|
2032
|
-
});
|
|
2033
|
-
}
|
|
2034
|
-
function generateIdSelector(id) {
|
|
2035
|
-
const escaped = escapeSelectorComponent(id);
|
|
2036
|
-
return escaped.match(/^\d/) ? `[id="${escaped}"]` : `#${escaped}`;
|
|
2037
|
-
}
|
|
2038
|
-
function isDelimiter(ch) {
|
|
2039
|
-
return /[.#[:]/.test(ch);
|
|
2040
|
-
}
|
|
2041
|
-
function isQuotationMark(ch) {
|
|
2042
|
-
return /['"]/.test(ch);
|
|
2043
|
-
}
|
|
2044
|
-
function isPseudoElement(ch, buffer) {
|
|
2045
|
-
return ch === ":" && buffer === ":";
|
|
2046
|
-
}
|
|
2047
|
-
function* splitPattern(pattern) {
|
|
2048
|
-
if (pattern === "") {
|
|
2049
|
-
return;
|
|
2050
|
-
}
|
|
2051
|
-
const end = pattern.length;
|
|
2052
|
-
let begin = 0;
|
|
2053
|
-
let cur = 1;
|
|
2054
|
-
let quoted = false;
|
|
2055
|
-
while (cur < end) {
|
|
2056
|
-
const ch = pattern[cur];
|
|
2057
|
-
const buffer = pattern.slice(begin, cur);
|
|
2058
|
-
if (ch === "\\") {
|
|
2059
|
-
cur += 2;
|
|
2060
|
-
continue;
|
|
2061
|
-
}
|
|
2062
|
-
if (quoted) {
|
|
2063
|
-
if (ch === quoted) {
|
|
2064
|
-
quoted = false;
|
|
2065
|
-
}
|
|
2066
|
-
cur += 1;
|
|
2067
|
-
continue;
|
|
2068
|
-
}
|
|
2069
|
-
if (isQuotationMark(ch)) {
|
|
2070
|
-
quoted = ch;
|
|
2071
|
-
cur += 1;
|
|
2072
|
-
continue;
|
|
2073
|
-
}
|
|
2074
|
-
if (isPseudoElement(ch, buffer)) {
|
|
2075
|
-
cur += 1;
|
|
2076
|
-
continue;
|
|
2077
|
-
}
|
|
2078
|
-
if (isDelimiter(ch)) {
|
|
2079
|
-
begin = cur;
|
|
2080
|
-
yield buffer;
|
|
2081
|
-
}
|
|
2082
|
-
cur += 1;
|
|
2083
|
-
}
|
|
2084
|
-
const tail = pattern.slice(begin, cur);
|
|
2085
|
-
yield tail;
|
|
2086
|
-
}
|
|
2087
|
-
class Matcher {
|
|
1960
|
+
class Condition {
|
|
2088
1961
|
}
|
|
2089
|
-
class
|
|
1962
|
+
class ClassCondition extends Condition {
|
|
2090
1963
|
classname;
|
|
2091
1964
|
constructor(classname) {
|
|
2092
1965
|
super();
|
|
@@ -2096,7 +1969,7 @@ class ClassMatcher extends Matcher {
|
|
|
2096
1969
|
return node.classList.contains(this.classname);
|
|
2097
1970
|
}
|
|
2098
1971
|
}
|
|
2099
|
-
class
|
|
1972
|
+
class IdCondition extends Condition {
|
|
2100
1973
|
id;
|
|
2101
1974
|
constructor(id) {
|
|
2102
1975
|
super();
|
|
@@ -2106,7 +1979,7 @@ class IdMatcher extends Matcher {
|
|
|
2106
1979
|
return node.id === this.id;
|
|
2107
1980
|
}
|
|
2108
1981
|
}
|
|
2109
|
-
class
|
|
1982
|
+
class AttributeCondition extends Condition {
|
|
2110
1983
|
key;
|
|
2111
1984
|
op;
|
|
2112
1985
|
value;
|
|
@@ -2132,7 +2005,7 @@ class AttrMatcher extends Matcher {
|
|
|
2132
2005
|
});
|
|
2133
2006
|
}
|
|
2134
2007
|
}
|
|
2135
|
-
class
|
|
2008
|
+
class PseudoClassCondition extends Condition {
|
|
2136
2009
|
name;
|
|
2137
2010
|
args;
|
|
2138
2011
|
constructor(pseudoclass, context) {
|
|
@@ -2150,11 +2023,62 @@ class PseudoClassMatcher extends Matcher {
|
|
|
2150
2023
|
return fn(node, this.args);
|
|
2151
2024
|
}
|
|
2152
2025
|
}
|
|
2153
|
-
|
|
2026
|
+
|
|
2027
|
+
function isDelimiter(ch) {
|
|
2028
|
+
return /[.#[:]/.test(ch);
|
|
2029
|
+
}
|
|
2030
|
+
function isQuotationMark(ch) {
|
|
2031
|
+
return /['"]/.test(ch);
|
|
2032
|
+
}
|
|
2033
|
+
function isPseudoElement(ch, buffer) {
|
|
2034
|
+
return ch === ":" && buffer === ":";
|
|
2035
|
+
}
|
|
2036
|
+
function* splitCompound(pattern) {
|
|
2037
|
+
if (pattern === "") {
|
|
2038
|
+
return;
|
|
2039
|
+
}
|
|
2040
|
+
const end = pattern.length;
|
|
2041
|
+
let begin = 0;
|
|
2042
|
+
let cur = 1;
|
|
2043
|
+
let quoted = false;
|
|
2044
|
+
while (cur < end) {
|
|
2045
|
+
const ch = pattern[cur];
|
|
2046
|
+
const buffer = pattern.slice(begin, cur);
|
|
2047
|
+
if (ch === "\\") {
|
|
2048
|
+
cur += 2;
|
|
2049
|
+
continue;
|
|
2050
|
+
}
|
|
2051
|
+
if (quoted) {
|
|
2052
|
+
if (ch === quoted) {
|
|
2053
|
+
quoted = false;
|
|
2054
|
+
}
|
|
2055
|
+
cur += 1;
|
|
2056
|
+
continue;
|
|
2057
|
+
}
|
|
2058
|
+
if (isQuotationMark(ch)) {
|
|
2059
|
+
quoted = ch;
|
|
2060
|
+
cur += 1;
|
|
2061
|
+
continue;
|
|
2062
|
+
}
|
|
2063
|
+
if (isPseudoElement(ch, buffer)) {
|
|
2064
|
+
cur += 1;
|
|
2065
|
+
continue;
|
|
2066
|
+
}
|
|
2067
|
+
if (isDelimiter(ch)) {
|
|
2068
|
+
begin = cur;
|
|
2069
|
+
yield buffer;
|
|
2070
|
+
}
|
|
2071
|
+
cur += 1;
|
|
2072
|
+
}
|
|
2073
|
+
const tail = pattern.slice(begin, cur);
|
|
2074
|
+
yield tail;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
class Compound {
|
|
2154
2078
|
combinator;
|
|
2155
2079
|
tagName;
|
|
2156
2080
|
selector;
|
|
2157
|
-
|
|
2081
|
+
conditions;
|
|
2158
2082
|
constructor(pattern) {
|
|
2159
2083
|
const match = pattern.match(/^([~+\->]?)((?:[*]|[^.#[:]+)?)([^]*)$/);
|
|
2160
2084
|
if (!match) {
|
|
@@ -2164,25 +2088,168 @@ class Pattern {
|
|
|
2164
2088
|
this.selector = pattern;
|
|
2165
2089
|
this.combinator = parseCombinator(match.shift(), pattern);
|
|
2166
2090
|
this.tagName = match.shift() || "*";
|
|
2167
|
-
this.
|
|
2091
|
+
this.conditions = Array.from(splitCompound(match[0]), (it) => this.createCondition(it));
|
|
2168
2092
|
}
|
|
2169
2093
|
match(node, context) {
|
|
2170
|
-
return node.is(this.tagName) && this.
|
|
2094
|
+
return node.is(this.tagName) && this.conditions.every((cur) => cur.match(node, context));
|
|
2171
2095
|
}
|
|
2172
|
-
|
|
2096
|
+
createCondition(pattern) {
|
|
2173
2097
|
switch (pattern[0]) {
|
|
2174
2098
|
case ".":
|
|
2175
|
-
return new
|
|
2099
|
+
return new ClassCondition(pattern.slice(1));
|
|
2176
2100
|
case "#":
|
|
2177
|
-
return new
|
|
2101
|
+
return new IdCondition(pattern.slice(1));
|
|
2178
2102
|
case "[":
|
|
2179
|
-
return new
|
|
2103
|
+
return new AttributeCondition(pattern.slice(1, -1));
|
|
2180
2104
|
case ":":
|
|
2181
|
-
return new
|
|
2105
|
+
return new PseudoClassCondition(pattern.slice(1), this.selector);
|
|
2182
2106
|
default:
|
|
2183
|
-
throw new Error(`Failed to create
|
|
2107
|
+
throw new Error(`Failed to create selector condition for "${pattern}"`);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
function* ancestors$1(element) {
|
|
2113
|
+
let current = element.parent;
|
|
2114
|
+
while (current && !current.isRootElement()) {
|
|
2115
|
+
yield current;
|
|
2116
|
+
current = current.parent;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
function* parent(element) {
|
|
2120
|
+
const parent2 = element.parent;
|
|
2121
|
+
if (parent2 && !parent2.isRootElement()) {
|
|
2122
|
+
yield parent2;
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
function* adjacentSibling(element) {
|
|
2126
|
+
const sibling = element.previousSibling;
|
|
2127
|
+
if (sibling) {
|
|
2128
|
+
yield sibling;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
function* generalSibling(element) {
|
|
2132
|
+
const siblings = element.siblings;
|
|
2133
|
+
const index = siblings.findIndex((it) => it.isSameNode(element));
|
|
2134
|
+
for (let i = 0; i < index; i++) {
|
|
2135
|
+
yield siblings[i];
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
function* scope(element) {
|
|
2139
|
+
yield element;
|
|
2140
|
+
}
|
|
2141
|
+
function candidatesFromCombinator(element, combinator) {
|
|
2142
|
+
switch (combinator) {
|
|
2143
|
+
case Combinator.DESCENDANT:
|
|
2144
|
+
return ancestors$1(element);
|
|
2145
|
+
case Combinator.CHILD:
|
|
2146
|
+
return parent(element);
|
|
2147
|
+
case Combinator.ADJACENT_SIBLING:
|
|
2148
|
+
return adjacentSibling(element);
|
|
2149
|
+
case Combinator.GENERAL_SIBLING:
|
|
2150
|
+
return generalSibling(element);
|
|
2151
|
+
case Combinator.SCOPE:
|
|
2152
|
+
return scope(element);
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
function matchElement(element, compounds, context) {
|
|
2156
|
+
if (compounds.length === 0) {
|
|
2157
|
+
return true;
|
|
2158
|
+
}
|
|
2159
|
+
const last = compounds[compounds.length - 1];
|
|
2160
|
+
if (!last.match(element, context)) {
|
|
2161
|
+
return false;
|
|
2162
|
+
}
|
|
2163
|
+
const remainder = compounds.slice(0, -1);
|
|
2164
|
+
if (remainder.length === 0) {
|
|
2165
|
+
return true;
|
|
2166
|
+
}
|
|
2167
|
+
const candidates = candidatesFromCombinator(element, last.combinator);
|
|
2168
|
+
for (const candidate of candidates) {
|
|
2169
|
+
if (matchElement(candidate, remainder, context)) {
|
|
2170
|
+
return true;
|
|
2184
2171
|
}
|
|
2185
2172
|
}
|
|
2173
|
+
return false;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
const escapedCodepoints = ["9", "a", "d"];
|
|
2177
|
+
function* splitSelectorElements(selector) {
|
|
2178
|
+
let begin = 0;
|
|
2179
|
+
let end = 0;
|
|
2180
|
+
function initialState(ch, p) {
|
|
2181
|
+
if (ch === "\\") {
|
|
2182
|
+
return 1 /* ESCAPED */;
|
|
2183
|
+
}
|
|
2184
|
+
if (ch === " ") {
|
|
2185
|
+
end = p;
|
|
2186
|
+
return 2 /* WHITESPACE */;
|
|
2187
|
+
}
|
|
2188
|
+
return 0 /* INITIAL */;
|
|
2189
|
+
}
|
|
2190
|
+
function escapedState(ch) {
|
|
2191
|
+
if (escapedCodepoints.includes(ch)) {
|
|
2192
|
+
return 1 /* ESCAPED */;
|
|
2193
|
+
}
|
|
2194
|
+
return 0 /* INITIAL */;
|
|
2195
|
+
}
|
|
2196
|
+
function* whitespaceState(ch, p) {
|
|
2197
|
+
if (ch === " ") {
|
|
2198
|
+
return 2 /* WHITESPACE */;
|
|
2199
|
+
}
|
|
2200
|
+
yield selector.slice(begin, end);
|
|
2201
|
+
begin = p;
|
|
2202
|
+
end = p;
|
|
2203
|
+
return 0 /* INITIAL */;
|
|
2204
|
+
}
|
|
2205
|
+
let state = 0 /* INITIAL */;
|
|
2206
|
+
for (let p = 0; p < selector.length; p++) {
|
|
2207
|
+
const ch = selector[p];
|
|
2208
|
+
switch (state) {
|
|
2209
|
+
case 0 /* INITIAL */:
|
|
2210
|
+
state = initialState(ch, p);
|
|
2211
|
+
break;
|
|
2212
|
+
case 1 /* ESCAPED */:
|
|
2213
|
+
state = escapedState(ch);
|
|
2214
|
+
break;
|
|
2215
|
+
case 2 /* WHITESPACE */:
|
|
2216
|
+
state = yield* whitespaceState(ch, p);
|
|
2217
|
+
break;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
if (begin !== selector.length) {
|
|
2221
|
+
yield selector.slice(begin);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
function unescapeCodepoint(value) {
|
|
2226
|
+
const replacement = {
|
|
2227
|
+
"\\9 ": " ",
|
|
2228
|
+
"\\a ": "\n",
|
|
2229
|
+
"\\d ": "\r"
|
|
2230
|
+
};
|
|
2231
|
+
return value.replace(
|
|
2232
|
+
/(\\[\u0039\u0061\u0064] )/g,
|
|
2233
|
+
(_, codepoint) => replacement[codepoint]
|
|
2234
|
+
);
|
|
2235
|
+
}
|
|
2236
|
+
function escapeSelectorComponent(text) {
|
|
2237
|
+
const codepoints = {
|
|
2238
|
+
" ": "\\9 ",
|
|
2239
|
+
"\n": "\\a ",
|
|
2240
|
+
"\r": "\\d "
|
|
2241
|
+
};
|
|
2242
|
+
return text.toString().replace(/([\t\n\r]|[^a-z0-9_-])/gi, (_, ch) => {
|
|
2243
|
+
if (codepoints[ch]) {
|
|
2244
|
+
return codepoints[ch];
|
|
2245
|
+
} else {
|
|
2246
|
+
return `\\${ch}`;
|
|
2247
|
+
}
|
|
2248
|
+
});
|
|
2249
|
+
}
|
|
2250
|
+
function generateIdSelector(id) {
|
|
2251
|
+
const escaped = escapeSelectorComponent(id);
|
|
2252
|
+
return escaped.match(/^\d/) ? `[id="${escaped}"]` : `#${escaped}`;
|
|
2186
2253
|
}
|
|
2187
2254
|
class Selector {
|
|
2188
2255
|
pattern;
|
|
@@ -2199,6 +2266,13 @@ class Selector {
|
|
|
2199
2266
|
const context = { scope: root };
|
|
2200
2267
|
yield* this.matchInternal(root, 0, context);
|
|
2201
2268
|
}
|
|
2269
|
+
/**
|
|
2270
|
+
* Returns `true` if the element matches this selector.
|
|
2271
|
+
*/
|
|
2272
|
+
matchElement(element) {
|
|
2273
|
+
const context = { scope: null };
|
|
2274
|
+
return matchElement(element, this.pattern, context);
|
|
2275
|
+
}
|
|
2202
2276
|
*matchInternal(root, level, context) {
|
|
2203
2277
|
if (level >= this.pattern.length) {
|
|
2204
2278
|
yield root;
|
|
@@ -2216,7 +2290,7 @@ class Selector {
|
|
|
2216
2290
|
static parse(selector) {
|
|
2217
2291
|
selector = selector.replace(/([+~>]) /g, "$1");
|
|
2218
2292
|
return Array.from(splitSelectorElements(selector), (element) => {
|
|
2219
|
-
return new
|
|
2293
|
+
return new Compound(unescapeCodepoint(element));
|
|
2220
2294
|
});
|
|
2221
2295
|
}
|
|
2222
2296
|
static findCandidates(root, pattern) {
|
|
@@ -2232,7 +2306,6 @@ class Selector {
|
|
|
2232
2306
|
case Combinator.SCOPE:
|
|
2233
2307
|
return [root];
|
|
2234
2308
|
}
|
|
2235
|
-
return [];
|
|
2236
2309
|
}
|
|
2237
2310
|
static findAdjacentSibling(node) {
|
|
2238
2311
|
let adjacent = false;
|
|
@@ -2568,17 +2641,11 @@ class HtmlElement extends DOMNode {
|
|
|
2568
2641
|
*
|
|
2569
2642
|
* Implementation of DOM specification of Element.matches(selectors).
|
|
2570
2643
|
*/
|
|
2571
|
-
matches(
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
}
|
|
2576
|
-
for (const match of root.querySelectorAll(selector)) {
|
|
2577
|
-
if (match.unique === this.unique) {
|
|
2578
|
-
return true;
|
|
2579
|
-
}
|
|
2580
|
-
}
|
|
2581
|
-
return false;
|
|
2644
|
+
matches(selectorList) {
|
|
2645
|
+
return selectorList.split(",").some((it) => {
|
|
2646
|
+
const selector = new Selector(it.trim());
|
|
2647
|
+
return selector.matchElement(this);
|
|
2648
|
+
});
|
|
2582
2649
|
}
|
|
2583
2650
|
get meta() {
|
|
2584
2651
|
return this.metaElement;
|
|
@@ -6626,7 +6693,7 @@ class HeadingLevel extends Rule {
|
|
|
6626
6693
|
constructor(options) {
|
|
6627
6694
|
super({ ...defaults$j, ...options });
|
|
6628
6695
|
this.minInitialRank = parseMaxInitial(this.options.minInitialRank);
|
|
6629
|
-
this.sectionRoots = this.options.sectioningRoots.map((it) => new
|
|
6696
|
+
this.sectionRoots = this.options.sectioningRoots.map((it) => new Compound(it));
|
|
6630
6697
|
this.stack.push({
|
|
6631
6698
|
node: null,
|
|
6632
6699
|
current: 0,
|
|
@@ -11643,7 +11710,7 @@ class EventHandler {
|
|
|
11643
11710
|
}
|
|
11644
11711
|
|
|
11645
11712
|
const name = "html-validate";
|
|
11646
|
-
const version = "9.4.
|
|
11713
|
+
const version = "9.4.2-rc.1";
|
|
11647
11714
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
11648
11715
|
|
|
11649
11716
|
function freeze(src) {
|