Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(snapshots): switch MutationObserver to only observer attributes #5220

Merged
merged 1 commit into from Feb 1, 2021
Merged

feat(snapshots): switch MutationObserver to only observer attributes #5220

merged 1 commit into from Feb 1, 2021

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Jan 30, 2021

Everything but attributes in the light dom is manually compared during
DOM traversal, for example child nodes or scroll offset.

This way we get a bullet-proof solution that works with input values,
scroll offsets, shadow dom and anything else web comes up with.

We also restore scroll only on the document scrolling element, for
performance reasons. We should figure out the story around scrolling.

Changes stationary snapshots from ~0.5ms to ~2.5ms due to DOM traversal.

Everything but attributes in the light dom is manually compared during
DOM traversal, for example child nodes or scroll offset.

This way we get a bullet-proof solution that works with input values,
scroll offsets, shadow dom and anything else web comes up with.

We also restore scroll only on the document scrolling element, for
performance reasons. We should figure out the story around scrolling.

Changes stationary snapshots from ~0.5ms to ~2.5ms due to DOM traversal.
@dgozman dgozman changed the title feat(snapshots): switch from MutationObserver to "dom diff" feat(snapshots): switch MutationObserver to only observer attributes Jan 30, 2021
@dgozman dgozman merged commit a9de3d8 into microsoft:master Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants