This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Eliminate TextEditorComponent's reliance on MutationObserver for detecting changes in visibility, dimensions, and background color#13795
Merged
nathansobo merged 13 commits intotj-upgrade-electronfrom Feb 18, 2017
Conversation
78b4ee9 to
27a83c6
Compare
Contributor
|
Amazing work, this looks great. ⚡️ |
Contributor
Author
|
Remaining failures are related to calling |
nathansobo
pushed a commit
to atom/wrap-guide
that referenced
this pull request
Feb 14, 2017
Signed-off-by: Antonio Scandurra <as-cii@github.com>
nathansobo
pushed a commit
to atom/find-and-replace
that referenced
this pull request
Feb 14, 2017
8c07e68 to
91181a3
Compare
84b9b7a to
91181a3
Compare
added 13 commits
February 17, 2017 10:19
This is an alternative to relying on pollDOM to detect when the editor becomes visible. Our goal is to remove pollDOM in the next few commits. Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This avoids needing to poll to detect resizes. Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This is unlikely but it’s easy enough to support Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
And don’t sample font styling in pollDOM, which we are aiming to eliminate. Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
Previously, the shadow boundary made this impossible, but the new CSS is way simpler than the JS we’re replacing and removes another dependency on DOM polling.
And remove pollDOM method entirely. Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
Supporting it via mutation observers has a bad impact on frame rate.
17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the introduction of Chrome 53 in Electron 1.4, we now have access to a fully functional
IntersectionObserverAPI, which can be used to detect when editors change in visibility. This means we can discard the previousMutationObserverbased polling system, which creates a drag on frame rates in certain circumstances. This impact is hard to quantify because measuring the frame rate with mutation observers in place in the current scrolling scheme seems to slow performance dramatically, making this hard to measure. Regardless it's a big simplification to not require full DOM observation.This PR replaces polling with the following approaches:
IntersectionObserverelement-resize-detectorlibrary.background-color: inherit(now possible with the removal of the shadow DOM)