-
Notifications
You must be signed in to change notification settings - Fork 27.1k
getAnimationStyle causes exceptions in older browsers #24094
Copy link
Copy link
Closed
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: animationslegacy animations package only. Otherwise use area: core.legacy animations package only. Otherwise use area: core.freq3: highregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous versionstate: has PRtype: bug/fix
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
Errors are thrown during collection of animation styles (in older browsers).
The problem is on this line:
angular/packages/animations/browser/src/render/css_keyframes/element_animation_style_handler.ts
Line 137 in 13cb75d
| return element.style[ANIMATION_PROP + name]; |
Most of browsers will return empty string if the style property is not set. But some browsers (like Chrome on Android 4.4) returns null instead of empty string.
Several string functions are applied on the output of the method "getAnimationStyle" - like trim, split, indexOf, etc... But if the output of the"getAnimationStyle" is null, exception is thrown.
Simple fix of this bug:
return element.style[ANIMATION_PROP + name] || '';
Expected behavior
Animation should work without errors.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Angular version: 6.0.3
Browser:
- [ ] Chrome (desktop) version XX
- [X] Chrome (Android) version 34
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: animationslegacy animations package only. Otherwise use area: core.legacy animations package only. Otherwise use area: core.freq3: highregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous versionstate: has PRtype: bug/fix