diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2016-02-22 11:24:52 -0500 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2016-02-22 11:30:18 -0500 |
commit | f1d1d399ece1ef51d993143077a597bf11d3e2dd (patch) | |
tree | c58b7b5709029e5f5e84699ae248b8108d2042b3 | |
parent | b536cd561ff1276f7094968aed2f1aa7d70bb5ae (diff) | |
download | jquery-f1d1d399ece1ef51d993143077a597bf11d3e2dd.tar.gz jquery-f1d1d399ece1ef51d993143077a597bf11d3e2dd.zip |
CSS: fix for disconnected elems on doc fragments in Opera 12
-rw-r--r-- | src/css/curCSS.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/css/curCSS.js b/src/css/curCSS.js index be643ab54..084f8c7bd 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -12,15 +12,18 @@ function curCSS( elem, name, computed ) { style = elem.style; computed = computed || getStyles( elem ); + ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; + + // 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 ); + } // Support: IE9 // getPropertyValue is only needed for .css('filter') (#12537) if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } // A tribute to the "awesome hack by Dean Edwards" // Android Browser returns percentage for some values, |