Skip to content

Commit

Permalink
CSS: Remove use of getDefaultComputedStyle
Browse files Browse the repository at this point in the history
Remove optimization to make jQuery compatible with Google's Polymer project

Closes gh-1647
Fixes #15227
  • Loading branch information
nazar-pc authored and markelog committed Sep 2, 2014
1 parent 075da30 commit 274feb5
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/css/defaultDisplay.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,19 +13,9 @@ var iframe,
*/ */
// Called only from within defaultDisplay // Called only from within defaultDisplay
function actualDisplay( name, doc ) { function actualDisplay( name, doc ) {
var style, var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),


// getDefaultComputedStyle might be reliably used only on attached element display = jQuery.css( elem[ 0 ], "display" );
display = window.getDefaultComputedStyle &&
( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?

// Use of this method is a temporary fix (more like optimization)
// until something better comes along,
// since it was removed from specification and supported only in FF
style.display :

jQuery.css( elem[ 0 ], "display" );


// We don't have any data stored on the element, // We don't have any data stored on the element,
// so use "detach" method as fast way to get rid of the element // so use "detach" method as fast way to get rid of the element
Expand Down

0 comments on commit 274feb5

Please sign in to comment.