> A while ago I reported a bug, which I couldn't really 
> narrow down, so it never went into a ticket:
> http://jquery.com/discuss/2006-August/010401/
> 
> The problem was that in line 1315:
> ret =
document.defaultView.getComputedStyle(this,null).getPropertyValue(prop);
> 
> document.defaultView.getComputedStyle(this,null) returns
> null causing an error in Safari obviously.
> 
> I fixed it with the following:
> 
> ret = document.defaultView.getComputedStyle(this,null) &&
document.defaultView.getComputedStyle(this,null).getPropertyValue(prop);
> 
> A few minutes ago I stumbled upon a post, which 
> exactly explains that bug:
> http://snook.ca/archives/javascript/safari2_display-none_getcomputedstyle/


I think the code has changed since August though. Notice that now it's in a
swap that sets display:block. So if it was invisible it should now be
visible and not return null. Unless visibility:hidden does it too, and in
that case the swap should add visibility:visible to the swap list. I can't
test on Safari so I've depended on the kindness of others in tracking down
these sort of bugs.

If the workaround is still needed I'd avoid two calls to getComputedStyle,
which may be expensive.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to