Skip to content

CSS stylesheet insertRule only works on first snapshot for IncrementalSource.StylesheetRule #563

@jay-khatri

Description

@jay-khatri

Hi there. We've been having issues on our recordings where on the first load/playback of a set of events, the insertRule method on the <style/> element is reflected on the DOM, but when the events up to a certain timestamp are retraced (for a pause() action, e.g.) the same changes aren't reflected.

Specifically, this seems to be happening on IncrementalSnapshot events with IncrementalSource.StyleSheetRule.

For example, for these events, if you play the recording for the first time, the styles for this input box
image
look fine, but if you click back to around 3:50 after playing it through, the styles are no longer there:

image

I'm not sure whether this is the correct way to fix it, but by simply appending rules to the textContent of the <style/> rule, rather than using insertRule, it seems to work. See here:
https://github.com/jay-khatri/rrweb/pull/1/files

@eoghanmurray @Yuyz0112 any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions