mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Made sure that css() in IE handles negative non-px values correctly. Fixes #3331.
This commit is contained in:
parent
6071e939c7
commit
aae0617c83
@ -5,8 +5,8 @@ var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
|
|||||||
rfloat = /float/i,
|
rfloat = /float/i,
|
||||||
rdashAlpha = /-([a-z])/ig,
|
rdashAlpha = /-([a-z])/ig,
|
||||||
rupper = /([A-Z])/g,
|
rupper = /([A-Z])/g,
|
||||||
rnumpx = /^\d+(?:px)?$/i,
|
rnumpx = /^-?\d+(?:px)?$/i,
|
||||||
rnum = /^\d/,
|
rnum = /^-?\d/,
|
||||||
|
|
||||||
// cache check for defaultView.getComputedStyle
|
// cache check for defaultView.getComputedStyle
|
||||||
getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
|
getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
|
||||||
|
@ -59,13 +59,16 @@ test("css(String|Hash)", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("css(String, Object)", function() {
|
test("css(String, Object)", function() {
|
||||||
expect(20);
|
expect(21);
|
||||||
ok( jQuery('#nothiddendiv').is(':visible'), 'Modifying CSS display: Assert element is visible');
|
ok( jQuery('#nothiddendiv').is(':visible'), 'Modifying CSS display: Assert element is visible');
|
||||||
jQuery('#nothiddendiv').css("display", 'none');
|
jQuery('#nothiddendiv').css("display", 'none');
|
||||||
ok( !jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is hidden');
|
ok( !jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is hidden');
|
||||||
jQuery('#nothiddendiv').css("display", 'block');
|
jQuery('#nothiddendiv').css("display", 'block');
|
||||||
ok( jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is visible');
|
ok( jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is visible');
|
||||||
|
|
||||||
|
jQuery("#nothiddendiv").css("top", "-1em");
|
||||||
|
ok( jQuery("#nothiddendiv").css("top"), -16, "Check negative number in EMs." );
|
||||||
|
|
||||||
jQuery('#floatTest').css('styleFloat', 'left');
|
jQuery('#floatTest').css('styleFloat', 'left');
|
||||||
equals( jQuery('#floatTest').css('styleFloat'), 'left', 'Modified CSS float using "styleFloat": Assert float is left');
|
equals( jQuery('#floatTest').css('styleFloat'), 'left', 'Modified CSS float using "styleFloat": Assert float is left');
|
||||||
jQuery('#floatTest').css('cssFloat', 'right');
|
jQuery('#floatTest').css('cssFloat', 'right');
|
||||||
|
Loading…
Reference in New Issue
Block a user