return id node map when rebuild

This commit is contained in:
Yanzhen Yu
2018-10-12 12:43:16 +08:00
parent b3fdc44fc7
commit 1ddb0a3343
5 changed files with 23 additions and 6 deletions

View File

@@ -4,3 +4,6 @@ body {
p {
color: red;
}
body > p {
color: yellow;
}

View File

@@ -25,7 +25,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>with style sheet</title>
<style>body { margin: 0px; }p { color: red; }</style>
<style>body { margin: 0px; }p { color: red; }body > p { color: yellow; }</style>
</head>
<body>

View File

@@ -99,7 +99,7 @@ describe('integration tests', () => {
const rebuildHtml = (await page.evaluate(`${this.code}
const x = new XMLSerializer();
const [snap] = rrweb.snapshot(document);
x.serializeToString(rrweb.rebuild(snap));
x.serializeToString(rrweb.rebuild(snap)[0]);
`)).replace(/\n\n/g, '');
await page.goto(`http://localhost:3030/html`);
await page.setContent(html.dest);