Bug Tracker

Changeset 5609

Show
Ignore:
Timestamp:
05/15/08 14:45:29 (5 months ago)
Author:
aflesler
Message:

jquery core: SHOULD fix #2802. Caching document.defaultView, instead of defaultView.getComputedStyle as it fails on Safari 2.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/core.js

    r5603 r5609  
    597597 
    598598var expando = "jQuery" + now(), uuid = 0, windowData = {}, 
    599  
    600 // exclude the following css properties to add px 
     599    // exclude the following css properties to add px 
    601600    exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, 
    602 // cache getComputedStyle 
    603     getComputedStyle = document.defaultView && document.defaultView.getComputedStyle; 
     601    // cache defaultView 
     602    defaultView = document.defaultView || {}; 
    604603 
    605604jQuery.extend({ 
     
    831830                return false; 
    832831 
    833             // getComputedStyle is cached 
    834             var ret = getComputedStyle( elem, null ); 
     832            // defaultView is cached 
     833            var ret = defaultView.getComputedStyle( elem, null ); 
    835834            return !ret || ret.getPropertyValue("color") == ""; 
    836835        } 
     
    858857            ret = style[ name ]; 
    859858 
    860         else if ( getComputedStyle ) { 
     859        else if ( defaultView.getComputedStyle ) { 
    861860 
    862861            // Only "float" is needed here 
     
    866865            name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); 
    867866 
    868             var computedStyle = getComputedStyle( elem, null ); 
     867            var computedStyle = defaultView.getComputedStyle( elem, null ); 
    869868 
    870869            if ( computedStyle && !color( elem ) )