Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 var testId = 'test-' + ++nextKeyframeId; | 187 var testId = 'test-' + ++nextKeyframeId; |
| 188 cssText += '@' + webkitPrefix + 'keyframes ' + testId + ' { \n' + | 188 cssText += '@' + webkitPrefix + 'keyframes ' + testId + ' { \n' + |
| 189 ' 0% { ' + params.property + ': ' + params.from + '; }\n' + | 189 ' 0% { ' + params.property + ': ' + params.from + '; }\n' + |
| 190 ' 100% { ' + params.property + ': ' + params.to + '; }\n' + | 190 ' 100% { ' + params.property + ': ' + params.to + '; }\n' + |
| 191 '}\n'; | 191 '}\n'; |
| 192 return testId; | 192 return testId; |
| 193 } | 193 } |
| 194 | 194 |
| 195 function normalizeValue(value) { | 195 function normalizeValue(value) { |
| 196 return value. | 196 return value. |
| 197 // Round numbers to two decimal places. | 197 // Round numbers to one decimal place. Our layout units are not exact |
|
dstockwell
2013/11/27 23:49:31
This shouldn't be necessary and isn't really appro
cbiesinger
2013/12/18 02:09:12
Reverted, see below.
| |
| 198 // enough for any finer comparisons -- a difference of 1 LayoutUnit is | |
| 199 // 0.016 pixels. | |
| 198 replace(/-?\d*\.\d+/g, function(n) { | 200 replace(/-?\d*\.\d+/g, function(n) { |
| 199 return (parseFloat(n).toFixed(2)). | 201 return (parseFloat(n).toFixed(1)). |
| 200 replace(/\.0*$/, ''). | 202 replace(/\.0*$/, ''). |
| 201 replace(/^-0$/, '0'); | 203 replace(/^-0$/, '0'); |
| 202 }). | 204 }). |
| 203 // Place whitespace between tokens. | 205 // Place whitespace between tokens. |
| 204 replace(/([\w\d.]+|[^\s])/g, '$1 '). | 206 replace(/([\w\d.]+|[^\s])/g, '$1 '). |
| 205 replace(/\s+/g, ' '); | 207 replace(/\s+/g, ' '); |
| 206 } | 208 } |
| 207 | 209 |
| 208 function createTargetContainer(id) { | 210 function createTargetContainer(id) { |
| 209 var targetContainer = document.createElement('div'); | 211 var targetContainer = document.createElement('div'); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 finishTest(); | 368 finishTest(); |
| 367 }, 10000); | 369 }, 10000); |
| 368 } | 370 } |
| 369 | 371 |
| 370 window.runAsRefTest = runAsRefTest; | 372 window.runAsRefTest = runAsRefTest; |
| 371 window.testInterpolationAt = testInterpolationAt; | 373 window.testInterpolationAt = testInterpolationAt; |
| 372 window.assertInterpolation = assertInterpolation; | 374 window.assertInterpolation = assertInterpolation; |
| 373 window.convertToReference = convertToReference; | 375 window.convertToReference = convertToReference; |
| 374 window.afterTest = afterTest; | 376 window.afterTest = afterTest; |
| 375 })(); | 377 })(); |
| OLD | NEW |