Commit e502012c authored by Mike Sherov's avatar Mike Sherov Committed by timmywil

Landing pull request 553. Fallback to elem.style for disconnected nodes in...

Landing pull request 553. Fallback to elem.style for disconnected nodes in width/height retrieval. Fixes #8388.

More Details:
 - https://github.com/jquery/jquery/pull/553
 - http://bugs.jquery.com/ticket/10254
 - http://bugs.jquery.com/ticket/8388
parent e1a5d3eb
...@@ -290,6 +290,10 @@ if ( document.documentElement.currentStyle ) { ...@@ -290,6 +290,10 @@ if ( document.documentElement.currentStyle ) {
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ], rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
style = elem.style; style = elem.style;
if ( ret === null && style ) {
ret = style[ name ];
}
// From the awesome hack by Dean Edwards // From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
......
...@@ -502,6 +502,15 @@ test("widows & orphans #8936", function () { ...@@ -502,6 +502,15 @@ test("widows & orphans #8936", function () {
$p.remove(); $p.remove();
}); });
test("can't get css for disconnected in IE<9, see #10254 and #8388", function() {
expect( 2 );
var span = jQuery( "<span/>" ).css( "background-image", "url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif)" );
equal( span.css( "background-image" ), "url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif)", "can't get background-image in IE<9, see #10254" );
var div = jQuery( "<div/>" ).css( "top", 10 );
equal( div.css( "top" ), "10px", "can't get top in IE<9, see #8388" );
});
test("Do not append px to 'fill-opacity' #9548", 1, function() { test("Do not append px to 'fill-opacity' #9548", 1, function() {
var $div = jQuery("<div>").appendTo("#qunit-fixture"); var $div = jQuery("<div>").appendTo("#qunit-fixture");
......
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