Skip to content

Commit f1d1d39

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

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/css/curCSS.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ function curCSS( elem, name, computed ) {
1212
style = elem.style;
1313

1414
computed = computed || getStyles( elem );
15+
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
16+
17+
// Support: Opera 12.1x only
18+
// Fall back to style even without computed
19+
// computed is undefined for elems on document fragments
20+
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
21+
ret = jQuery.style( elem, name );
22+
}
1523

1624
// Support: IE9
1725
// getPropertyValue is only needed for .css('filter') (#12537)
1826
if ( computed ) {
19-
ret = computed.getPropertyValue( name ) || computed[ name ];
20-
21-
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
22-
ret = jQuery.style( elem, name );
23-
}
2427

2528
// A tribute to the "awesome hack by Dean Edwards"
2629
// Android Browser returns percentage for some values,

0 commit comments

Comments
 (0)