Kangax, you have convinced me about the goodness of feature testing. Now convince yourself about the goodness of:
// detect IE any version from IE to IE8 IE = typeof document.fileSize != 'undefined', I don't understand how conditional comments or "userAgent" parsing can be better than the above for IE. Look at bug #3169 as an example... In fact the above will have worked from IE4 and up to todays IE7 / IE8, while we have seen the "userAgent" parsing changing quite a lot of time in the course of the past years. You see with "userAgent" parsing/sniffing libraries must be updated (or at least checked/ tweaked) for each new version of the browser and that is a very bad practice. I repeat, this is useful when feature testing is requiring to much code, realize that the above test will cover more than 50% of your current CFT tests. Nearly all bugs are IE related, few are Opera or Konqueror as you already noticed. Kangax, I really like your CFT and believe it is the way to go, but I don't need to open an iframe each time I need to know if a method will work on IE, that's too much for my taste and probably for others too. Diego On 13 Gen, 07:07, kangax <kan...@gmail.com> wrote: > On Jan 12, 10:01 pm, Diego Perini <diego.per...@gmail.com> wrote: > > [...] > > > My suggestion is to start including these two constants in the process > > of removing the others, they will never go away: > > > IE = typeof document.fileSize != 'undefined', // IE6 / IE7 / IE8 > > S2 = top !== top.document.defaultView, // Safari 2 > > This object inference doesn't seem like a much better solution than > `userAgent` parsing. I can imagine 3rd party code having > `document.fileSize` and accidentally messing things up. It's also not > clear why anyone would want to "detect" IE in such way, when more > robust ways are known - i.e. IE's conditional comments. On the other > hand, if you were to introduce "IE" and "S2" - why skip "Opera" and/or > "Konqueror", etc.? > > > > > Please don't laugh...I know they are not feature testing. > > > But these never changed and will never change, IE7 / IE8 are still > > using that property (uniquely), S2 is still on 10.4.3 Mac, only two > > short lines, can be shortened if "document" is aliased to correct > > context, can execute before onload on both Webkit and all versions of > > IE. > > Exactly which version of Safari are you talking about? I know that > <=2.0.2 are missing `Object.prototype.hasOwnProperty`. Maybe we're > talking about the same version. > > [...] > > -- > kangax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---