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

Side by Side Diff: LayoutTests/animations/resources/animation-test-helpers.js

Issue 23241010: Support subpixel values for text-shadow and box-shadow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed review comments Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* This is the helper function to run animation tests: 1 /* This is the helper function to run animation tests:
2 2
3 Test page requirements: 3 Test page requirements:
4 - The body must contain an empty div with id "result" 4 - The body must contain an empty div with id "result"
5 - Call this function directly from the <script> inside the test page 5 - Call this function directly from the <script> inside the test page
6 6
7 Function parameters: 7 Function parameters:
8 expected [required]: an array of arrays defining a set of CSS properties tha t must have given values at specific times (see below) 8 expected [required]: an array of arrays defining a set of CSS properties tha t must have given values at specific times (see below)
9 callbacks [optional]: a function to be executed immediately after animation starts; 9 callbacks [optional]: a function to be executed immediately after animation starts;
10 or, an object in the form {time: function} containing functions to be 10 or, an object in the form {time: function} containing functions to be
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 case CSSValue.CSS_PRIMITIVE_VALUE: 303 case CSSValue.CSS_PRIMITIVE_VALUE:
304 if (computedStyle[i].primitiveType == CSSPrimitiveValue.CSS_ STRING) 304 if (computedStyle[i].primitiveType == CSSPrimitiveValue.CSS_ STRING)
305 values.push(computedStyle[i].getStringValue()); 305 values.push(computedStyle[i].getStringValue());
306 else 306 else
307 values.push(computedStyle[i].getFloatValue(CSSPrimitiveV alue.CSS_NUMBER)); 307 values.push(computedStyle[i].getFloatValue(CSSPrimitiveV alue.CSS_NUMBER));
308 break; 308 break;
309 case CSSValue.CSS_CUSTOM: 309 case CSSValue.CSS_CUSTOM:
310 // arbitrarily pick shadow-x and shadow-y 310 // arbitrarily pick shadow-x and shadow-y
311 if (property == 'box-shadow' || property == 'text-shadow') { 311 if (property == 'box-shadow' || property == 'text-shadow') {
312 var text = computedStyle[i].cssText; 312 var text = computedStyle[i].cssText;
313 // Shadow cssText looks like "rgb(0, 0, 255) 0px -3px 10px 0px" 313 // Shadow cssText looks like "rgb(0, 0, 255) 0px -3px 10px 0px" and can be fractional.
314 var shadowPositionRegExp = /\)\s*(-?\d+)px\s*(-?\d+)px/; 314 var shadowPositionRegExp = /\)\s*(-?[\d.]+)px\s*(-?[\d.]+) px/;
315 var match = shadowPositionRegExp.exec(text); 315 var match = shadowPositionRegExp.exec(text);
316 var shadowXY = [parseInt(match[1]), parseInt(match[2])]; 316 var shadowXY = [parseInt(match[1]), parseInt(match[2])];
317 values.push(shadowXY[0]); 317 values.push(shadowXY[0]);
318 values.push(shadowXY[1]); 318 values.push(shadowXY[1]);
319 } else 319 } else
320 values.push(computedStyle[i].cssText); 320 values.push(computedStyle[i].cssText);
321 break; 321 break;
322 } 322 }
323 } 323 }
324 computedValue = values.join(','); 324 computedValue = values.join(',');
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 628
629 [1] If the CSS property name is "-webkit-transform", expected value must be an array of 1 or more numbers corresponding to the matrix elements, 629 [1] If the CSS property name is "-webkit-transform", expected value must be an array of 1 or more numbers corresponding to the matrix elements,
630 or a string which will be compared directly (useful if the expected value is "none") 630 or a string which will be compared directly (useful if the expected value is "none")
631 If the CSS property name is "-webkit-transform.N", expected value must be a number corresponding to the Nth element of the matrix 631 If the CSS property name is "-webkit-transform.N", expected value must be a number corresponding to the Nth element of the matrix
632 632
633 */ 633 */
634 function runTransitionTest(expected, trigger, callbacks, doPixelTest, disablePau seAnimationAPI) { 634 function runTransitionTest(expected, trigger, callbacks, doPixelTest, disablePau seAnimationAPI) {
635 isTransitionsTest = true; 635 isTransitionsTest = true;
636 runAnimationTest(expected, callbacks, trigger, disablePauseAnimationAPI, doP ixelTest); 636 runAnimationTest(expected, callbacks, trigger, disablePauseAnimationAPI, doP ixelTest);
637 } 637 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698