fix(animations): ensure web-animations understands a numeric CSS perspective value

Closes #14007
This commit is contained in:
Matias Niemelä 2017-06-02 13:54:41 -07:00 committed by Alex Rickabaugh
parent b55adee982
commit 819514aeba
2 changed files with 7 additions and 1 deletions

View File

@ -35,7 +35,7 @@ export class WebAnimationsStyleNormalizer extends AnimationStyleNormalizer {
} }
const DIMENSIONAL_PROP_MAP = makeBooleanMap( const DIMENSIONAL_PROP_MAP = makeBooleanMap(
'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' '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'
.split(',')); .split(','));
function makeBooleanMap(keys: string[]): {[key: string]: boolean} { function makeBooleanMap(keys: string[]): {[key: string]: boolean} {

View File

@ -59,6 +59,12 @@ export function main() {
expect(normalize('borderWidth', 'inherit')).toEqual('inherit'); expect(normalize('borderWidth', 'inherit')).toEqual('inherit');
expect(normalize('paddingTop', 'calc(500px + 200px)')).toEqual('calc(500px + 200px)'); expect(normalize('paddingTop', 'calc(500px + 200px)')).toEqual('calc(500px + 200px)');
}); });
it('should allow `perspective` to be a numerical property', () => {
expect(normalize('perspective', 10)).toEqual('10px');
expect(normalize('perspective', '100pt')).toEqual('100pt');
expect(normalize('perspective', 'none')).toEqual('none');
});
}); });
}); });
} }