mirror of
https://github.com/jquery/jquery.git
synced 2026-02-15 18:45:05 -05:00
CSS: Avoid unit-conversion interference from CSS upper bounds
Fixes gh-2144 Closes gh-3745
This commit is contained in:
@@ -271,6 +271,22 @@ QUnit.test( "css() non-px relative values (gh-1711)", function( assert ) {
|
||||
add( "lineHeight", 50, "%" );
|
||||
} );
|
||||
|
||||
QUnit.test( "css() mismatched relative values with bounded styles (gh-2144)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var right,
|
||||
$container = jQuery( "<div/>" )
|
||||
.css( { position: "absolute", width: "400px", fontSize: "4px" } )
|
||||
.appendTo( "#qunit-fixture" ),
|
||||
$el = jQuery( "<div/>" )
|
||||
.css( { position: "absolute", left: "50%", right: "50%" } )
|
||||
.appendTo( $container );
|
||||
|
||||
$el.css( "right", "-=25em" );
|
||||
assert.equal( Math.round( parseFloat( $el.css( "right" ) ) ), 100,
|
||||
"Constraints do not interfere with unit conversion" );
|
||||
} );
|
||||
|
||||
QUnit.test( "css(String, Object)", function( assert ) {
|
||||
assert.expect( 19 );
|
||||
var j, div, display, ret, success;
|
||||
|
||||
3
test/unit/effects.js
vendored
3
test/unit/effects.js
vendored
@@ -1807,7 +1807,8 @@ QUnit.test( "animate does not change start value for non-px animation (#7109)",
|
||||
}
|
||||
} ).queue( function( next ) {
|
||||
var ratio = computed[ 0 ] / actual;
|
||||
assert.ok( ratio > 0.9 && ratio < 1.1, "Starting width was close enough" );
|
||||
assert.ok( ratio > 0.9 && ratio < 1.1,
|
||||
"Starting width was close enough (" + computed[ 0 ] + " approximates " + actual + ")" );
|
||||
next();
|
||||
parent.remove();
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user