Open otan opened 3 weeks ago
Diving into this a bit more, it seems it's because of the way we read cssRules
to stringifyStylesheet
.
Running document.styleSheets[0].cssRules[0].cssText
on the html
page linked above yields the same erroneous output we see above:
which explains the results. the bug indeed only happens when rrweb records on chrome but not safari
Preflight Checklist
What package is this bug report for?
rrweb
Version
v2.0.0-alpha.11
Expected Behavior
When
all:unset
is set, I expect no change to my rendered webpage.Actual Behavior
When
all:unset
is encountered, the css class marks every element as unset except for those sete.g. if we have
becomes this in the
events.json
snapshot (making the replayer show an inaccurate screenshot):which overrides
padding-left
andpadding-right
incorrectly compared to the original css. If theall:unset
was done in order (i.e. insert all variables asunset
, then not resort them into alphabetical order), it would've been correct.Steps to Reproduce
Run rrweb snapshot on the following webpage, and then run it through the replayer:
it should look like this:
but the replayer shows (notice the padding + border removed):
this is because the
all:unset
expands incorrectly withpadding-inline: unset
overridingpadding: 4px
forpadding-left/padding-right
andborder-inline: unset
overridingborder: 1px
forborder-left/right
:Testcase Gist URL
https://rrwebdebug.com/play/index.html?url=https%3A%2F%2Fgist.github.com%2Fotan%2F334b83336c7872c750bb5ef3357435fb&version=2.0.0-alpha.11&virtual-dom=on&play=on
Additional Information
No response