mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
CSS: Add animation-iteration-count to cssNumber, fix tests
Fixes gh-2792 Closes gh-2793
This commit is contained in:
parent
a4d16a26ab
commit
df822caff0
@ -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,
|
||||
|
@ -840,26 +840,35 @@ 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" );
|
||||
|
||||
$div.css( "fill-opacity", 1 );
|
||||
|
||||
// Support: Android 2.3 (no support for fill-opacity)
|
||||
if ( $div.css( "fill-opacity" ) ) {
|
||||
if ( $div.css( "fill-opacity" ) !== undefined ) {
|
||||
assert.equal( $div.css( "fill-opacity" ), 1, "Do not append px to 'fill-opacity'" );
|
||||
} else {
|
||||
assert.ok( true, "No support for fill-opacity CSS property" );
|
||||
}
|
||||
|
||||
$div.css( "column-count", 1 );
|
||||
if ( $div.css( "column-count" ) ) {
|
||||
if ( $div.css( "column-count" ) !== undefined ) {
|
||||
assert.equal( $div.css( "column-count" ), 1, "Do not append px to 'column-count'" );
|
||||
} else {
|
||||
assert.ok( true, "No support for column-count CSS property" );
|
||||
}
|
||||
|
||||
$div.css( "animation-iteration-count", 2 );
|
||||
if ( $div.css( "animation-iteration-count" ) !== undefined ) {
|
||||
// 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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user