added Shiv check so show/hide work with Modernizr#716
added Shiv check so show/hide work with Modernizr#716BigBlueHat wants to merge 1 commit intojquery:masterfrom
Conversation
|
I'm not sure what precedent of "playing nice" you speak of, but jQuery shouldn't be making biased concessions - if we start with this, then we have to accept every single request that follows. |
|
Too much code for this case. |
|
This issue (among others) reference html5shiv compatibility tweaks: I agree this may be "too much code" but not having it means that .show() must be avoided in shived code that uses jQuery and that .show() will have unexpected consequences. Is there a way I can patch this that's more acceptable? Just trying to help, here. :) |
No, instead of overriding the default display of a node, you should be using a class |
|
@mikecrittenden right. Good catch. :/ @rwldrn so the short answer is, "don't use .show() on HTML5 tags?" |
|
No, that's not what I said at all. This: /* my app hides them by default */
article {display:none}Is a broken approach and should be avoided in all cases |
|
@BigBlueHat, if you inspect the effects.js code carefully, you'll notice that jQuery tries to determine the correct "show" style style before .show(). It does this by first checking to see if it was originally shown, and therefore should have some .data stored for what the correct show value is. The solution, as @rwldrn says, is to remove the |
|
Actually, @BigBlueHat is right, this is a reduced test case in oldIE: http://jsfiddle.net/mLLL5/2/ |
|
It was always assumed that by using the html5shiv, that usercode would also include the nec. base stylesheet for html5 elements. Also, Mike, you're using the known broken html5shiv. Try this in IE8: http://jsfiddle.net/rwaldron/mLLL5/5/ |
|
Yeah, wasn't aware that jsfiddle was using the broken one. My bad. |

Patch for http://bugs.jquery.com/ticket/11520
.show() will now set article and other HTML5 tags to their "shived" value.
I realize this relates to an external/3rd-party library, but there seems to already be some precedence for "playing nice" along side Modernizr.
Not sure what the "policy" is for this sort of thing, but I'm happy to help come at this problem differently if a direct patch to jQuery is not the best route. Also, if the code formatting, variable names, or whatever are "off" just let me know. Happy to cleanup/fix/patch/whatever.
Thanks.