Skip to content

Commit

Permalink
Add test for 3D transform-origin support
Browse files Browse the repository at this point in the history
  • Loading branch information
jfsiii authored and John Schulz committed Mar 11, 2013
1 parent 1541b09 commit c2310fd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/UILayer/UILayer.mv
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,25 @@ import prefixed
lookupCSS = ^(dashed) { prefixed.lookup.css[dashed] }
lookupJS = ^(camelCase) { prefixed.lookup.js[camelCase] }

# does the client support the 3 value syntax for `transform-origin`?
prefixed.features.addTest('transform_origin_3d', ^{
propTransform = prefixed.lookup.css.transform;
propOrigin = prefixed.lookup.css['transform-origin'];
cssRule = '#modernizr { '
+ propOrigin + ': 1px 2% 3em;'
+ propTransform + ': rotateY(50deg);'
+ ' }';
test3ValueSyntaxSupport = ^(elem, rule) {
computed = getComputedStyle(elem);
property = prefixed.lookup.js.transformOrigin;
value = computed[ property ];

value.split(' ').length === 3;
};

prefixed.features.testStyles(cssRule, test3ValueSyntaxSupport);
});

module.exports = UILayer = class {
constructor: ^{
# keyword arguments or an object as the first argument are explicit values
Expand Down

0 comments on commit c2310fd

Please sign in to comment.