]> source.dussan.org Git - jquery.git/commitdiff
CSS: fix for disconnected elems on doc fragments in Opera 12
authorTimmy Willison <timmywillisn@gmail.com>
Mon, 22 Feb 2016 16:24:52 +0000 (11:24 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Mon, 22 Feb 2016 16:24:52 +0000 (11:24 -0500)
src/css/curCSS.js

index 8a01e2f740dd9be4a9ba57213a048e69bfd40714..40ea3971765b139bb116d394cd659ce56683210c 100644 (file)
@@ -35,11 +35,14 @@ if ( window.getComputedStyle ) {
                // getPropertyValue is only needed for .css('filter') in IE9, see #12537
                ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
 
-               if ( computed ) {
+               // Support: Opera 12.1x only
+               // Fall back to style even without computed
+               // computed is undefined for elems on document fragments
+               if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
+                       ret = jQuery.style( elem, name );
+               }
 
-                       if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
-                               ret = jQuery.style( elem, name );
-                       }
+               if ( computed ) {
 
                        // A tribute to the "awesome hack by Dean Edwards"
                        // Chrome < 17 and Safari 5.0 uses "computed value"