File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
packages/rrweb/src/record Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -226,19 +226,25 @@ export default class MutationBuffer {
226
226
// not bad, just moved
227
227
ancestorBad = false ;
228
228
}
229
-
230
229
if ( ! inDom ( parentNode ) ) {
230
+ // this check should overrule moved also
231
231
ancestorBad = true ;
232
232
}
233
233
234
- while ( true ) {
235
- nextSibling = n . nextSibling ;
236
- if ( this . addedSet . has ( nextSibling as Node ) ) {
237
- // keep going as we can't serialize a node before it's next sibling (nextId requirement)
238
- n = nextSibling as Node ;
239
- continue ;
234
+ if ( this . addedSet . has ( parentNode . lastChild as Node ) ) {
235
+ // jump instead of crawling nextSibling to nextSibling
236
+ n = parentNode . lastChild as Node ;
237
+ nextSibling = null ;
238
+ } else {
239
+ while ( true ) {
240
+ nextSibling = n . nextSibling ;
241
+ if ( this . addedSet . has ( nextSibling as Node ) ) {
242
+ // keep going as we can't serialize a node before it's next sibling (nextId requirement)
243
+ n = nextSibling as Node ;
244
+ continue ;
245
+ }
246
+ break ;
240
247
}
241
- break ;
242
248
}
243
249
244
250
parentId = isShadowRoot ( parentNode )
You can’t perform that action at this time.
0 commit comments