On Wed, Jan 14, 2009 at 4:03 PM, Matt <m...@thekrusefamily.com> wrote:
>> If any of our jQuery.support >> tests had three possible solutions then we would certainly opt for >> that instead (but, as it turns out, all the things that we test for >> only fail in a single browser, yielding only one correct alternative >> solution). > > New browsers can pop into existence that you may wish to support > (Chrome?). If you think of it only as a binary condition, there is no > room for a new browser that implements it differently. Or, say IE 8.1 > has a bug with opacity and needs its own little tweak. Just having a > support check for "opacity" won't tell you which fix is needed, and > you'll be stuck. A new browser to be support would be enough to warrant a new version of jQuery, I think. Otherwise, in your IE 8.1 example, you'd still need a new release to take into account the opacity. > IMO, it is _more_ future-proof and just better logic. If it's a binary > decision right now, then it should be all the same from your point of > view. But if it becomes a non-binary situation, the existing logic > fails whereas the other method would not. In terms of logic, I think it definitely makes sense to test for standards support *first* and then fall back. This (rightly, I think) assumes that over time browsers will get *more* compliant. If there's ever a case where a third condition arises, it'd be relatively trivial to do: if supports_ standard standard else if supports_other_method other_method else other_method2 -- --- David Zhou da...@nodnod.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---