Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

perf($animate): listen for document visibility changes #14519

Closed
wants to merge 2 commits into from

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Apr 26, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change?

Please check if the PR fulfills these requirements

Other information:

perf(ngAnimate): listen for document visibility changes

Accessing the document for the hidden state is costly for
platforms like Electron. Instead, listen for visibilitychange
and store the state.

(#14071)
Closes #14066

perf(ngAnimate): listen for document visibility changes

Accessing the document for the hidden state is costly for
platforms like Electron. Instead, listen for visibilitychange
and store the state.

(angular#14071)
Closes angular#14066
});

function changeListener() {
hidden = doc.hidden;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are checking if doc is available in line 42 but not here. Is this correct? Is the check above necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the check was originally introduced by @matsko in case the document isn't available. I assume that when the document isn't available I can't add a listener anyway.

@asnar
Copy link

asnar commented Apr 28, 2016

On Apr 27, 2016 2:41 AM, "Martin Staffa" [email protected] wrote:

What kind of change does this PR introduce? (Bug fix, feature, docs
update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change?

Please check if the PR fulfills these requirements

The commit message follows our guidelines:
https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format
Tests for the changes have been added (for bug fixes / features)
Docs have been added / updated (for bug fixes / features)

Other information:

perf(ngAnimate): listen for document visibility changes

Accessing the document for the hidden state is costly for
platforms like Electron. Instead, listen for visibilitychange
and store the state.

(#14071)
Closes #14066


You can view, comment on, or merge this pull request online at:

#14519

Commit Summary
perf($animate): listen for document visibility changes
File Changes
M src/AngularPublic.js (2)
M src/ng/animateRunner.js (10)
M src/ng/document.js (26)
M src/ngAnimate/animateQueue.js (6)
M test/ng/animateRunnerSpec.js (11)
M test/ng/compileSpec.js (43)
M test/ng/documentSpec.js (26)
M test/ngAnimate/animateSpec.js (25)
Patch Links:
https://github.com/angular/angular.js/pull/14519.patch
https://github.com/angular/angular.js/pull/14519.diff


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@gkalpak gkalpak added this to the 1.5.x milestone Apr 29, 2016
@Narretz
Copy link
Contributor Author

Narretz commented May 6, 2016

Superseded by #14568. Turns out you can't squash the PR when your try to merge from the same branch in your fork.

@Narretz Narretz closed this May 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants