This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Increase performance when checking if element is animatable #13784
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
they('should not animate an element when the pinned element (which is the $prop element), is pinned to an element that is not a child of the $rootElement', | ||
['same', 'parent', 'grandparent'], | ||
function(elementRelation) { | ||
inject(function($animate, $compile, $document, $rootElement, $rootScope) { |
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.
$compile
is not used.
(Yes, in other tests too 😃)
Narretz
force-pushed
the
perf-animate-check
branch
from
January 18, 2016 14:38
47222c9
to
d2e3790
Compare
@gkalpak I've reverted the change, and recursive pinning is now allowed again. We can always change that later. And I've found and fixed another bug with the host element detection. Can you please review again? |
Narretz
force-pushed
the
perf-animate-check
branch
from
January 18, 2016 15:00
d2e3790
to
5068ca1
Compare
they('should not animate an element when the pinned element (which is the $prop element), is pinned to an element that is not a child of the $rootElement', | ||
['same', 'parent', 'grandparent'], | ||
function(elementRelation) { | ||
inject(function($animate, $compile, $document, $rootElement, $rootScope) { |
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.
$compile
is not used (here and below).
Narretz
force-pushed
the
perf-animate-check
branch
from
January 18, 2016 15:27
5068ca1
to
729733b
Compare
@gkalpak Thanks for the review. Should be all good now. |
LGTM 😃 |
This commit fixes two bugs: 1) Previously, animate would assume that a found host element was part of the $rootElement (while it's possible that it is also outside the root). 2) Previously, if a parent of the animated element was pinned to a host element, the host would not be checked regarding animations enabled status etc. Closes angular#13783
This commit speeds up the code that checks if an element can be animated, for the following two cases: The checks will be sped up in cases where the animation is disabled via $animate.enabled(element, false) on any parent element. A minor speed-up is also included for cases where the $rootElement of the app (the bootstrap element) is on the body or lower in the DOM tree.
Narretz
force-pushed
the
perf-animate-check
branch
from
January 19, 2016 12:14
729733b
to
683bd92
Compare
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.
Built upon PR #13783