 Chromium Code Reviews
 Chromium Code Reviews Issue 23241010:
  Support subpixel values for text-shadow and box-shadow  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk
    
  
    Issue 23241010:
  Support subpixel values for text-shadow and box-shadow  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk| OLD | NEW | 
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } | 
| OLD | NEW |