Record when a doc is in compatMode and trigger this mode upon replay (#697)
* Hygiene: clean up the xhtml namespace attribute; this is an artefact of the `serializeToString` method which we are using (I think) to be consistent with whitespace and to clean up invalid attributes. I'm removing as was confused as am adding tests related to doctypes * Record when a document is in `compatMode` and trigger this mode on the iframe upon replay https://developer.mozilla.org/en-US/docs/Web/API/Document/compatMode the included DOCTYPE was picked up from https://stackoverflow.com/questions/18976213/ - there may be better ways of triggering compatMode * Don't write an extra DOCTYPE if there's one already present in the snapshot. Rely instead on whatever doctype is there to trigger the BackCompat mode * Modify to write the correct doctype if we can sniff xhtml - don't have any evidence that this will make a difference * Dev convenience: Ignore files generated by editors * Typo fix * Was getting a 2000ms timeout on the 'before' hook I believe * Change certain tests to go directly to their localhost page instead of loading the html content programmatically in order to avoid triggering an incorrect BackCompat mode (incorrect in that the html content has a correct doctype) * Add test based on motivating site that had images lined up in a square which were all different sizes; very old style percentage width/height attributes were doing the right thing in quirksmode, which is what we are testing for here * Fixup rrweb test html to include a valid doctype and avoid BackCompat to ensure we're not accidentally testing against quirks modes. I didn't find an elegant way of avoiding the `BackCompat` when adding a minimal iframe, so some BackCompat has slipped in here, I don't think there's much harm
This commit is contained in:
@@ -321,6 +321,20 @@ export function buildNodeWithSN(
|
|||||||
// close before open to make sure document was closed
|
// close before open to make sure document was closed
|
||||||
doc.close();
|
doc.close();
|
||||||
doc.open();
|
doc.open();
|
||||||
|
if (n.compatMode === 'BackCompat' &&
|
||||||
|
(n.childNodes && n.childNodes[0].type !== NodeType.DocumentType) // there isn't one already defined
|
||||||
|
) {
|
||||||
|
// Trigger compatMode in the iframe
|
||||||
|
// this is needed as document.createElement('iframe') otherwise inherits a CSS1Compat mode from the parent replayer environment
|
||||||
|
if (n.childNodes[0].type === NodeType.Element &&
|
||||||
|
'xmlns' in n.childNodes[0].attributes &&
|
||||||
|
n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {
|
||||||
|
// might as well use an xhtml doctype if we've got an xhtml namespace
|
||||||
|
doc.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">');
|
||||||
|
} else {
|
||||||
|
doc.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">');
|
||||||
|
}
|
||||||
|
}
|
||||||
node = doc;
|
node = doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
MaskTextFn,
|
MaskTextFn,
|
||||||
MaskInputFn,
|
MaskInputFn,
|
||||||
KeepIframeSrcFn,
|
KeepIframeSrcFn,
|
||||||
|
documentNode,
|
||||||
} from './types';
|
} from './types';
|
||||||
import { isElement, isShadowRoot, maskInputValue } from './utils';
|
import { isElement, isShadowRoot, maskInputValue } from './utils';
|
||||||
|
|
||||||
@@ -379,11 +380,20 @@ function serializeNode(
|
|||||||
}
|
}
|
||||||
switch (n.nodeType) {
|
switch (n.nodeType) {
|
||||||
case n.DOCUMENT_NODE:
|
case n.DOCUMENT_NODE:
|
||||||
|
if ((n as HTMLDocument).compatMode !== 'CSS1Compat') {
|
||||||
|
return {
|
||||||
|
type: NodeType.Document,
|
||||||
|
childNodes: [],
|
||||||
|
compatMode: (n as HTMLDocument).compatMode, // probably "BackCompat"
|
||||||
|
rootId,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
return {
|
return {
|
||||||
type: NodeType.Document,
|
type: NodeType.Document,
|
||||||
childNodes: [],
|
childNodes: [],
|
||||||
rootId,
|
rootId,
|
||||||
};
|
}
|
||||||
|
}
|
||||||
case n.DOCUMENT_TYPE_NODE:
|
case n.DOCUMENT_TYPE_NODE:
|
||||||
return {
|
return {
|
||||||
type: NodeType.DocumentType,
|
type: NodeType.DocumentType,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export enum NodeType {
|
|||||||
export type documentNode = {
|
export type documentNode = {
|
||||||
type: NodeType.Document;
|
type: NodeType.Document;
|
||||||
childNodes: serializedNodeWithId[];
|
childNodes: serializedNodeWithId[];
|
||||||
|
compatMode?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type documentTypeNode = {
|
export type documentTypeNode = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`[html file]: about-mozilla.html 1`] = `
|
exports[`[html file]: about-mozilla.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\"><head>
|
"<!DOCTYPE html><html><head>
|
||||||
<title>The Book of Mozilla, 11:9</title>
|
<title>The Book of Mozilla, 11:9</title>
|
||||||
<style type=\\"text/css\\">
|
<style type=\\"text/css\\">
|
||||||
html {
|
html {
|
||||||
@@ -40,7 +40,7 @@ exports[`[html file]: about-mozilla.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: basic.html 1`] = `
|
exports[`[html file]: basic.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -50,7 +50,7 @@ exports[`[html file]: basic.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: block-element.html 1`] = `
|
exports[`[html file]: block-element.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -74,8 +74,22 @@ exports[`[html file]: block-element.html 1`] = `
|
|||||||
</body></html>"
|
</body></html>"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`[html file]: compat-mode.html 1`] = `
|
||||||
|
"<!DOCTYPE html PUBLIC \\"-//W3C//DTD HTML 4.0 Transitional//EN\\"><!-- no doctype! --><html><head>
|
||||||
|
<title>Compat Mode; image resizing</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<center>
|
||||||
|
<a href=\\"http://localhost:3030/html#\\" class=\\"should-be-square-shaped\\">
|
||||||
|
<img width=\\"40%\\" height=\\"35%\\" src=\\"http://localhost:3030/images/compat-top-left.png\\" />
|
||||||
|
<img width=\\"40%\\" height=\\"35%\\" src=\\"http://localhost:3030/images/compat-top-right.png\\" />
|
||||||
|
<br /><img width=\\"80%\\" height=\\"20%\\" src=\\"http://localhost:3030/images/compat-bottom.png\\" /></a>
|
||||||
|
</center>
|
||||||
|
</body></html>"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`[html file]: cors-style-sheet.html 1`] = `
|
exports[`[html file]: cors-style-sheet.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -87,7 +101,7 @@ exports[`[html file]: cors-style-sheet.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: dynamic-stylesheet.html 1`] = `
|
exports[`[html file]: dynamic-stylesheet.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -101,7 +115,7 @@ exports[`[html file]: dynamic-stylesheet.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: form-fields.html 1`] = `
|
exports[`[html file]: form-fields.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -135,7 +149,7 @@ exports[`[html file]: form-fields.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: hover.html 1`] = `
|
exports[`[html file]: hover.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -158,7 +172,7 @@ exports[`[html file]: hover.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: iframe.html 1`] = `
|
exports[`[html file]: iframe.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -170,17 +184,17 @@ exports[`[html file]: iframe.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: iframe-inner.html 1`] = `
|
exports[`[html file]: iframe-inner.html 1`] = `
|
||||||
"<html xmlns=\\"http://www.w3.org/1999/xhtml\\"><head></head><body><button>inner iframe button</button>
|
"<!DOCTYPE html PUBLIC \\"-//W3C//DTD HTML 4.0 Transitional//EN\\"><html><head></head><body><button>inner iframe button</button>
|
||||||
</body></html>"
|
</body></html>"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: invalid-attribute.html 1`] = `
|
exports[`[html file]: invalid-attribute.html 1`] = `
|
||||||
"<html xmlns=\\"http://www.w3.org/1999/xhtml\\" foo=\\"bar\\"><head></head><body>
|
"<!DOCTYPE html PUBLIC \\"-//W3C//DTD HTML 4.0 Transitional//EN\\"><html foo=\\"bar\\"><head></head><body>
|
||||||
</body></html>"
|
</body></html>"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: invalid-doctype.html 1`] = `
|
exports[`[html file]: invalid-doctype.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<title>Invalid Doctype</title>
|
<title>Invalid Doctype</title>
|
||||||
@@ -189,7 +203,7 @@ exports[`[html file]: invalid-doctype.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: invalid-tagname.html 1`] = `
|
exports[`[html file]: invalid-tagname.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -203,7 +217,7 @@ exports[`[html file]: invalid-tagname.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: mask-text.html 1`] = `
|
exports[`[html file]: mask-text.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -218,7 +232,7 @@ exports[`[html file]: mask-text.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: picture.html 1`] = `
|
exports[`[html file]: picture.html 1`] = `
|
||||||
"<html xmlns=\\"http://www.w3.org/1999/xhtml\\"><head></head><body>
|
"<!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional//EN\\"><html xmlns=\\"http://www.w3.org/1999/xhtml\\"><head></head><body>
|
||||||
<picture>
|
<picture>
|
||||||
<source type=\\"image/webp\\" srcset=\\"http://localhost:3030/assets/img/characters/robot.webp\\" />
|
<source type=\\"image/webp\\" srcset=\\"http://localhost:3030/assets/img/characters/robot.webp\\" />
|
||||||
<img src=\\"http://localhost:3030/assets/img/characters/robot.png\\" />
|
<img src=\\"http://localhost:3030/assets/img/characters/robot.png\\" />
|
||||||
@@ -227,7 +241,7 @@ exports[`[html file]: picture.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: preload.html 1`] = `
|
exports[`[html file]: preload.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<title>Document</title>
|
<title>Document</title>
|
||||||
@@ -238,7 +252,7 @@ exports[`[html file]: preload.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: shadow-dom.html 1`] = `
|
exports[`[html file]: shadow-dom.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<title>shadow DOM</title>
|
<title>shadow DOM</title>
|
||||||
@@ -257,7 +271,7 @@ exports[`[html file]: shadow-dom.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: video.html 1`] = `
|
exports[`[html file]: video.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -272,7 +286,7 @@ exports[`[html file]: video.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: with-relative-res.html 1`] = `
|
exports[`[html file]: with-relative-res.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -292,7 +306,7 @@ exports[`[html file]: with-relative-res.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: with-script.html 1`] = `
|
exports[`[html file]: with-script.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -303,7 +317,7 @@ exports[`[html file]: with-script.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: with-style-sheet.html 1`] = `
|
exports[`[html file]: with-style-sheet.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -314,7 +328,7 @@ exports[`[html file]: with-style-sheet.html 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`[html file]: with-style-sheet-with-import.html 1`] = `
|
exports[`[html file]: with-style-sheet-with-import.html 1`] = `
|
||||||
"<!DOCTYPE html><html xmlns=\\"http://www.w3.org/1999/xhtml\\" lang=\\"en\\"><head>
|
"<!DOCTYPE html><html lang=\\"en\\"><head>
|
||||||
<meta charset=\\"UTF-8\\" />
|
<meta charset=\\"UTF-8\\" />
|
||||||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />
|
||||||
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
<meta http-equiv=\\"X-UA-Compatible\\" content=\\"ie=edge\\" />
|
||||||
@@ -456,7 +470,7 @@ exports[`iframe integration tests 1`] = `
|
|||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`shadown DOM integration tests 1`] = `
|
exports[`shadow DOM integration tests 1`] = `
|
||||||
"{
|
"{
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
|||||||
14
packages/rrweb-snapshot/test/html/compat-mode.html
Normal file
14
packages/rrweb-snapshot/test/html/compat-mode.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<!-- no doctype! -->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Compat Mode; image resizing</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<center>
|
||||||
|
<a href="#" class="should-be-square-shaped">
|
||||||
|
<img width="40%" height="35%" src="/images/compat-top-left.png">
|
||||||
|
<img width="40%" height="35%" src="/images/compat-top-right.png">
|
||||||
|
<br><img width="80%" height="20%" src="/images/compat-bottom.png"></a>
|
||||||
|
</center>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<body>
|
<body>
|
||||||
<picture>
|
<picture>
|
||||||
<source type="image/webp" srcset="assets/img/characters/robot.webp" />
|
<source type="image/webp" srcset="assets/img/characters/robot.webp" />
|
||||||
|
|||||||
BIN
packages/rrweb-snapshot/test/images/compat-bottom.png
Normal file
BIN
packages/rrweb-snapshot/test/images/compat-bottom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
packages/rrweb-snapshot/test/images/compat-top-left.png
Normal file
BIN
packages/rrweb-snapshot/test/images/compat-top-left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
packages/rrweb-snapshot/test/images/compat-top-right.png
Normal file
BIN
packages/rrweb-snapshot/test/images/compat-top-right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -74,6 +74,8 @@ interface ISuite extends Suite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe('integration tests', function (this: ISuite) {
|
describe('integration tests', function (this: ISuite) {
|
||||||
|
this.timeout(10_000);
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
this.server = await server();
|
this.server = await server();
|
||||||
this.browser = await puppeteer.launch({
|
this.browser = await puppeteer.launch({
|
||||||
@@ -97,32 +99,84 @@ describe('integration tests', function (this: ISuite) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (const html of htmls) {
|
for (const html of htmls) {
|
||||||
|
if (html.filePath.substring(html.filePath.length - 1) === '~') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const title = '[html file]: ' + html.filePath;
|
const title = '[html file]: ' + html.filePath;
|
||||||
it(title, async () => {
|
it(title, async () => {
|
||||||
const page: puppeteer.Page = await this.browser.newPage();
|
const page: puppeteer.Page = await this.browser.newPage();
|
||||||
// console for debug
|
// console for debug
|
||||||
// tslint:disable-next-line: no-console
|
// tslint:disable-next-line: no-console
|
||||||
page.on('console', (msg) => console.log(msg.text()));
|
page.on('console', (msg) => console.log(msg.text()));
|
||||||
|
if (html.filePath === 'iframe.html') {
|
||||||
|
// loading directly is needed to ensure we don't trigger compatMode='BackCompat'
|
||||||
|
// which happens before setContent can be called
|
||||||
|
await page.goto(`http://localhost:3030/html/${html.filePath}`, {
|
||||||
|
waitUntil: 'load',
|
||||||
|
});
|
||||||
|
const outerCompatMode = await page.evaluate('document.compatMode');
|
||||||
|
const innerCompatMode = await page.evaluate('document.querySelector("iframe").contentDocument.compatMode');
|
||||||
|
assert(outerCompatMode === 'CSS1Compat', outerCompatMode + ' for outer iframe.html should be CSS1Compat as it has "<!DOCTYPE html>"');
|
||||||
|
// inner omits a doctype so gets rendered in backwards compat mode
|
||||||
|
// although this was originally accidental, we'll add a synthetic doctype to the rebuild to recreate this
|
||||||
|
assert(innerCompatMode === 'BackCompat', innerCompatMode + ' for iframe-inner.html should be BackCompat as it lacks "<!DOCTYPE html>"');
|
||||||
|
} else {
|
||||||
|
// loading indirectly is improtant for relative path testing
|
||||||
await page.goto(`http://localhost:3030/html`);
|
await page.goto(`http://localhost:3030/html`);
|
||||||
await page.setContent(html.src, {
|
await page.setContent(html.src, {
|
||||||
waitUntil: 'load',
|
waitUntil: 'load',
|
||||||
});
|
});
|
||||||
|
}
|
||||||
const rebuildHtml = (
|
const rebuildHtml = (
|
||||||
await page.evaluate(`${this.code}
|
await page.evaluate(`${this.code}
|
||||||
const x = new XMLSerializer();
|
const x = new XMLSerializer();
|
||||||
const [snap] = rrweb.snapshot(document);
|
const [snap] = rrweb.snapshot(document);
|
||||||
x.serializeToString(rrweb.rebuild(snap, { doc: document })[0]);
|
let out = x.serializeToString(rrweb.rebuild(snap, { doc: document })[0]);
|
||||||
|
if (document.querySelector('html').getAttribute('xmlns') !== 'http://www.w3.org/1999/xhtml') {
|
||||||
|
// this is just an artefact of serializeToString
|
||||||
|
out = out.replace(' xmlns=\"http://www.w3.org/1999/xhtml\"', '');
|
||||||
|
}
|
||||||
|
out; // return
|
||||||
`)
|
`)
|
||||||
).replace(/\n\n/g, '');
|
).replace(/\n\n/g, '');
|
||||||
const result = matchSnapshot(rebuildHtml, __filename, title);
|
const result = matchSnapshot(rebuildHtml, __filename, title);
|
||||||
assert(result.pass, result.pass ? '' : result.report());
|
assert(result.pass, result.pass ? '' : result.report());
|
||||||
}).timeout(5000);
|
}).timeout(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
it('correctly triggers backCompat mode and rendering', async () => {
|
||||||
|
const page: puppeteer.Page = await this.browser.newPage();
|
||||||
|
// console for debug
|
||||||
|
// tslint:disable-next-line: no-console
|
||||||
|
page.on('console', (msg) => console.log(msg.text()));
|
||||||
|
|
||||||
|
await page.goto('http://localhost:3030/html/compat-mode.html', {
|
||||||
|
waitUntil: 'load',
|
||||||
|
});
|
||||||
|
const compatMode = await page.evaluate('document.compatMode');
|
||||||
|
assert(compatMode === 'BackCompat', compatMode + ' for compat-mode.html should be BackCompat as DOCTYPE is deliberately omitted');
|
||||||
|
const renderedHeight = await page.evaluate('document.querySelector("center").clientHeight');
|
||||||
|
// can remove following assertion if dimensions of page change
|
||||||
|
assert(renderedHeight < 400, `pre-check: images will be rendered ~326px high in BackCompat mode, and ~588px in CSS1Compat mode; getting: ${renderedHeight}px`)
|
||||||
|
const rebuildRenderedHeight = await page.evaluate(`${this.code}
|
||||||
|
const [snap] = rrweb.snapshot(document);
|
||||||
|
const iframe = document.createElement('iframe');
|
||||||
|
iframe.setAttribute('width', document.body.clientWidth)
|
||||||
|
iframe.setAttribute('height', document.body.clientHeight)
|
||||||
|
iframe.style.transform = 'scale(0.3)'; // mini-me
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
// magic here! rebuild in a new iframe
|
||||||
|
const rebuildNode = rrweb.rebuild(snap, { doc: iframe.contentDocument })[0];
|
||||||
|
iframe.contentDocument.querySelector('center').clientHeight
|
||||||
|
`);
|
||||||
|
const rebuildCompatMode = await page.evaluate('document.querySelector("iframe").contentDocument.compatMode');
|
||||||
|
assert(rebuildCompatMode === 'BackCompat', 'rebuilt compatMode should match source compatMode, but doesn\'t: ' + rebuildCompatMode);
|
||||||
|
assert(rebuildRenderedHeight === renderedHeight, 'rebuilt height (${rebuildRenderedHeight}) should equal original height (${renderedHeight})')
|
||||||
|
}).timeout(5000);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('iframe integration tests', function (this: ISuite) {
|
describe('iframe integration tests', function (this: ISuite) {
|
||||||
const iframeHtml = path.join(__dirname, 'iframe-html/main.html');
|
|
||||||
const raw = fs.readFileSync(iframeHtml, 'utf-8');
|
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
this.server = await server();
|
this.server = await server();
|
||||||
@@ -151,8 +205,7 @@ describe('iframe integration tests', function (this: ISuite) {
|
|||||||
// console for debug
|
// console for debug
|
||||||
// tslint:disable-next-line: no-console
|
// tslint:disable-next-line: no-console
|
||||||
page.on('console', (msg) => console.log(msg.text()));
|
page.on('console', (msg) => console.log(msg.text()));
|
||||||
await page.goto(`http://localhost:3030/html`);
|
await page.goto(`http://localhost:3030/iframe-html/main.html`, {
|
||||||
await page.setContent(raw, {
|
|
||||||
waitUntil: 'load',
|
waitUntil: 'load',
|
||||||
});
|
});
|
||||||
const snapshotResult = JSON.stringify(
|
const snapshotResult = JSON.stringify(
|
||||||
@@ -167,9 +220,7 @@ describe('iframe integration tests', function (this: ISuite) {
|
|||||||
}).timeout(5000);
|
}).timeout(5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('shadown DOM integration tests', function (this: ISuite) {
|
describe('shadow DOM integration tests', function (this: ISuite) {
|
||||||
const shadowDomHtml = path.join(__dirname, 'html/shadow-dom.html');
|
|
||||||
const raw = fs.readFileSync(shadowDomHtml, 'utf-8');
|
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
this.server = await server();
|
this.server = await server();
|
||||||
@@ -198,8 +249,7 @@ describe('shadown DOM integration tests', function (this: ISuite) {
|
|||||||
// console for debug
|
// console for debug
|
||||||
// tslint:disable-next-line: no-console
|
// tslint:disable-next-line: no-console
|
||||||
page.on('console', (msg) => console.log(msg.text()));
|
page.on('console', (msg) => console.log(msg.text()));
|
||||||
await page.goto(`http://localhost:3030/html`);
|
await page.goto(`http://localhost:3030/html/shadow-dom.html`, {
|
||||||
await page.setContent(raw, {
|
|
||||||
waitUntil: 'load',
|
waitUntil: 'load',
|
||||||
});
|
});
|
||||||
const snapshotResult = JSON.stringify(
|
const snapshotResult = JSON.stringify(
|
||||||
|
|||||||
1
packages/rrweb-snapshot/typings/types.d.ts
vendored
1
packages/rrweb-snapshot/typings/types.d.ts
vendored
@@ -9,6 +9,7 @@ export declare enum NodeType {
|
|||||||
export declare type documentNode = {
|
export declare type documentNode = {
|
||||||
type: NodeType.Document;
|
type: NodeType.Document;
|
||||||
childNodes: serializedNodeWithId[];
|
childNodes: serializedNodeWithId[];
|
||||||
|
compatMode?: string;
|
||||||
};
|
};
|
||||||
export declare type documentTypeNode = {
|
export declare type documentTypeNode = {
|
||||||
type: NodeType.DocumentType;
|
type: NodeType.DocumentType;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,13 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
{
|
||||||
|
\\"type\\": 1,
|
||||||
|
\\"name\\": \\"html\\",
|
||||||
|
\\"publicId\\": \\"\\",
|
||||||
|
\\"systemId\\": \\"\\",
|
||||||
|
\\"id\\": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"html\\",
|
\\"tagName\\": \\"html\\",
|
||||||
@@ -26,7 +33,7 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 3
|
\\"id\\": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -36,7 +43,7 @@ exports[`async-checkout 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\",
|
\\"textContent\\": \\"\\\\n \\",
|
||||||
\\"id\\": 5
|
\\"id\\": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -46,18 +53,18 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"size\\": \\"40\\"
|
\\"size\\": \\"40\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 6
|
\\"id\\": 7
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
||||||
\\"id\\": 7
|
\\"id\\": 8
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 4
|
\\"id\\": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 2
|
\\"id\\": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 1
|
\\"id\\": 1
|
||||||
@@ -76,31 +83,31 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"attributes\\": [],
|
\\"attributes\\": [],
|
||||||
\\"removes\\": [
|
\\"removes\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 4,
|
\\"parentId\\": 5,
|
||||||
\\"id\\": 6
|
\\"id\\": 7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 4,
|
\\"parentId\\": 5,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"p\\",
|
\\"tagName\\": \\"p\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 8
|
\\"id\\": 9
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"parentId\\": 8,
|
\\"parentId\\": 9,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"span\\",
|
\\"tagName\\": \\"span\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 9
|
\\"id\\": 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -115,12 +122,12 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"removes\\": [],
|
\\"removes\\": [],
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 9,
|
\\"parentId\\": 10,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"test\\",
|
\\"textContent\\": \\"test\\",
|
||||||
\\"id\\": 10
|
\\"id\\": 11
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -140,6 +147,13 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
{
|
||||||
|
\\"type\\": 1,
|
||||||
|
\\"name\\": \\"html\\",
|
||||||
|
\\"publicId\\": \\"\\",
|
||||||
|
\\"systemId\\": \\"\\",
|
||||||
|
\\"id\\": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"html\\",
|
\\"tagName\\": \\"html\\",
|
||||||
@@ -150,7 +164,7 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 3
|
\\"id\\": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -160,12 +174,12 @@ exports[`async-checkout 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\",
|
\\"textContent\\": \\"\\\\n \\",
|
||||||
\\"id\\": 5
|
\\"id\\": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
||||||
\\"id\\": 7
|
\\"id\\": 8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -180,19 +194,19 @@ exports[`async-checkout 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"test\\",
|
\\"textContent\\": \\"test\\",
|
||||||
|
\\"id\\": 11
|
||||||
|
}
|
||||||
|
],
|
||||||
\\"id\\": 10
|
\\"id\\": 10
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 9
|
\\"id\\": 9
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 8
|
\\"id\\": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 4
|
\\"id\\": 3
|
||||||
}
|
|
||||||
],
|
|
||||||
\\"id\\": 2
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 1
|
\\"id\\": 1
|
||||||
@@ -211,29 +225,29 @@ exports[`async-checkout 1`] = `
|
|||||||
\\"attributes\\": [],
|
\\"attributes\\": [],
|
||||||
\\"removes\\": [
|
\\"removes\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 8,
|
\\"parentId\\": 9,
|
||||||
\\"id\\": 9
|
\\"id\\": 10
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 4,
|
\\"parentId\\": 5,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"span\\",
|
\\"tagName\\": \\"span\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 9
|
\\"id\\": 10
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"parentId\\": 9,
|
\\"parentId\\": 10,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"test\\",
|
\\"textContent\\": \\"test\\",
|
||||||
\\"id\\": 10
|
\\"id\\": 11
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -258,6 +272,13 @@ exports[`custom-event 1`] = `
|
|||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
{
|
||||||
|
\\"type\\": 1,
|
||||||
|
\\"name\\": \\"html\\",
|
||||||
|
\\"publicId\\": \\"\\",
|
||||||
|
\\"systemId\\": \\"\\",
|
||||||
|
\\"id\\": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"html\\",
|
\\"tagName\\": \\"html\\",
|
||||||
@@ -268,7 +289,7 @@ exports[`custom-event 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 3
|
\\"id\\": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -278,7 +299,7 @@ exports[`custom-event 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\",
|
\\"textContent\\": \\"\\\\n \\",
|
||||||
\\"id\\": 5
|
\\"id\\": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -288,18 +309,18 @@ exports[`custom-event 1`] = `
|
|||||||
\\"size\\": \\"40\\"
|
\\"size\\": \\"40\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 6
|
\\"id\\": 7
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
||||||
\\"id\\": 7
|
\\"id\\": 8
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 4
|
\\"id\\": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 2
|
\\"id\\": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 1
|
\\"id\\": 1
|
||||||
@@ -345,6 +366,13 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
{
|
||||||
|
\\"type\\": 1,
|
||||||
|
\\"name\\": \\"html\\",
|
||||||
|
\\"publicId\\": \\"\\",
|
||||||
|
\\"systemId\\": \\"\\",
|
||||||
|
\\"id\\": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"html\\",
|
\\"tagName\\": \\"html\\",
|
||||||
@@ -355,7 +383,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 3
|
\\"id\\": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -365,7 +393,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\",
|
\\"textContent\\": \\"\\\\n \\",
|
||||||
\\"id\\": 5
|
\\"id\\": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -377,16 +405,16 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n </body>\\\\n </html>\\\\n \\",
|
\\"textContent\\": \\"\\\\n </body>\\\\n </html>\\\\n \\",
|
||||||
|
\\"id\\": 8
|
||||||
|
}
|
||||||
|
],
|
||||||
\\"id\\": 7
|
\\"id\\": 7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 6
|
\\"id\\": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 4
|
\\"id\\": 3
|
||||||
}
|
|
||||||
],
|
|
||||||
\\"id\\": 2
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 1
|
\\"id\\": 1
|
||||||
@@ -403,7 +431,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"source\\": 0,
|
\\"source\\": 0,
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 6,
|
\\"parentId\\": 7,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
@@ -418,8 +446,8 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"rootId\\": 8,
|
\\"rootId\\": 9,
|
||||||
\\"id\\": 10
|
\\"id\\": 11
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -434,24 +462,24 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"Mysterious Button\\",
|
\\"textContent\\": \\"Mysterious Button\\",
|
||||||
\\"rootId\\": 8,
|
\\"rootId\\": 9,
|
||||||
|
\\"id\\": 14
|
||||||
|
}
|
||||||
|
],
|
||||||
|
\\"rootId\\": 9,
|
||||||
\\"id\\": 13
|
\\"id\\": 13
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"rootId\\": 8,
|
\\"rootId\\": 9,
|
||||||
\\"id\\": 12
|
\\"id\\": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"rootId\\": 8,
|
\\"rootId\\": 9,
|
||||||
\\"id\\": 11
|
\\"id\\": 10
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"rootId\\": 8,
|
|
||||||
\\"id\\": 9
|
\\"id\\": 9
|
||||||
}
|
}
|
||||||
],
|
|
||||||
\\"id\\": 8
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"removes\\": [],
|
\\"removes\\": [],
|
||||||
@@ -469,7 +497,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"removes\\": [],
|
\\"removes\\": [],
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 10,
|
\\"parentId\\": 11,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -478,8 +506,8 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"_cssText\\": \\"body { background: rgb(0, 0, 0); }@media {\\\\n body { background: rgb(0, 0, 0); }\\\\n}\\"
|
\\"_cssText\\": \\"body { background: rgb(0, 0, 0); }@media {\\\\n body { background: rgb(0, 0, 0); }\\\\n}\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"rootId\\": 8,
|
\\"rootId\\": 9,
|
||||||
\\"id\\": 14
|
\\"id\\": 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -489,7 +517,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 14,
|
\\"id\\": 15,
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"rule\\": \\"body { color: #fff; }\\"
|
\\"rule\\": \\"body { color: #fff; }\\"
|
||||||
@@ -501,7 +529,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 14,
|
\\"id\\": 15,
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"rule\\": \\"body { color: #ccc; }\\",
|
\\"rule\\": \\"body { color: #ccc; }\\",
|
||||||
@@ -517,7 +545,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 14,
|
\\"id\\": 15,
|
||||||
\\"removes\\": [
|
\\"removes\\": [
|
||||||
{
|
{
|
||||||
\\"index\\": 0
|
\\"index\\": 0
|
||||||
@@ -529,7 +557,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 13,
|
\\"source\\": 13,
|
||||||
\\"id\\": 14,
|
\\"id\\": 15,
|
||||||
\\"set\\": {
|
\\"set\\": {
|
||||||
\\"property\\": \\"color\\",
|
\\"property\\": \\"color\\",
|
||||||
\\"value\\": \\"green\\"
|
\\"value\\": \\"green\\"
|
||||||
@@ -543,7 +571,7 @@ exports[`iframe-stylesheet-mutations 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 14,
|
\\"id\\": 15,
|
||||||
\\"removes\\": [
|
\\"removes\\": [
|
||||||
{
|
{
|
||||||
\\"index\\": [
|
\\"index\\": [
|
||||||
@@ -573,6 +601,13 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
{
|
||||||
|
\\"type\\": 1,
|
||||||
|
\\"name\\": \\"html\\",
|
||||||
|
\\"publicId\\": \\"\\",
|
||||||
|
\\"systemId\\": \\"\\",
|
||||||
|
\\"id\\": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"html\\",
|
\\"tagName\\": \\"html\\",
|
||||||
@@ -583,7 +618,7 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 3
|
\\"id\\": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -593,7 +628,7 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\",
|
\\"textContent\\": \\"\\\\n \\",
|
||||||
\\"id\\": 5
|
\\"id\\": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -603,18 +638,18 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"size\\": \\"40\\"
|
\\"size\\": \\"40\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 6
|
\\"id\\": 7
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
||||||
\\"id\\": 7
|
\\"id\\": 8
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 4
|
\\"id\\": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 2
|
\\"id\\": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 1
|
\\"id\\": 1
|
||||||
@@ -634,7 +669,7 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"removes\\": [],
|
\\"removes\\": [],
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 3,
|
\\"parentId\\": 4,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -643,7 +678,7 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"_cssText\\": \\"@media {\\\\n body { background: rgb(0, 0, 0); }\\\\n}\\"
|
\\"_cssText\\": \\"@media {\\\\n body { background: rgb(0, 0, 0); }\\\\n}\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 8
|
\\"id\\": 9
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -653,7 +688,7 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"rule\\": \\"body { color: #fff; }\\",
|
\\"rule\\": \\"body { color: #fff; }\\",
|
||||||
@@ -669,7 +704,7 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"removes\\": [
|
\\"removes\\": [
|
||||||
{
|
{
|
||||||
\\"index\\": [
|
\\"index\\": [
|
||||||
@@ -684,7 +719,7 @@ exports[`nested-stylesheet-rules 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"rule\\": \\"body { color: #ccc; }\\",
|
\\"rule\\": \\"body { color: #ccc; }\\",
|
||||||
@@ -715,6 +750,13 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
{
|
||||||
|
\\"type\\": 1,
|
||||||
|
\\"name\\": \\"html\\",
|
||||||
|
\\"publicId\\": \\"\\",
|
||||||
|
\\"systemId\\": \\"\\",
|
||||||
|
\\"id\\": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"html\\",
|
\\"tagName\\": \\"html\\",
|
||||||
@@ -725,7 +767,7 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 3
|
\\"id\\": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -735,7 +777,7 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\",
|
\\"textContent\\": \\"\\\\n \\",
|
||||||
\\"id\\": 5
|
\\"id\\": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -745,18 +787,18 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
\\"size\\": \\"40\\"
|
\\"size\\": \\"40\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 6
|
\\"id\\": 7
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
||||||
\\"id\\": 7
|
\\"id\\": 8
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 4
|
\\"id\\": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 2
|
\\"id\\": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 1
|
\\"id\\": 1
|
||||||
@@ -776,7 +818,7 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
\\"removes\\": [],
|
\\"removes\\": [],
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 3,
|
\\"parentId\\": 4,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -785,7 +827,7 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
\\"_cssText\\": \\"body { background: rgb(0, 0, 0); }\\"
|
\\"_cssText\\": \\"body { background: rgb(0, 0, 0); }\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 8
|
\\"id\\": 9
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -795,7 +837,7 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 13,
|
\\"source\\": 13,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"set\\": {
|
\\"set\\": {
|
||||||
\\"property\\": \\"color\\",
|
\\"property\\": \\"color\\",
|
||||||
\\"value\\": \\"green\\"
|
\\"value\\": \\"green\\"
|
||||||
@@ -809,7 +851,7 @@ exports[`stylesheet-properties 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 13,
|
\\"source\\": 13,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"remove\\": {
|
\\"remove\\": {
|
||||||
\\"property\\": \\"background\\"
|
\\"property\\": \\"background\\"
|
||||||
},
|
},
|
||||||
@@ -837,6 +879,13 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 0,
|
\\"type\\": 0,
|
||||||
\\"childNodes\\": [
|
\\"childNodes\\": [
|
||||||
|
{
|
||||||
|
\\"type\\": 1,
|
||||||
|
\\"name\\": \\"html\\",
|
||||||
|
\\"publicId\\": \\"\\",
|
||||||
|
\\"systemId\\": \\"\\",
|
||||||
|
\\"id\\": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
\\"tagName\\": \\"html\\",
|
\\"tagName\\": \\"html\\",
|
||||||
@@ -847,7 +896,7 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"tagName\\": \\"head\\",
|
\\"tagName\\": \\"head\\",
|
||||||
\\"attributes\\": {},
|
\\"attributes\\": {},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 3
|
\\"id\\": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -857,7 +906,7 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\",
|
\\"textContent\\": \\"\\\\n \\",
|
||||||
\\"id\\": 5
|
\\"id\\": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -867,18 +916,18 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"size\\": \\"40\\"
|
\\"size\\": \\"40\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 6
|
\\"id\\": 7
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
\\"textContent\\": \\"\\\\n \\\\n \\\\n \\",
|
||||||
\\"id\\": 7
|
\\"id\\": 8
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 4
|
\\"id\\": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 2
|
\\"id\\": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
\\"id\\": 1
|
\\"id\\": 1
|
||||||
@@ -898,7 +947,7 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"removes\\": [],
|
\\"removes\\": [],
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"parentId\\": 3,
|
\\"parentId\\": 4,
|
||||||
\\"nextId\\": null,
|
\\"nextId\\": null,
|
||||||
\\"node\\": {
|
\\"node\\": {
|
||||||
\\"type\\": 2,
|
\\"type\\": 2,
|
||||||
@@ -907,7 +956,7 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"_cssText\\": \\"body { background: rgb(0, 0, 0); }\\"
|
\\"_cssText\\": \\"body { background: rgb(0, 0, 0); }\\"
|
||||||
},
|
},
|
||||||
\\"childNodes\\": [],
|
\\"childNodes\\": [],
|
||||||
\\"id\\": 8
|
\\"id\\": 9
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -917,7 +966,7 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"rule\\": \\"body { color: #fff; }\\"
|
\\"rule\\": \\"body { color: #fff; }\\"
|
||||||
@@ -929,7 +978,7 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"removes\\": [
|
\\"removes\\": [
|
||||||
{
|
{
|
||||||
\\"index\\": 0
|
\\"index\\": 0
|
||||||
@@ -941,7 +990,7 @@ exports[`stylesheet-rules 1`] = `
|
|||||||
\\"type\\": 3,
|
\\"type\\": 3,
|
||||||
\\"data\\": {
|
\\"data\\": {
|
||||||
\\"source\\": 8,
|
\\"source\\": 8,
|
||||||
\\"id\\": 8,
|
\\"id\\": 9,
|
||||||
\\"adds\\": [
|
\\"adds\\": [
|
||||||
{
|
{
|
||||||
\\"rule\\": \\"body { color: #ccc; }\\"
|
\\"rule\\": \\"body { color: #ccc; }\\"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
<body>
|
<body>
|
||||||
<p>mutation observer</p>
|
<p>mutation observer</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ describe('record', function (this: ISuite) {
|
|||||||
setup.call(
|
setup.call(
|
||||||
this,
|
this,
|
||||||
`
|
`
|
||||||
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<input type="text" size="40" />
|
<input type="text" size="40" />
|
||||||
@@ -346,6 +347,7 @@ describe('record iframes', function (this: ISuite) {
|
|||||||
setup.call(
|
setup.call(
|
||||||
this,
|
this,
|
||||||
`
|
`
|
||||||
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<iframe srcdoc="<button>Mysterious Button</button>" />
|
<iframe srcdoc="<button>Mysterious Button</button>" />
|
||||||
|
|||||||
Reference in New Issue
Block a user