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

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

Issue 24077007: Add support for the object-position CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master again Created 7 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/fast/css/object-position.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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 property += "-source"; 360 property += "-source";
361 361
362 computedValue = window.getComputedStyle(document.getElementById(elementI d)).getPropertyCSSValue(property).cssText; 362 computedValue = window.getComputedStyle(document.getElementById(elementI d)).getPropertyCSSValue(property).cssText;
363 computedCrossFade = parseCrossFade(computedValue); 363 computedCrossFade = parseCrossFade(computedValue);
364 364
365 if (!computedCrossFade) { 365 if (!computedCrossFade) {
366 pass = false; 366 pass = false;
367 } else { 367 } else {
368 pass = isCloseEnough(computedCrossFade.percent, expectedValue, toler ance); 368 pass = isCloseEnough(computedCrossFade.percent, expectedValue, toler ance);
369 } 369 }
370 } else if (property == "object-position") {
371 computedValue = window.getComputedStyle(document.getElementById(elementI d)).objectPosition;
372 var actualArray = computedValue.split(" ");
373 var expectedArray = expectedValue.split(" ");
374 if (actualArray.length != expectedArray.length) {
375 pass = false;
376 } else {
377 for (i = 0; i < expectedArray.length; ++i) {
378 pass = isCloseEnough(parseFloat(actualArray[i]), parseFloat(expe ctedArray[i]), tolerance);
379 if (!pass)
380 break;
381 }
382 }
370 } else { 383 } else {
371 var computedStyle = window.getComputedStyle(document.getElementById(elem entId)).getPropertyCSSValue(property); 384 var computedStyle = window.getComputedStyle(document.getElementById(elem entId)).getPropertyCSSValue(property);
372 if (computedStyle.cssValueType == CSSValue.CSS_VALUE_LIST) { 385 if (computedStyle.cssValueType == CSSValue.CSS_VALUE_LIST) {
373 var values = []; 386 var values = [];
374 for (var i = 0; i < computedStyle.length; ++i) { 387 for (var i = 0; i < computedStyle.length; ++i) {
375 switch (computedStyle[i].cssValueType) { 388 switch (computedStyle[i].cssValueType) {
376 case CSSValue.CSS_PRIMITIVE_VALUE: 389 case CSSValue.CSS_PRIMITIVE_VALUE:
377 values.push(computedStyle[i].getFloatValue(CSSPrimitiveValue .CSS_NUMBER)); 390 values.push(computedStyle[i].getFloatValue(CSSPrimitiveValue .CSS_NUMBER));
378 break; 391 break;
379 case CSSValue.CSS_CUSTOM: 392 case CSSValue.CSS_CUSTOM:
(...skipping 309 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, 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,
690 or a string which will be compared directly (useful if the expected value is "none") 703 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 704 If the CSS property name is "-webkit-transform.N", expected value must be a number corresponding to the Nth element of the matrix
692 705
693 */ 706 */
694 function runTransitionTest(expected, trigger, callbacks, doPixelTest) { 707 function runTransitionTest(expected, trigger, callbacks, doPixelTest) {
695 expected = expected.map(function(expectation) { expectation.unshift(null); r eturn expectation; }); 708 expected = expected.map(function(expectation) { expectation.unshift(null); r eturn expectation; });
696 isTransitionsTest = true; 709 isTransitionsTest = true;
697 runAnimationTest(expected, callbacks, trigger, false, doPixelTest); 710 runAnimationTest(expected, callbacks, trigger, false, doPixelTest);
698 } 711 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/object-position.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698