This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Change Document Polling from Time Interval to Event #8009
Merged
Merged
Conversation
This file contains 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
@@ -1,12 +1,15 @@ | |||
ViewRegistry = require '../src/view-registry' | |||
{View} = require '../src/space-pen-extensions' | |||
|
|||
describe "ViewRegistry", -> | |||
fdescribe "ViewRegistry", -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nof
This allows DOM mutation observers to detect changes to the global styles.
pollDOM will always be called when window is resized
nathansobo
force-pushed
the
jl-ns-battery-life
branch
from
July 23, 2015 18:03
c3ae46f
to
c18db48
Compare
nathansobo
pushed a commit
that referenced
this pull request
Jul 23, 2015
Change Document Polling from Time Interval to Event
Thanks @jlord! |
wowoowo! Awesome! Thank you @nathansobo! |
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.
🍐 ing with @nathansobo
Previously document polling happened through timed intervals causing continued use of CPU when the editor was unfocused.
This PR changes the polling to occur when the DOM is mutated or the window is resized (since that doesn't fall under a DOM mutation). Additionally it changes the way Atom updates the CSS so that it occurs as a mutation and the event is captured. Furthermore! It prevents the cursor from ever starting to blink if it wasn't blinking already which can be caused, for instance, when content is changed in the Settings View.
We've added test coverage but are still testing this branch out to be sure we've:
cc @atom/feedback, try out this branch too if ya can 👍
Fixes #4019
Quality Initiative #7995