Style edits for pull request 375
This commit is contained in:
parent
cbbd7d28e1
commit
a5b7c0fa33
2 changed files with 20 additions and 20 deletions
|
@ -97,7 +97,7 @@ jQuery.extend({
|
||||||
if ( type === "string" && rrelNum.test( value ) ) {
|
if ( type === "string" && rrelNum.test( value ) ) {
|
||||||
value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
|
value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
|
||||||
// Fixes bug #9237
|
// Fixes bug #9237
|
||||||
type = 'number';
|
type = "number";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a number was passed in, add 'px' to the (except for certain CSS properties)
|
// If a number was passed in, add 'px' to the (except for certain CSS properties)
|
||||||
|
|
|
@ -112,10 +112,10 @@ test("css() explicit and relative values", function() {
|
||||||
expect(27);
|
expect(27);
|
||||||
var $elem = jQuery("#nothiddendiv");
|
var $elem = jQuery("#nothiddendiv");
|
||||||
|
|
||||||
$elem.css({ width: 1, height: 1, paddingLeft: '1px', opacity: 1 });
|
$elem.css({ width: 1, height: 1, paddingLeft: "1px", opacity: 1 });
|
||||||
equals( $elem.width(), 1, "Initial css set or width/height works (hash)" );
|
equals( $elem.width(), 1, "Initial css set or width/height works (hash)" );
|
||||||
equals( $elem.css("paddingLeft"), '1px', "Initial css set of paddingLeft works (hash)" );
|
equals( $elem.css("paddingLeft"), "1px", "Initial css set of paddingLeft works (hash)" );
|
||||||
equals( $elem.css("opacity"), '1', "Initial css set of opacity works (hash)" );
|
equals( $elem.css("opacity"), "1", "Initial css set of opacity works (hash)" );
|
||||||
|
|
||||||
$elem.css({ width: "+=9" });
|
$elem.css({ width: "+=9" });
|
||||||
equals( $elem.width(), 10, "'+=9' on width (hash)" );
|
equals( $elem.width(), 10, "'+=9' on width (hash)" );
|
||||||
|
@ -142,52 +142,52 @@ test("css() explicit and relative values", function() {
|
||||||
equals( $elem.width(), 1, "'-=9px' on width (params)" );
|
equals( $elem.width(), 1, "'-=9px' on width (params)" );
|
||||||
|
|
||||||
$elem.css({ paddingLeft: "+=4" });
|
$elem.css({ paddingLeft: "+=4" });
|
||||||
equals( $elem.css("paddingLeft"), '5px', "'+=4' on paddingLeft (hash)" );
|
equals( $elem.css("paddingLeft"), "5px", "'+=4' on paddingLeft (hash)" );
|
||||||
|
|
||||||
$elem.css({ paddingLeft: "-=4" });
|
$elem.css({ paddingLeft: "-=4" });
|
||||||
equals( $elem.css("paddingLeft"), '1px', "'-=4' on paddingLeft (hash)" );
|
equals( $elem.css("paddingLeft"), "1px", "'-=4' on paddingLeft (hash)" );
|
||||||
|
|
||||||
$elem.css({ paddingLeft: "+=4px" });
|
$elem.css({ paddingLeft: "+=4px" });
|
||||||
equals( $elem.css("paddingLeft"), '5px', "'+=4px' on paddingLeft (hash)" );
|
equals( $elem.css("paddingLeft"), "5px", "'+=4px' on paddingLeft (hash)" );
|
||||||
|
|
||||||
$elem.css({ paddingLeft: "-=4px" });
|
$elem.css({ paddingLeft: "-=4px" });
|
||||||
equals( $elem.css("paddingLeft"), '1px', "'-=4px' on paddingLeft (hash)" );
|
equals( $elem.css("paddingLeft"), "1px", "'-=4px' on paddingLeft (hash)" );
|
||||||
|
|
||||||
$elem.css({ "padding-left": "+=4" });
|
$elem.css({ "padding-left": "+=4" });
|
||||||
equals( $elem.css("paddingLeft"), '5px', "'+=4' on padding-left (hash)" );
|
equals( $elem.css("paddingLeft"), "5px", "'+=4' on padding-left (hash)" );
|
||||||
|
|
||||||
$elem.css({ "padding-left": "-=4" });
|
$elem.css({ "padding-left": "-=4" });
|
||||||
equals( $elem.css("paddingLeft"), '1px', "'-=4' on padding-left (hash)" );
|
equals( $elem.css("paddingLeft"), "1px", "'-=4' on padding-left (hash)" );
|
||||||
|
|
||||||
$elem.css({ "padding-left": "+=4px" });
|
$elem.css({ "padding-left": "+=4px" });
|
||||||
equals( $elem.css("paddingLeft"), '5px', "'+=4px' on padding-left (hash)" );
|
equals( $elem.css("paddingLeft"), "5px", "'+=4px' on padding-left (hash)" );
|
||||||
|
|
||||||
$elem.css({ "padding-left": "-=4px" });
|
$elem.css({ "padding-left": "-=4px" });
|
||||||
equals( $elem.css("paddingLeft"), '1px', "'-=4px' on padding-left (hash)" );
|
equals( $elem.css("paddingLeft"), "1px", "'-=4px' on padding-left (hash)" );
|
||||||
|
|
||||||
$elem.css( "paddingLeft", "+=4" );
|
$elem.css( "paddingLeft", "+=4" );
|
||||||
equals( $elem.css("paddingLeft"), '5px', "'+=4' on paddingLeft (params)" );
|
equals( $elem.css("paddingLeft"), "5px", "'+=4' on paddingLeft (params)" );
|
||||||
|
|
||||||
$elem.css( "paddingLeft", "-=4" );
|
$elem.css( "paddingLeft", "-=4" );
|
||||||
equals( $elem.css("paddingLeft"), '1px', "'-=4' on paddingLeft (params)" );
|
equals( $elem.css("paddingLeft"), "1px", "'-=4' on paddingLeft (params)" );
|
||||||
|
|
||||||
$elem.css( "padding-left", "+=4px" );
|
$elem.css( "padding-left", "+=4px" );
|
||||||
equals( $elem.css("paddingLeft"), '5px', "'+=4px' on padding-left (params)" );
|
equals( $elem.css("paddingLeft"), "5px", "'+=4px' on padding-left (params)" );
|
||||||
|
|
||||||
$elem.css( "padding-left", "-=4px" );
|
$elem.css( "padding-left", "-=4px" );
|
||||||
equals( $elem.css("paddingLeft"), '1px', "'-=4px' on padding-left (params)" );
|
equals( $elem.css("paddingLeft"), "1px", "'-=4px' on padding-left (params)" );
|
||||||
|
|
||||||
$elem.css({ opacity: "-=0.5" });
|
$elem.css({ opacity: "-=0.5" });
|
||||||
equals( $elem.css("opacity"), '0.5', "'-=0.5' on opacity (hash)" );
|
equals( $elem.css("opacity"), "0.5", "'-=0.5' on opacity (hash)" );
|
||||||
|
|
||||||
$elem.css({ opacity: "+=0.5" });
|
$elem.css({ opacity: "+=0.5" });
|
||||||
equals( $elem.css("opacity"), '1', "'+=0.5' on opacity (hash)" );
|
equals( $elem.css("opacity"), "1", "'+=0.5' on opacity (hash)" );
|
||||||
|
|
||||||
$elem.css( "opacity", "-=0.5" );
|
$elem.css( "opacity", "-=0.5" );
|
||||||
equals( $elem.css("opacity"), '0.5', "'-=0.5' on opacity (params)" );
|
equals( $elem.css("opacity"), "0.5", "'-=0.5' on opacity (params)" );
|
||||||
|
|
||||||
$elem.css( "opacity", "+=0.5" );
|
$elem.css( "opacity", "+=0.5" );
|
||||||
equals( $elem.css("opacity"), '1', "'+=0.5' on opacity (params)" );
|
equals( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("css(String, Object)", function() {
|
test("css(String, Object)", function() {
|
||||||
|
|
Loading…
Reference in a new issue