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

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: found one more spot Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/sub-pixel/shadows.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 var values = []; 373 var values = [];
374 for (var i = 0; i < computedStyle.length; ++i) { 374 for (var i = 0; i < computedStyle.length; ++i) {
375 switch (computedStyle[i].cssValueType) { 375 switch (computedStyle[i].cssValueType) {
376 case CSSValue.CSS_PRIMITIVE_VALUE: 376 case CSSValue.CSS_PRIMITIVE_VALUE:
377 values.push(computedStyle[i].getFloatValue(CSSPrimitiveValue .CSS_NUMBER)); 377 values.push(computedStyle[i].getFloatValue(CSSPrimitiveValue .CSS_NUMBER));
378 break; 378 break;
379 case CSSValue.CSS_CUSTOM: 379 case CSSValue.CSS_CUSTOM:
380 // arbitrarily pick shadow-x and shadow-y 380 // arbitrarily pick shadow-x and shadow-y
381 if (property == 'box-shadow' || property == 'text-shadow') { 381 if (property == 'box-shadow' || property == 'text-shadow') {
382 var text = computedStyle[i].cssText; 382 var text = computedStyle[i].cssText;
383 // Shadow cssText looks like "rgb(0, 0, 255) 0px -3px 10px 0px" 383 // Shadow cssText looks like "rgb(0, 0, 255) 0px -3px 10px 0px"
mithro-old 2013/10/24 00:45:41 Comment needs to be updated with the change to the
cbiesinger 2013/10/26 01:26:06 I guess... will do.
384 var shadowPositionRegExp = /\)\s*(-?\d+)px\s*(-?\d+)px/; 384 var shadowPositionRegExp = /\)\s*(-?[\d.]+)px\s*(-?[\d.]+) px/;
385 var match = shadowPositionRegExp.exec(text); 385 var match = shadowPositionRegExp.exec(text);
386 var shadowXY = [parseInt(match[1]), parseInt(match[2])]; 386 var shadowXY = [parseInt(match[1]), parseInt(match[2])];
387 values.push(shadowXY[0]); 387 values.push(shadowXY[0]);
388 values.push(shadowXY[1]); 388 values.push(shadowXY[1]);
389 } else 389 } else
390 values.push(computedStyle[i].cssText); 390 values.push(computedStyle[i].cssText);
391 break; 391 break;
392 } 392 }
393 } 393 }
394 computedValue = values.join(','); 394 computedValue = values.join(',');
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 [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, 689 [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,
690 or a string which will be compared directly (useful if the expected value is "none") 690 or a string which will be compared directly (useful if the expected value is "none")
691 If the CSS property name is "-webkit-transform.N", expected value must be a number corresponding to the Nth element of the matrix 691 If the CSS property name is "-webkit-transform.N", expected value must be a number corresponding to the Nth element of the matrix
692 692
693 */ 693 */
694 function runTransitionTest(expected, trigger, callbacks, doPixelTest) { 694 function runTransitionTest(expected, trigger, callbacks, doPixelTest) {
695 expected = expected.map(function(expectation) { expectation.unshift(null); r eturn expectation; }); 695 expected = expected.map(function(expectation) { expectation.unshift(null); r eturn expectation; });
696 isTransitionsTest = true; 696 isTransitionsTest = true;
697 runAnimationTest(expected, callbacks, trigger, false, doPixelTest); 697 runAnimationTest(expected, callbacks, trigger, false, doPixelTest);
698 } 698 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/sub-pixel/shadows.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698