Jörn Zaefferer schrieb: > Klaus Hartl schrieb: >> Brian Miller schrieb: >> >>> Is this patch generalized enough to add to the core? Just a thought... >>> >> Brian, it's actually just a check if the object is not null before >> accessing it: >> >> As it is: >> ret = >> document.defaultView.getComputedStyle(this,null).getPropertyValue(prop); >> >> >> The patch (with Dave's proposal to avoid two calls): >> >> var computedStyle = document.defaultView.getComputedStyle(this, null); >> ret = computedStyle && computedStyle.getPropertyValue(prop); >> >> I think that one does no harm. ret may be null in certain cases in >> Safari but that's better than throwing a nullpointer, right? >> >> It could also return an empty string if that's more robust: >> ret = computedStyle && computedStyle.getPropertyValue(prop) || ''; >> > Could you file that as a bug report if you think it should be fixed in core?
I worked around that bug at Plazes, so I have an unpatched jQuery now. Nonetheless I have created a ticket because I think it makes sense to fix this: http://jquery.com/dev/bugs/bug/467/ You can decide on this. -- Klaus _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
