Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3960)

Unified Diff: chrome/test/data/third_party/spaceport/js/features.js

Issue 10154006: Add test data for spaceport benchmark. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/third_party/spaceport/js/features.js
diff --git a/chrome/test/data/third_party/spaceport/js/features.js b/chrome/test/data/third_party/spaceport/js/features.js
new file mode 100644
index 0000000000000000000000000000000000000000..bbf119573460ac20e6ec81e937326cb54305dd10
--- /dev/null
+++ b/chrome/test/data/third_party/spaceport/js/features.js
@@ -0,0 +1,46 @@
+define([ ], function () {
+ // CSS transform feature detection based off of
+ // http://andrew-hoyer.com/experiments/rain/
+ // Public domain
+
+ var style = document.createElement('div').style;
+
+ function getFirstIn(object, propertyNames) {
+ return propertyNames.filter(function(name) {
+ return name in object;
+ }).shift();
+ }
+
+ var transformOriginStyleProperty = getFirstIn(style, [
+ 'transformOrigin',
+ 'WebkitTransformOrigin',
+ 'MozTransformOrigin',
+ 'msTransformOrigin',
+ 'OTransformOrigin'
+ ]);
+
+ var transformStyleProperty = getFirstIn(style, [
+ 'transform',
+ 'WebkitTransform',
+ 'MozTransform',
+ 'msTransform',
+ 'OTransform'
+ ]);
+
+ var CSSMatrix = window[getFirstIn(window, [
+ 'CSSMatrix',
+ 'WebKitCSSMatrix',
+ 'WebkitCSSMatrix'
+ ])];
+
+ // Firefox has a bug where it requires 'px' for translate matrix
+ // elements (where it should accept plain numbers).
+ var matrixTranslateSuffix = transformStyleProperty === 'MozTransform' ? 'px' : '';
+
+ return {
+ transformOriginStyleProperty: transformOriginStyleProperty,
+ transformStyleProperty: transformStyleProperty,
+ matrixTranslateSuffix: matrixTranslateSuffix,
+ CSSMatrix: CSSMatrix
+ }
+});
« no previous file with comments | « chrome/test/data/third_party/spaceport/js/curl.js ('k') | chrome/test/data/third_party/spaceport/js/fullReport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698