Skip to content

Commit e5d3cf9

Browse files
committed
CSS: fix for disconnected elems on doc fragments in Opera 12
1 parent ef2a06e commit e5d3cf9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/css/curCSS.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ if ( window.getComputedStyle ) {
3535
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
3636
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
3737

38-
if ( computed ) {
38+
// Support: Opera 12.1x only
39+
// Fall back to style even without computed
40+
// computed is undefined for elems on document fragments
41+
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
42+
ret = jQuery.style( elem, name );
43+
}
3944

40-
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
41-
ret = jQuery.style( elem, name );
42-
}
45+
if ( computed ) {
4346

4447
// A tribute to the "awesome hack by Dean Edwards"
4548
// Chrome < 17 and Safari 5.0 uses "computed value"

0 commit comments

Comments
 (0)