@stencil/core 4.18.3-dev.1718168510.0a11aac → 4.18.3-dev.1718220868.532557e
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +43 -44
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +32 -19
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +62 -28
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +19 -1
- package/internal/hydrate/runner.js +222 -249
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +5 -0
- package/internal/stencil-public-compiler.d.ts +13 -0
- package/internal/testing/index.js +30 -14
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +127 -125
- package/mock-doc/index.d.ts +17 -3
- package/mock-doc/index.js +127 -125
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +10 -10
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
package/mock-doc/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Mock Doc v4.18.3-dev.
|
|
2
|
+
Stencil Mock Doc v4.18.3-dev.1718220868.532557e | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// src/runtime/runtime-constants.ts
|
|
@@ -6217,67 +6217,50 @@ function humanReadableList(items) {
|
|
|
6217
6217
|
}
|
|
6218
6218
|
|
|
6219
6219
|
// src/mock-doc/serialize-node.ts
|
|
6220
|
-
function
|
|
6220
|
+
function normalizeSerializationOptions(opts = {}) {
|
|
6221
|
+
return {
|
|
6222
|
+
...opts,
|
|
6223
|
+
outerHtml: typeof opts.outerHtml !== "boolean" ? false : opts.outerHtml,
|
|
6224
|
+
...opts.prettyHtml ? {
|
|
6225
|
+
indentSpaces: typeof opts.indentSpaces !== "number" ? 2 : opts.indentSpaces,
|
|
6226
|
+
newLines: typeof opts.newLines !== "boolean" ? true : opts.newLines
|
|
6227
|
+
} : {
|
|
6228
|
+
prettyHtml: false,
|
|
6229
|
+
indentSpaces: typeof opts.indentSpaces !== "number" ? 0 : opts.indentSpaces,
|
|
6230
|
+
newLines: typeof opts.newLines !== "boolean" ? false : opts.newLines
|
|
6231
|
+
},
|
|
6232
|
+
approximateLineWidth: typeof opts.approximateLineWidth !== "number" ? -1 : opts.approximateLineWidth,
|
|
6233
|
+
removeEmptyAttributes: typeof opts.removeEmptyAttributes !== "boolean" ? true : opts.removeEmptyAttributes,
|
|
6234
|
+
removeAttributeQuotes: typeof opts.removeAttributeQuotes !== "boolean" ? false : opts.removeAttributeQuotes,
|
|
6235
|
+
removeBooleanAttributeQuotes: typeof opts.removeBooleanAttributeQuotes !== "boolean" ? false : opts.removeBooleanAttributeQuotes,
|
|
6236
|
+
removeHtmlComments: typeof opts.removeHtmlComments !== "boolean" ? false : opts.removeHtmlComments,
|
|
6237
|
+
serializeShadowRoot: typeof opts.serializeShadowRoot !== "boolean" ? false : opts.serializeShadowRoot,
|
|
6238
|
+
fullDocument: typeof opts.fullDocument !== "boolean" ? true : opts.fullDocument
|
|
6239
|
+
};
|
|
6240
|
+
}
|
|
6241
|
+
function serializeNodeToHtml(elm, serializationOptions = {}) {
|
|
6242
|
+
const opts = normalizeSerializationOptions(serializationOptions);
|
|
6221
6243
|
const output = {
|
|
6222
6244
|
currentLineWidth: 0,
|
|
6223
6245
|
indent: 0,
|
|
6224
6246
|
isWithinBody: false,
|
|
6225
6247
|
text: []
|
|
6226
6248
|
};
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
}
|
|
6234
|
-
opts.approximateLineWidth = -1;
|
|
6235
|
-
} else {
|
|
6236
|
-
opts.prettyHtml = false;
|
|
6237
|
-
if (typeof opts.newLines !== "boolean") {
|
|
6238
|
-
opts.newLines = false;
|
|
6239
|
-
}
|
|
6240
|
-
if (typeof opts.indentSpaces !== "number") {
|
|
6241
|
-
opts.indentSpaces = 0;
|
|
6242
|
-
}
|
|
6243
|
-
}
|
|
6244
|
-
if (typeof opts.approximateLineWidth !== "number") {
|
|
6245
|
-
opts.approximateLineWidth = -1;
|
|
6246
|
-
}
|
|
6247
|
-
if (typeof opts.removeEmptyAttributes !== "boolean") {
|
|
6248
|
-
opts.removeEmptyAttributes = true;
|
|
6249
|
-
}
|
|
6250
|
-
if (typeof opts.removeAttributeQuotes !== "boolean") {
|
|
6251
|
-
opts.removeAttributeQuotes = false;
|
|
6252
|
-
}
|
|
6253
|
-
if (typeof opts.removeBooleanAttributeQuotes !== "boolean") {
|
|
6254
|
-
opts.removeBooleanAttributeQuotes = false;
|
|
6255
|
-
}
|
|
6256
|
-
if (typeof opts.removeHtmlComments !== "boolean") {
|
|
6257
|
-
opts.removeHtmlComments = false;
|
|
6258
|
-
}
|
|
6259
|
-
if (typeof opts.serializeShadowRoot !== "boolean") {
|
|
6260
|
-
opts.serializeShadowRoot = false;
|
|
6261
|
-
}
|
|
6262
|
-
if (opts.outerHtml) {
|
|
6263
|
-
serializeToHtml(elm, opts, output, false);
|
|
6264
|
-
} else {
|
|
6265
|
-
for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
|
|
6266
|
-
serializeToHtml(elm.childNodes[i], opts, output, false);
|
|
6267
|
-
}
|
|
6268
|
-
}
|
|
6269
|
-
if (output.text[0] === "\n") {
|
|
6270
|
-
output.text.shift();
|
|
6271
|
-
}
|
|
6272
|
-
if (output.text[output.text.length - 1] === "\n") {
|
|
6273
|
-
output.text.pop();
|
|
6249
|
+
let renderedNode = "";
|
|
6250
|
+
const children = !opts.fullDocument && elm.body ? Array.from(elm.body.childNodes) : opts.outerHtml ? [elm] : Array.from(elm.childNodes);
|
|
6251
|
+
for (let i = 0, ii = children.length; i < ii; i++) {
|
|
6252
|
+
const child = children[i];
|
|
6253
|
+
const chunks = Array.from(streamToHtml(child, opts, output));
|
|
6254
|
+
renderedNode += chunks.join("");
|
|
6274
6255
|
}
|
|
6275
|
-
return
|
|
6256
|
+
return renderedNode.trim();
|
|
6276
6257
|
}
|
|
6277
|
-
|
|
6258
|
+
var shadowRootTag = "mock:shadow-root";
|
|
6259
|
+
function* streamToHtml(node, opts, output) {
|
|
6278
6260
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
6261
|
+
const isShadowRoot = node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */;
|
|
6279
6262
|
if (node.nodeType === 1 /* ELEMENT_NODE */ || isShadowRoot) {
|
|
6280
|
-
const tagName = isShadowRoot ?
|
|
6263
|
+
const tagName = isShadowRoot ? shadowRootTag : getTagName(node);
|
|
6281
6264
|
if (tagName === "body") {
|
|
6282
6265
|
output.isWithinBody = true;
|
|
6283
6266
|
}
|
|
@@ -6285,17 +6268,23 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
|
|
|
6285
6268
|
if (ignoreTag === false) {
|
|
6286
6269
|
const isWithinWhitespaceSensitiveNode = opts.newLines || ((_a = opts.indentSpaces) != null ? _a : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
|
|
6287
6270
|
if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
|
6288
|
-
|
|
6271
|
+
yield "\n";
|
|
6289
6272
|
output.currentLineWidth = 0;
|
|
6290
6273
|
}
|
|
6291
6274
|
if (((_b = opts.indentSpaces) != null ? _b : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
|
|
6292
6275
|
for (let i = 0; i < output.indent; i++) {
|
|
6293
|
-
|
|
6276
|
+
yield " ";
|
|
6294
6277
|
}
|
|
6295
6278
|
output.currentLineWidth += output.indent;
|
|
6296
6279
|
}
|
|
6297
|
-
|
|
6298
|
-
|
|
6280
|
+
const tag = tagName === shadowRootTag ? "template" : tagName;
|
|
6281
|
+
yield "<" + tag;
|
|
6282
|
+
output.currentLineWidth += tag.length + 1;
|
|
6283
|
+
if (tag === "template") {
|
|
6284
|
+
const mode = ` shadowrootmode="open"`;
|
|
6285
|
+
yield mode;
|
|
6286
|
+
output.currentLineWidth += mode.length;
|
|
6287
|
+
}
|
|
6299
6288
|
const attrsLength = node.attributes.length;
|
|
6300
6289
|
const attributes = opts.prettyHtml && attrsLength > 1 ? cloneAttributes(node.attributes, true) : node.attributes;
|
|
6301
6290
|
for (let i = 0; i < attrsLength; i++) {
|
|
@@ -6312,27 +6301,27 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
|
|
|
6312
6301
|
if (attrNamespaceURI == null) {
|
|
6313
6302
|
output.currentLineWidth += attrName.length + 1;
|
|
6314
6303
|
if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
|
|
6315
|
-
|
|
6304
|
+
yield "\n" + attrName;
|
|
6316
6305
|
output.currentLineWidth = 0;
|
|
6317
6306
|
} else {
|
|
6318
|
-
|
|
6307
|
+
yield " " + attrName;
|
|
6319
6308
|
}
|
|
6320
6309
|
} else if (attrNamespaceURI === "http://www.w3.org/XML/1998/namespace") {
|
|
6321
|
-
|
|
6310
|
+
yield " xml:" + attrName;
|
|
6322
6311
|
output.currentLineWidth += attrName.length + 5;
|
|
6323
6312
|
} else if (attrNamespaceURI === "http://www.w3.org/2000/xmlns/") {
|
|
6324
6313
|
if (attrName !== "xmlns") {
|
|
6325
|
-
|
|
6314
|
+
yield " xmlns:" + attrName;
|
|
6326
6315
|
output.currentLineWidth += attrName.length + 7;
|
|
6327
6316
|
} else {
|
|
6328
|
-
|
|
6317
|
+
yield " " + attrName;
|
|
6329
6318
|
output.currentLineWidth += attrName.length + 1;
|
|
6330
6319
|
}
|
|
6331
6320
|
} else if (attrNamespaceURI === XLINK_NS) {
|
|
6332
|
-
|
|
6321
|
+
yield " xlink:" + attrName;
|
|
6333
6322
|
output.currentLineWidth += attrName.length + 7;
|
|
6334
6323
|
} else {
|
|
6335
|
-
|
|
6324
|
+
yield " " + attrNamespaceURI + ":" + attrName;
|
|
6336
6325
|
output.currentLineWidth += attrNamespaceURI.length + attrName.length + 2;
|
|
6337
6326
|
}
|
|
6338
6327
|
if (opts.prettyHtml && attrName === "class") {
|
|
@@ -6347,43 +6336,45 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
|
|
|
6347
6336
|
}
|
|
6348
6337
|
}
|
|
6349
6338
|
if (opts.removeAttributeQuotes && CAN_REMOVE_ATTR_QUOTES.test(attrValue)) {
|
|
6350
|
-
|
|
6339
|
+
yield "=" + escapeString(attrValue, true);
|
|
6351
6340
|
output.currentLineWidth += attrValue.length + 1;
|
|
6352
6341
|
} else {
|
|
6353
|
-
|
|
6342
|
+
yield '="' + escapeString(attrValue, true) + '"';
|
|
6354
6343
|
output.currentLineWidth += attrValue.length + 3;
|
|
6355
6344
|
}
|
|
6356
6345
|
}
|
|
6357
6346
|
if (node.hasAttribute("style")) {
|
|
6358
6347
|
const cssText = node.style.cssText;
|
|
6359
6348
|
if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth + cssText.length + 10 > opts.approximateLineWidth) {
|
|
6360
|
-
|
|
6361
|
-
style="${cssText}"
|
|
6349
|
+
yield `
|
|
6350
|
+
style="${cssText}">`;
|
|
6362
6351
|
output.currentLineWidth = 0;
|
|
6363
6352
|
} else {
|
|
6364
|
-
|
|
6353
|
+
yield ` style="${cssText}">`;
|
|
6365
6354
|
output.currentLineWidth += cssText.length + 10;
|
|
6366
6355
|
}
|
|
6367
6356
|
} else {
|
|
6368
|
-
|
|
6357
|
+
yield ">";
|
|
6369
6358
|
output.currentLineWidth += 1;
|
|
6370
6359
|
}
|
|
6371
6360
|
}
|
|
6372
6361
|
if (EMPTY_ELEMENTS.has(tagName) === false) {
|
|
6373
|
-
|
|
6362
|
+
const shadowRoot = node.shadowRoot;
|
|
6363
|
+
if (opts.serializeShadowRoot && shadowRoot != null) {
|
|
6374
6364
|
output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
|
|
6375
|
-
|
|
6365
|
+
yield* streamToHtml(shadowRoot, opts, output);
|
|
6376
6366
|
output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
|
|
6377
6367
|
if (opts.newLines && (node.childNodes.length === 0 || node.childNodes.length === 1 && node.childNodes[0].nodeType === 3 /* TEXT_NODE */ && ((_e = node.childNodes[0].nodeValue) == null ? void 0 : _e.trim()) === "")) {
|
|
6378
|
-
|
|
6368
|
+
yield "\n";
|
|
6379
6369
|
output.currentLineWidth = 0;
|
|
6380
6370
|
for (let i = 0; i < output.indent; i++) {
|
|
6381
|
-
|
|
6371
|
+
yield " ";
|
|
6382
6372
|
}
|
|
6383
6373
|
output.currentLineWidth += output.indent;
|
|
6384
6374
|
}
|
|
6385
6375
|
}
|
|
6386
6376
|
if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
|
|
6377
|
+
const tag = tagName === shadowRootTag ? "template" : tagName;
|
|
6387
6378
|
const childNodes = tagName === "template" ? node.content.childNodes : node.childNodes;
|
|
6388
6379
|
const childNodeLength = childNodes.length;
|
|
6389
6380
|
if (childNodeLength > 0) {
|
|
@@ -6394,17 +6385,17 @@ style="${cssText}">`);
|
|
|
6394
6385
|
output.indent = output.indent + ((_h = opts.indentSpaces) != null ? _h : 0);
|
|
6395
6386
|
}
|
|
6396
6387
|
for (let i = 0; i < childNodeLength; i++) {
|
|
6397
|
-
|
|
6388
|
+
yield* streamToHtml(childNodes[i], opts, output);
|
|
6398
6389
|
}
|
|
6399
6390
|
if (ignoreTag === false) {
|
|
6400
6391
|
if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
|
6401
|
-
|
|
6392
|
+
yield "\n";
|
|
6402
6393
|
output.currentLineWidth = 0;
|
|
6403
6394
|
}
|
|
6404
6395
|
if (((_i = opts.indentSpaces) != null ? _i : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
|
|
6405
6396
|
output.indent = output.indent - ((_j = opts.indentSpaces) != null ? _j : 0);
|
|
6406
6397
|
for (let i = 0; i < output.indent; i++) {
|
|
6407
|
-
|
|
6398
|
+
yield " ";
|
|
6408
6399
|
}
|
|
6409
6400
|
output.currentLineWidth += output.indent;
|
|
6410
6401
|
}
|
|
@@ -6412,13 +6403,13 @@ style="${cssText}">`);
|
|
|
6412
6403
|
}
|
|
6413
6404
|
}
|
|
6414
6405
|
if (ignoreTag === false) {
|
|
6415
|
-
|
|
6416
|
-
output.currentLineWidth +=
|
|
6406
|
+
yield "</" + tag + ">";
|
|
6407
|
+
output.currentLineWidth += tag.length + 3;
|
|
6417
6408
|
}
|
|
6418
6409
|
}
|
|
6419
6410
|
}
|
|
6420
6411
|
if (((_k = opts.approximateLineWidth) != null ? _k : 0) > 0 && STRUCTURE_ELEMENTS.has(tagName)) {
|
|
6421
|
-
|
|
6412
|
+
yield "\n";
|
|
6422
6413
|
output.currentLineWidth = 0;
|
|
6423
6414
|
}
|
|
6424
6415
|
if (tagName === "body") {
|
|
@@ -6430,27 +6421,27 @@ style="${cssText}">`);
|
|
|
6430
6421
|
const trimmedTextContent = textContent.trim();
|
|
6431
6422
|
if (trimmedTextContent === "") {
|
|
6432
6423
|
if (isWithinWhitespaceSensitive(node)) {
|
|
6433
|
-
|
|
6424
|
+
yield textContent;
|
|
6434
6425
|
output.currentLineWidth += textContent.length;
|
|
6435
6426
|
} else if (((_l = opts.approximateLineWidth) != null ? _l : 0) > 0 && !output.isWithinBody) {
|
|
6436
6427
|
} else if (!opts.prettyHtml) {
|
|
6437
6428
|
output.currentLineWidth += 1;
|
|
6438
6429
|
if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
|
|
6439
|
-
|
|
6430
|
+
yield "\n";
|
|
6440
6431
|
output.currentLineWidth = 0;
|
|
6441
6432
|
} else {
|
|
6442
|
-
|
|
6433
|
+
yield " ";
|
|
6443
6434
|
}
|
|
6444
6435
|
}
|
|
6445
6436
|
} else {
|
|
6446
6437
|
const isWithinWhitespaceSensitiveNode = opts.newLines || ((_m = opts.indentSpaces) != null ? _m : 0) > 0 || opts.prettyHtml ? isWithinWhitespaceSensitive(node) : false;
|
|
6447
6438
|
if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
|
6448
|
-
|
|
6439
|
+
yield "\n";
|
|
6449
6440
|
output.currentLineWidth = 0;
|
|
6450
6441
|
}
|
|
6451
6442
|
if (((_n = opts.indentSpaces) != null ? _n : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
|
|
6452
6443
|
for (let i = 0; i < output.indent; i++) {
|
|
6453
|
-
|
|
6444
|
+
yield " ";
|
|
6454
6445
|
}
|
|
6455
6446
|
output.currentLineWidth += output.indent;
|
|
6456
6447
|
}
|
|
@@ -6459,15 +6450,15 @@ style="${cssText}">`);
|
|
|
6459
6450
|
const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* ELEMENT_NODE */ ? node.parentNode.nodeName : null;
|
|
6460
6451
|
if (typeof parentTagName === "string" && NON_ESCAPABLE_CONTENT.has(parentTagName)) {
|
|
6461
6452
|
if (isWithinWhitespaceSensitive(node)) {
|
|
6462
|
-
|
|
6453
|
+
yield textContent;
|
|
6463
6454
|
} else {
|
|
6464
|
-
|
|
6455
|
+
yield trimmedTextContent;
|
|
6465
6456
|
textContentLength = trimmedTextContent.length;
|
|
6466
6457
|
}
|
|
6467
6458
|
output.currentLineWidth += textContentLength;
|
|
6468
6459
|
} else {
|
|
6469
6460
|
if (opts.prettyHtml && !isWithinWhitespaceSensitiveNode) {
|
|
6470
|
-
|
|
6461
|
+
yield escapeString(textContent.replace(/\s\s+/g, " ").trim(), false);
|
|
6471
6462
|
output.currentLineWidth += textContentLength;
|
|
6472
6463
|
} else {
|
|
6473
6464
|
if (isWithinWhitespaceSensitive(node)) {
|
|
@@ -6489,7 +6480,7 @@ style="${cssText}">`);
|
|
|
6489
6480
|
}
|
|
6490
6481
|
output.currentLineWidth += textContentLength;
|
|
6491
6482
|
}
|
|
6492
|
-
|
|
6483
|
+
yield escapeString(textContent, false);
|
|
6493
6484
|
}
|
|
6494
6485
|
}
|
|
6495
6486
|
}
|
|
@@ -6497,27 +6488,25 @@ style="${cssText}">`);
|
|
|
6497
6488
|
}
|
|
6498
6489
|
} else if (node.nodeType === 8 /* COMMENT_NODE */) {
|
|
6499
6490
|
const nodeValue = node.nodeValue;
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
return;
|
|
6504
|
-
}
|
|
6491
|
+
const isHydrateAnnotation = (nodeValue == null ? void 0 : nodeValue.startsWith(CONTENT_REF_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(ORG_LOCATION_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(SLOT_NODE_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(TEXT_NODE_ID + "."));
|
|
6492
|
+
if (opts.removeHtmlComments && !isHydrateAnnotation) {
|
|
6493
|
+
return;
|
|
6505
6494
|
}
|
|
6506
6495
|
const isWithinWhitespaceSensitiveNode = opts.newLines || ((_o = opts.indentSpaces) != null ? _o : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
|
|
6507
6496
|
if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
|
6508
|
-
|
|
6497
|
+
yield "\n";
|
|
6509
6498
|
output.currentLineWidth = 0;
|
|
6510
6499
|
}
|
|
6511
6500
|
if (((_p = opts.indentSpaces) != null ? _p : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
|
|
6512
6501
|
for (let i = 0; i < output.indent; i++) {
|
|
6513
|
-
|
|
6502
|
+
yield " ";
|
|
6514
6503
|
}
|
|
6515
6504
|
output.currentLineWidth += output.indent;
|
|
6516
6505
|
}
|
|
6517
|
-
|
|
6506
|
+
yield "<!--" + nodeValue + "-->";
|
|
6518
6507
|
output.currentLineWidth += nodeValue.length + 7;
|
|
6519
6508
|
} else if (node.nodeType === 10 /* DOCUMENT_TYPE_NODE */) {
|
|
6520
|
-
|
|
6509
|
+
yield "<!doctype html>";
|
|
6521
6510
|
}
|
|
6522
6511
|
}
|
|
6523
6512
|
var AMP_REGEX = /&/g;
|
|
@@ -6858,6 +6847,10 @@ Testing components with ElementInternals is fully supported in e2e tests.`
|
|
|
6858
6847
|
get shadowRoot() {
|
|
6859
6848
|
return this.__shadowRoot || null;
|
|
6860
6849
|
}
|
|
6850
|
+
/**
|
|
6851
|
+
* Set shadow root for element
|
|
6852
|
+
* @param shadowRoot - ShadowRoot to set
|
|
6853
|
+
*/
|
|
6861
6854
|
set shadowRoot(shadowRoot) {
|
|
6862
6855
|
if (shadowRoot != null) {
|
|
6863
6856
|
shadowRoot.host = this;
|
|
@@ -8905,6 +8898,7 @@ var nativeClearTimeout = clearTimeout;
|
|
|
8905
8898
|
var nativeSetInterval = setInterval;
|
|
8906
8899
|
var nativeSetTimeout = setTimeout;
|
|
8907
8900
|
var nativeURL = URL;
|
|
8901
|
+
var nativeWindow = globalThis.window;
|
|
8908
8902
|
var MockWindow = class {
|
|
8909
8903
|
constructor(html = null) {
|
|
8910
8904
|
if (html !== false) {
|
|
@@ -8931,10 +8925,10 @@ var MockWindow = class {
|
|
|
8931
8925
|
blur() {
|
|
8932
8926
|
}
|
|
8933
8927
|
cancelAnimationFrame(id) {
|
|
8934
|
-
this.__clearTimeout(id);
|
|
8928
|
+
this.__clearTimeout.call(nativeWindow || this, id);
|
|
8935
8929
|
}
|
|
8936
8930
|
cancelIdleCallback(id) {
|
|
8937
|
-
this.__clearTimeout(id);
|
|
8931
|
+
this.__clearTimeout.call(nativeWindow || this, id);
|
|
8938
8932
|
}
|
|
8939
8933
|
get CharacterData() {
|
|
8940
8934
|
if (this.__charDataCstr == null) {
|
|
@@ -8952,10 +8946,10 @@ var MockWindow = class {
|
|
|
8952
8946
|
this.__charDataCstr = charDataCstr;
|
|
8953
8947
|
}
|
|
8954
8948
|
clearInterval(id) {
|
|
8955
|
-
this.__clearInterval(id);
|
|
8949
|
+
this.__clearInterval.call(nativeWindow || this, id);
|
|
8956
8950
|
}
|
|
8957
8951
|
clearTimeout(id) {
|
|
8958
|
-
this.__clearTimeout(id);
|
|
8952
|
+
this.__clearTimeout.call(nativeWindow || this, id);
|
|
8959
8953
|
}
|
|
8960
8954
|
close() {
|
|
8961
8955
|
resetWindow(this);
|
|
@@ -9255,20 +9249,24 @@ var MockWindow = class {
|
|
|
9255
9249
|
}
|
|
9256
9250
|
return intervalId;
|
|
9257
9251
|
}
|
|
9258
|
-
const timeoutId = this.__setTimeout(
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9252
|
+
const timeoutId = this.__setTimeout.call(
|
|
9253
|
+
nativeWindow || this,
|
|
9254
|
+
() => {
|
|
9255
|
+
if (this.__timeouts) {
|
|
9256
|
+
this.__timeouts.delete(timeoutId);
|
|
9257
|
+
try {
|
|
9258
|
+
callback(...args);
|
|
9259
|
+
} catch (e2) {
|
|
9260
|
+
if (this.console) {
|
|
9261
|
+
this.console.error(e2);
|
|
9262
|
+
} else {
|
|
9263
|
+
console.error(e2);
|
|
9264
|
+
}
|
|
9268
9265
|
}
|
|
9269
9266
|
}
|
|
9270
|
-
}
|
|
9271
|
-
|
|
9267
|
+
},
|
|
9268
|
+
ms
|
|
9269
|
+
);
|
|
9272
9270
|
if (this.__timeouts) {
|
|
9273
9271
|
this.__timeouts.add(timeoutId);
|
|
9274
9272
|
}
|
|
@@ -9279,20 +9277,24 @@ var MockWindow = class {
|
|
|
9279
9277
|
this.__timeouts = /* @__PURE__ */ new Set();
|
|
9280
9278
|
}
|
|
9281
9279
|
ms = Math.min(ms, this.__maxTimeout);
|
|
9282
|
-
const timeoutId = this.__setTimeout(
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9280
|
+
const timeoutId = this.__setTimeout.call(
|
|
9281
|
+
nativeWindow || this,
|
|
9282
|
+
() => {
|
|
9283
|
+
if (this.__timeouts) {
|
|
9284
|
+
this.__timeouts.delete(timeoutId);
|
|
9285
|
+
try {
|
|
9286
|
+
callback(...args);
|
|
9287
|
+
} catch (e2) {
|
|
9288
|
+
if (this.console) {
|
|
9289
|
+
this.console.error(e2);
|
|
9290
|
+
} else {
|
|
9291
|
+
console.error(e2);
|
|
9292
|
+
}
|
|
9292
9293
|
}
|
|
9293
9294
|
}
|
|
9294
|
-
}
|
|
9295
|
-
|
|
9295
|
+
},
|
|
9296
|
+
ms
|
|
9297
|
+
);
|
|
9296
9298
|
if (this.__timeouts) {
|
|
9297
9299
|
this.__timeouts.add(timeoutId);
|
|
9298
9300
|
}
|
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
package/screenshot/index.js
CHANGED
package/screenshot/package.json
CHANGED