Skip to content

IE8 crash when using a body background image #501

Closed
necolas opened this Issue Feb 14, 2012 · 15 comments
@necolas
necolas commented Feb 14, 2012

I'm experiencing a hard crash running Modernizr 2.5.2 in IE8 (Windows XP) under these circumstances:

  1. Include styles before Modernizr (as recommended)
  2. Include a background image on the body
  3. Include Modernizr with a test like "generated content".

Reduced test case: http://jsbin.com/etoget

That test case includes a build of Modernizr containing just the generated content test as an example of the type of test that crashes IE8 - not all tests do; I think only those that involve style/dom injection.

Thanks

Edit: Potential fix (via similar jQuery resolved-bug - http://bugs.jquery.com/ticket/9823)

Fixed example: http://jsbin.com/etoget/2/

Fixed by adding background: none to the injected <style> block for the fake body

@mathiasbynens

Confirmed here. IE8 crashes upon loading the test case.

@kristerkari

Ran your test case in Win XP/IE8, and it crashed the browser

@anthonyringoet

Crashes IE8 on windows xp. Today I experienced hard crashes on IE7/Vista as well with Modernizr 2.5.2.
Didn't have time to setup an isolated test to find what's causing it though.

@necolas
necolas commented Feb 14, 2012

A fixed jQuery bug is related: http://bugs.jquery.com/ticket/9823

This Modernizr bug is also fixed by adding background: none to the injected <style> block for the fake body

IE8 test case with crude fix: http://jsbin.com/etoget/2/

@Gavrisimo

Hmm tested this on browserstack and everything is working on IE6,7 and 8. Not sure how relevant browserstack setup is for this bug?

@Integralist

Well I tested this on Windows XP/IE8 (IE6 is default browser but IE7 and IE8 installed via http://utilu.com/IECollection/ method) and the page/browser didn't crash for me.

@bjohn465

With an un-primed cache, the test case does not crash IE8 on Windows XP for me. When the cache is primed, however, it crashes every time.

@ryanseddon
Modernizr member

Can confirm this crashes IE8, interestingly setting background:0 also stops it crashing can someone try this http://jsbin.com/etoget/14/ and confirm it stops the crashing.

@necolas
necolas commented Feb 14, 2012

Ryan, that doesn't crash for me either...it seems to act like background-position: 0 50%. Anything to explicitly set a valid background on the temporary body works. Hopefully this can get patched soon :)

@paulirish
Modernizr member

nicolas thank you so much for kicking this off with a reduced testcase. :)

@aFarkas aFarkas added a commit that referenced this issue Feb 15, 2012
@aFarkas aFarkas fix issue #332 and issue #501 971dba3
@KuraFire
Modernizr member

Modernizr 2.5.3 has shipped which fixes this issue.

http://www.modernizr.com/download/

@KuraFire KuraFire closed this Feb 17, 2012
@brgrz
brgrz commented Apr 4, 2012

This is still happening to me with version 2.5.3 with respond 1.1.0 from Initializr package. The same cause: background on the body tag in linked CSS file.

@ryanseddon
Modernizr member

It's actually the matchMedia polyfill it includes in the build when you check respond. Modernizr has fixed that issue the one initializer includes has not.

Initializer is actually doubling up as the build of Modernizr they include already has a matchMedia polyfill via Modernizr.mq which also handles the background crashing issues for IE8.

cc @verekia

@pdjota
pdjota commented May 15, 2012

I had the same issue, I had to regenerate back to 2.0.6.

@verekia
verekia commented May 15, 2012

It should have been fixed 2 days ago. Can someone verify?

verekia/initializr#43

@phistuck phistuck added a commit that referenced this issue Aug 31, 2012
@phistuck phistuck fix issue #332 and issue #501 d08f703
@patrickkettner patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
@aFarkas aFarkas fix issue #332 and issue #501 23b9ff9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.