Skip to content

Commit

Permalink
CSS: Add animation-iteration-count to cssNumber jquery#2792
Browse files Browse the repository at this point in the history
  • Loading branch information
ufologist committed Jan 4, 2016
1 parent 1823a71 commit 4a9b8ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/css.js
Expand Up @@ -190,6 +190,7 @@ jQuery.extend( {

// Don't automatically add "px" to these possibly-unitless properties
cssNumber: {
"animationIterationCount": true,
"columnCount": true,
"fillOpacity": true,
"flexGrow": true,
Expand Down
13 changes: 11 additions & 2 deletions test/unit/css.js
Expand Up @@ -840,8 +840,8 @@ if ( jQuery.fn.offset ) {
} );
}

QUnit.test( "Do not append px (#9548, #12990)", function( assert ) {
assert.expect( 2 );
QUnit.test( "Do not append px (#9548, #12990, #2792)", function( assert ) {
assert.expect( 3 );

var $div = jQuery( "<div>" ).appendTo( "#qunit-fixture" );

Expand All @@ -860,6 +860,15 @@ QUnit.test( "Do not append px (#9548, #12990)", function( assert ) {
} else {
assert.ok( true, "No support for column-count CSS property" );
}

$div.css( "animation-iteration-count", 2 );
if ( $div.css( "animation-iteration-count" ) ) {
// if $div.css( "animation-iteration-count" ) return "1",
// it actually return the default value of animation-iteration-count
assert.equal( $div.css( "animation-iteration-count" ), 2, "Do not append px to 'animation-iteration-count'" );
} else {
assert.ok( true, "No support for animation-iteration-count CSS property" );
}
} );

QUnit.test( "css('width') and css('height') should respect box-sizing, see #11004", function( assert ) {
Expand Down

0 comments on commit 4a9b8ce

Please sign in to comment.