Commit 22ccbf82 authored by Scott González's avatar Scott González

Fixed getting styles from disconnected nodes. Fixes #7148.

parent 2866f16c
......@@ -230,6 +230,9 @@ if ( getComputedStyle ) {
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
ret = computedStyle.getPropertyValue( name );
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
ret = jQuery.style( elem, name );
}
}
return ret;
......
module("css");
test("css(String|Hash)", function() {
expect(33);
expect(34);
equals( jQuery('#main').css("display"), 'block', 'Check for css property "display"');
......@@ -19,6 +19,8 @@ test("css(String|Hash)", function() {
equals( parseFloat(jQuery('#nothiddendiv').css('width')), width, 'Test negative width ignored')
equals( parseFloat(jQuery('#nothiddendiv').css('height')), height, 'Test negative height ignored')
equals( jQuery('<div style="display: none;">').css('display'), 'none', 'Styles on disconnected nodes');
jQuery('#floatTest').css({'float': 'right'});
equals( jQuery('#floatTest').css('float'), 'right', 'Modified CSS float using "float": Assert float is right');
jQuery('#floatTest').css({'font-size': '30px'});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment