Changeset 5274
- Timestamp:
- 04/21/08 22:54:25 (8 months ago)
- Files:
-
- 1 modified
-
trunk/jquery/src/core.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/core.js
r5214 r5274 612 612 // exclude the following css properties to add px 613 613 var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; 614 // cache getComputedStyle 615 var getComputedStyle = document.defaultView && document.defaultView.getComputedStyle; 614 616 615 617 jQuery.extend({ … … 838 840 if ( !jQuery.browser.safari ) 839 841 return false; 840 841 var ret = document.defaultView.getComputedStyle( elem, null ); 842 843 // getComputedStyle is cached 844 var ret = getComputedStyle( elem, null ); 842 845 return !ret || ret.getPropertyValue("color") == ""; 843 846 } … … 865 868 ret = elem.style[ name ]; 866 869 867 else if ( document.defaultView && document.defaultView.getComputedStyle ) {870 else if ( getComputedStyle ) { 868 871 869 872 // Only "float" is needed here … … 873 876 name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); 874 877 875 var getComputedStyle = document.defaultView.getComputedStyle( elem, null );876 877 if ( getComputedStyle && !color( elem ) )878 ret = getComputedStyle.getPropertyValue( name );878 var computedStyle = getComputedStyle( elem, null ); 879 880 if ( computedStyle && !color( elem ) ) 881 ret = computedStyle.getPropertyValue( name ); 879 882 880 883 // If the element isn't reporting its values properly in Safari … … 899 902 ret = name == "display" && swap[ stack.length - 1 ] != null ? 900 903 "none" : 901 ( getComputedStyle && getComputedStyle.getPropertyValue( name ) ) || "";904 ( computedStyle && computedStyle.getPropertyValue( name ) ) || ""; 902 905 903 906 // Finally, revert the display styles back
