Skip to main content

Bug Tracker

Side navigation

#11520 closed enhancement (wontfix)

Opened March 26, 2012 03:43PM UTC

Closed March 26, 2012 09:50PM UTC

Last modified March 26, 2012 10:24PM UTC

show/hide set 'display' to 'inline' in IE8--regardless of Shiv/Shim/Modernizr usage

Reported by: byoung@bigbluehat.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

Bug exists in IE <= 8. I've only tested in IE8 so far--of the affected browsers. I used the Microsoft provided IE8 testing VM (Windows 7) running inside VirtualBox on Mac OS 10.6.8.

When using jQuery 1.7.2 with Modernizr 2.5 (or other shim/shiv options), using show/hide on an 'article' (or other HTML5 tag) the 'display' CSS property is set to 'inline' rather than 'block'--which is the shived value.

This can be tested/demonstrated with this jsFiddle:

http://jsfiddle.net/dC2tT/4/

The "Show the Article" button will '.show()' the 'article' tag. In non-IE browsers (and IE > 8) the content will state that 'display' is set to 'block'. In IE <= 8, the output will state that it's set to 'inline'.

Modernizr/html5shiv/html5shim will sets some display defaults, but defaultDisplay (in effects.js) retrieves the 'display' value from what the browser reports when the element is inserted in the DOM--which is the non-shived value.

defaultDisplay will need to check if the page is "modernized" and if so, use the Modernizr/shiv/shim value instead.

Patch en route.

Attachments (0)
Change History (7)

Changed March 26, 2012 03:47PM UTC by byoung@bigbluehat.com comment:1

Pull request sent via Github:

https://github.com/jquery/jquery/pull/716

Changed March 26, 2012 09:16PM UTC by byoung@bigbluehat.com comment:2

Posting this follow-up here as someone closed the comments on the Github pull request:

Fair enough. However, changing that approach (using a class to default them to display:none) doesn't fix the issues with .show():

http://jsfiddle.net/BigBlueHat/mLLL5/

Maybe making defaultDisplay override-able in some way could let Modernizr (or similar) tweak what .show() does without having to hack this into jQuery directly.

Changed March 26, 2012 09:30PM UTC by mikesherov comment:3

Verified. here's a reduced test case: http://jsfiddle.net/mLLL5/2/

Still not sure if it's something we can fix easily.

Changed March 26, 2012 09:42PM UTC by rwaldron comment:4

Should I still be running this test in a specific browser? eg. IE8?

Changed March 26, 2012 09:50PM UTC by rwaldron comment:5

resolution: → wontfix
status: newclosed

Nevermind... Mike, you're using the known broken html5shiv. Try this in IE8:

http://jsfiddle.net/rwaldron/mLLL5/5/show/light

Changed March 26, 2012 09:53PM UTC by rwaldron comment:6

Changed March 26, 2012 10:24PM UTC by mikesherov comment:7

I'm an idiot.