var color;
do {
- color = $.curCSS( elem, attr );
+ color = $.css( elem, attr );
// Keep going until we find an element that has color, or we hit the body
if ( color !== '' && color !== 'transparent' || $.nodeName( elem, 'body' ) ) {
'outlineColor'
], function ( i, attr ) {
$.fx.step[attr] = function ( fx ) {
- if ( fx.state === 0 ) {
+ if ( !fx.colorInit ) {
fx.start = getColor( fx.elem, attr );
fx.end = $.colorUtil.getRGB( fx.end );
+ fx.colorInit = true;
}
fx.elem.style[attr] = 'rgb(' + [
'tests/qunit/suites/resources/jquery/jquery.byteLength.test.js',
'tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js',
'tests/qunit/suites/resources/jquery/jquery.client.test.js',
+ 'tests/qunit/suites/resources/jquery/jquery.color.test.js',
'tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js',
'tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js',
'tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js',
'jquery.byteLength',
'jquery.byteLimit',
'jquery.client',
+ 'jquery.color',
'jquery.colorUtil',
'jquery.delayedBind',
'jquery.getAttrs',
--- /dev/null
+( function ( $ ) {
+ QUnit.module( 'jquery.color', QUnit.newMwEnvironment() );
+
+ QUnit.asyncTest( 'animate', 3, function ( assert ) {
+ var $canvas = $( '<div>' ).css( 'background-color', '#fff' );
+
+ $canvas.animate( { backgroundColor: '#000' }, 4 ).promise().then( function() {
+ var endColors = $.colorUtil.getRGB( $canvas.css( 'background-color' ) );
+ assert.strictEqual( endColors[0], 0 );
+ assert.strictEqual( endColors[1], 0 );
+ assert.strictEqual( endColors[2], 0 );
+ QUnit.start();
+ } );
+ } );
+}( jQuery ) );