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

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

Issue 38573003: Use 4 value syntax for getComputedStyle of background-position and -webkit-mask-position (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 1 month 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 break; 368 break;
369 } 369 }
370 } 370 }
371 } else { 371 } else {
372 var computedStyle = window.getComputedStyle(document.getElementById(elem entId)).getPropertyCSSValue(property); 372 var computedStyle = window.getComputedStyle(document.getElementById(elem entId)).getPropertyCSSValue(property);
373 if (computedStyle.cssValueType == CSSValue.CSS_VALUE_LIST) { 373 if (computedStyle.cssValueType == CSSValue.CSS_VALUE_LIST) {
374 var values = []; 374 var values = [];
375 for (var i = 0; i < computedStyle.length; ++i) { 375 for (var i = 0; i < computedStyle.length; ++i) {
376 switch (computedStyle[i].cssValueType) { 376 switch (computedStyle[i].cssValueType) {
377 case CSSValue.CSS_PRIMITIVE_VALUE: 377 case CSSValue.CSS_PRIMITIVE_VALUE:
378 if (computedStyle[i].primitiveType == CSSPrimitiveValue.CSS_ STRING) 378 if (computedStyle[i].primitiveType === CSSPrimitiveValue.CSS _STRING)
379 values.push(computedStyle[i].getStringValue()); 379 values.push(computedStyle[i].getStringValue());
380 else if (computedStyle[i].primitiveType === CSSPrimitiveValu e.CSS_IDENT)
381 values.push(computedStyle[i].cssText);
380 else 382 else
381 values.push(computedStyle[i].getFloatValue(CSSPrimitiveV alue.CSS_NUMBER)); 383 values.push(computedStyle[i].getFloatValue(CSSPrimitiveV alue.CSS_NUMBER));
382 break; 384 break;
383 case CSSValue.CSS_CUSTOM: 385 case CSSValue.CSS_CUSTOM:
384 // arbitrarily pick shadow-x and shadow-y 386 // arbitrarily pick shadow-x and shadow-y
385 if (property == 'box-shadow' || property == 'text-shadow') { 387 if (property == 'box-shadow' || property == 'text-shadow') {
386 var text = computedStyle[i].cssText; 388 var text = computedStyle[i].cssText;
387 // Shadow cssText looks like "rgb(0, 0, 255) 0px -3px 10px 0px" 389 // Shadow cssText looks like "rgb(0, 0, 255) 0px -3px 10px 0px"
388 var shadowPositionRegExp = /\)\s*(-?\d+)px\s*(-?\d+)px/; 390 var shadowPositionRegExp = /\)\s*(-?\d+)px\s*(-?\d+)px/;
389 var match = shadowPositionRegExp.exec(text); 391 var match = shadowPositionRegExp.exec(text);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 703
702 [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, 704 [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,
703 or a string which will be compared directly (useful if the expected value is "none") 705 or a string which will be compared directly (useful if the expected value is "none")
704 If the CSS property name is "-webkit-transform.N", expected value must be a number corresponding to the Nth element of the matrix 706 If the CSS property name is "-webkit-transform.N", expected value must be a number corresponding to the Nth element of the matrix
705 707
706 */ 708 */
707 function runTransitionTest(expected, trigger, callbacks, doPixelTest) { 709 function runTransitionTest(expected, trigger, callbacks, doPixelTest) {
708 isTransitionsTest = true; 710 isTransitionsTest = true;
709 runAnimationTest(expected, callbacks, trigger, false, doPixelTest); 711 runAnimationTest(expected, callbacks, trigger, false, doPixelTest);
710 } 712 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698