Elim cr-checkbox
[chromium-blink-merge.git] / chrome / test / data / third_party / spaceport / js / features.js
blobbbf119573460ac20e6ec81e937326cb54305dd10
1 define([ ], function () {
2 // CSS transform feature detection based off of
3 // http://andrew-hoyer.com/experiments/rain/
4 // Public domain
6 var style = document.createElement('div').style;
8 function getFirstIn(object, propertyNames) {
9 return propertyNames.filter(function(name) {
10 return name in object;
11 }).shift();
14 var transformOriginStyleProperty = getFirstIn(style, [
15 'transformOrigin',
16 'WebkitTransformOrigin',
17 'MozTransformOrigin',
18 'msTransformOrigin',
19 'OTransformOrigin'
20 ]);
22 var transformStyleProperty = getFirstIn(style, [
23 'transform',
24 'WebkitTransform',
25 'MozTransform',
26 'msTransform',
27 'OTransform'
28 ]);
30 var CSSMatrix = window[getFirstIn(window, [
31 'CSSMatrix',
32 'WebKitCSSMatrix',
33 'WebkitCSSMatrix'
34 ])];
36 // Firefox has a bug where it requires 'px' for translate matrix
37 // elements (where it should accept plain numbers).
38 var matrixTranslateSuffix = transformStyleProperty === 'MozTransform' ? 'px' : '';
40 return {
41 transformOriginStyleProperty: transformOriginStyleProperty,
42 transformStyleProperty: transformStyleProperty,
43 matrixTranslateSuffix: matrixTranslateSuffix,
44 CSSMatrix: CSSMatrix
46 });