fix: duplicate textContent for style element cause incremental style mutation invalid (#1417)
fix style element corner case - historically we have recorded duplicated css content in certain cases (demonstrated by the attached replayer test). This fix ensures that the replayer doesn't doubly add the content, which can cause problems when further mutations occur --------- Review and further tests contributed by: Eoghan Murray <eoghan@getthere.ie>
This commit is contained in:
@@ -160,8 +160,9 @@ function buildNode(
|
||||
value = adaptCssForReplay(value, cache);
|
||||
}
|
||||
if ((isTextarea || isRemoteOrDynamicCss) && typeof value === 'string') {
|
||||
node.appendChild(doc.createTextNode(value));
|
||||
// https://github.com/rrweb-io/rrweb/issues/112
|
||||
// https://github.com/rrweb-io/rrweb/pull/1351
|
||||
node.appendChild(doc.createTextNode(value));
|
||||
n.childNodes = []; // value overrides childNodes
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user