Skip to content

Commit 819514a

Browse files
matskoalxhub
authored andcommitted
fix(animations): ensure web-animations understands a numeric CSS perspective value
Closes #14007
1 parent b55adee commit 819514a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/animations/browser/src/dsl/style_normalization/web_animations_style_normalizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class WebAnimationsStyleNormalizer extends AnimationStyleNormalizer {
3535
}
3636

3737
const DIMENSIONAL_PROP_MAP = makeBooleanMap(
38-
'width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent'
38+
'width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective'
3939
.split(','));
4040

4141
function makeBooleanMap(keys: string[]): {[key: string]: boolean} {

packages/animations/browser/test/dsl/style_normalizer/web_animations_style_normalizer_spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ export function main() {
5959
expect(normalize('borderWidth', 'inherit')).toEqual('inherit');
6060
expect(normalize('paddingTop', 'calc(500px + 200px)')).toEqual('calc(500px + 200px)');
6161
});
62+
63+
it('should allow `perspective` to be a numerical property', () => {
64+
expect(normalize('perspective', 10)).toEqual('10px');
65+
expect(normalize('perspective', '100pt')).toEqual('100pt');
66+
expect(normalize('perspective', 'none')).toEqual('none');
67+
});
6268
});
6369
});
6470
}

0 commit comments

Comments
 (0)