fix(animations): process shorthand margin
and padding
styles correctly (#35701)
Prior to this patch, the `margin` and `padding` properties were not detected properly by Firefox due to them being shorthand properties. This patch ensures that both `margin` and `padding` are converted read as `top right bottom left` in the event that the shorthand property detection fails for auto-styling in Angular animations. Fix #35463 (FW-1886) PR Close #35701
This commit is contained in:
@ -6,9 +6,10 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {AnimateTimings, AnimationMetadata, AnimationMetadataType, AnimationOptions, sequence, ɵStyleData} from '@angular/animations';
|
||||
|
||||
import {Ast as AnimationAst, AstVisitor as AnimationAstVisitor} from './dsl/animation_ast';
|
||||
import {AnimationDslVisitor} from './dsl/animation_dsl_visitor';
|
||||
import {isNode} from './render/shared';
|
||||
import {computeStyle, isNode} from './render/shared';
|
||||
|
||||
export const ONE_SECOND = 1000;
|
||||
|
||||
@ -340,7 +341,3 @@ export function visitDslNode(visitor: any, node: any, context: any): any {
|
||||
throw new Error(`Unable to resolve animation metadata node #${node.type}`);
|
||||
}
|
||||
}
|
||||
|
||||
export function computeStyle(element: any, prop: string): string {
|
||||
return (<any>window.getComputedStyle(element))[prop];
|
||||
}
|
||||
|
Reference in New Issue
Block a user