Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9028 closed bug (fixed)

IE8 crashes while loading 1.6rc1 if using body background image

Reported by: JorisDebonnet Owned by:
Priority: blocker Milestone: 1.6
Component: support Version: 1.6rc1
Keywords: Cc: jaubourg
Blocked by: Blocking:

Description

Hi,

I noticed my application crashing in IE8 after starting to use 1.6rc1. I reduced the code as far as I could, and the only significant things that remain are doctype tag, one css rule (setting a png file as background), and the script tag that loads jQuery 1.6rc1. If I remove any of those three, it no longer crashes.

I realise this is quite vague, but I hope my jsFiddle will help. I had to upload my image to postimage.org first, apparently it needs the png to work (i.e. crash).

http://jsfiddle.net/fdACd/

Change History (28)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledsupport
Version 0, edited 12 years ago by Rick Waldron (next)

comment:2 Changed 12 years ago by JorisDebonnet

Well, that doesn't crash IE8 -- it seems to be important that jQuery is loaded after the css rule is created.

Here's a version that is better reduced (the way you did), but still loads jQuery 'late enough' (I don't manage to achieve this effect using the onLoad dropdown):

http://jsfiddle.net/fdACd/2/

comment:3 Changed 12 years ago by Rick Waldron

Thanks for the clarification there.

comment:4 Changed 12 years ago by Timmy Willison

Component: supportcore
Milestone: 1.next1.6
Priority: undecidedblocker
Status: newopen

Confirmed. Not sure this is a jQuery problem, but we should probably look into it before 1.6 final.

comment:5 Changed 12 years ago by JorisDebonnet

For what it's worth, it also occurs when setting any other type of image as background, even when I use a data URI instead of an actual external image file, such as in this example.

http://jsfiddle.net/fdACd/6/

Also, the background does not need to be set on the body. It also happens if the background is set on 'div', even if there is no div present. But it does not happen if a class or id is given ...

I'll try to summarize that a bit.

It happens:

  • If jQuery 1.6rc1 is loaded after the css rule
  • If the css rule applies to a definition with only elements, also if they are combined using >. Examples: 'body'; 'div'; 'body, div'; 'body > div'; ...)

It does not happen:

  • If the background-image resolves to '404' or to a non-image file
  • If the css rule includes a class, id, attribute, pseudoclass,... (such as div.a, div#a, div[style], a:link).
  • If the css rule is for 'body ~ div' or 'body + div'

comment:6 Changed 12 years ago by Timmy Willison

Cc: jaubourg added
Component: coresupport

After some testing, I've discovered the crash occurs when removing the mock body we add in support.js. Setting background to none on that body and anything attached to the body fixes this issue, but there is probably a better way to fix it.

comment:7 in reply to:  6 Changed 12 years ago by jaubourg

Replying to timmywil:

After some testing, I've discovered the crash occurs when removing the mock body we add in support.js. Setting background to none on that body and anything attached to the body fixes this issue, but there is probably a better way to fix it.

If there is, what could it be? Setting the body as "display:none" before removing it? Why IE is crashing is what we should try and determine. Do we have anyone who knows the internals of IE that could answer this question?

Setting background to none is "ok" somehow but god is IE frustrating.

comment:8 Changed 12 years ago by Timmy Willison

Resolution: fixed
Status: openclosed

Set background to none on our mock body and remove its contents to avoid a crash in IE when removing it. Fixes #9028.

Changeset: f1392d82089323ec9ef97b33909b960cc16c25b6

comment:9 Changed 12 years ago by anonymous

after using 1.6.1 my background image in ie-8 disappeared!

comment:10 Changed 12 years ago by Timmy Willison

@anonymous: see #9239

comment:11 in reply to:  8 Changed 12 years ago by Josh <[email protected]…>

Replying to timmywil:

Set background to none on our mock body and remove its contents to avoid a crash in IE when removing it. Fixes #9028.

Changeset: f1392d82089323ec9ef97b33909b960cc16c25b6

Have you tried removing these changes in light of the fix made for bug #9239? Perhaps just not creating the duplicate body element will have fixed the IE crash without the need for the background:"none" hack.

comment:12 Changed 12 years ago by Timmy Willison

@Josh: already done

comment:13 Changed 12 years ago by Josh <[email protected]…>

@timmywil: Way ahead of me, thanks! Somehow I was not looking at the master branch before.

comment:14 Changed 12 years ago by [email protected]

encountered this bug in a different form. in specific versions of IE 7 and 8 a body with a background color simply disappears, along with the text inside.

see example in http://test.activeinsight.net/ieBackgroundExample.html

Amir.

comment:15 Changed 12 years ago by JorisDebonnet

I can confirm, as I get the same result on IE8 on Windows XP (within Virtual PC on Windows 7). This is IE 8.0.6001.18702 (compared to 8.0.760016385 as stated on the test page).

I don't get the problem on IE 6, IE 7 or IE 9.

comment:16 Changed 12 years ago by kingham

I am getting the same problem using jQuery 1.6.2 and IE 8.0.6001.18702.

The fix for this bug does fix the problem but has been taken out in the fix for #9239.

comment:17 Changed 12 years ago by JorisDebonnet

After my application's last update (when I started using jQuery 1.6.2), IE8 crashes when I refresh the page (one of three things happens: the tab crashes and is reopened, or it says "can't open that page, click here to try again", or IE8 completely crashes).

So yes ... a problem is definitely back since 1.6.2. And yes: the problem does not occur when I remove the body background.

Sadly I can't reproduce it in a jsFiddle :( In fact, I could eliminate the problem in my application by disabling most of my own javascript. So apparently it needs some kind of complexity before it crashes. Hard to figure out what exactly...

In any case, it doesn't happen with 1.6.1., and it doesn't happen if there's no body background. I'm assuming it's related with the previous posts, so I'm hoping there's enough clues to fix it again... :)

comment:18 Changed 12 years ago by anonymous

I noticed in 1.6.2 the Changeset: f1392d82089323ec9ef97b33909b960cc16c25b6 disappeared. If I add background:"none" to jquery-1.6.2.js. It no longer crashes IE 8.

comment:19 Changed 12 years ago by [email protected]

Grr this bug has been causing me massive pain in a production project - could someone please reopen this, as its fix has somehow been removed from 1.6.2

comment:20 Changed 12 years ago by [email protected]

Production project pain here also. We can only reproduce it in IE8 on Windows XP, with JQuery 1.6.2. Could not reproduce in IE6/XP, IE7/XP, IE9/Win7, or IE9/Win7 in any of its legacy modes.

As with the previous commenters, moving the CSS style to after the script tag prevents the crash, and it doesn't happen with JQ 1.6.1.

Steps to reproduce in IE8/XP:

  1. Go to http://www.msn.com/?ocid=iehp (IE default home page)
  2. In the same tab, go to this jsFiddle: http://fiddle.jshell.net/ZKPZq/6/show/

Main fiddle page is here: http://fiddle.jshell.net/ZKPZq/6/show/

The crash doesn't seem to occur as consistently if iframes and seperate tabs are involved, but visiting MSN first is a necessary step in any case. Crash still happens if you visit other sites after MSN and before the jsFiddle.

Blocking js on MSN.com prevents the crash also. So my best guess is that some script there is having a persistent effect on the browser window.

comment:21 Changed 12 years ago by Rick Waldron

You do realize that it's not possible that "visiting MSN first" would have anything to do with the background of another website, right?

comment:22 in reply to:  21 ; Changed 12 years ago by jaubourg

Replying to rwaldron:

You do realize that it's not possible that "visiting MSN first" would have anything to do with the background of another website, right?

Are we that sure with IE?

comment:23 in reply to:  22 Changed 12 years ago by [email protected]

Replying to jaubourg:

Replying to rwaldron:

You do realize that it's not possible that "visiting MSN first" would have anything to do with the background of another website, right?

Are we that sure with IE?

Exactly. Whether something makes sense isn't too relevant when it comes to IE bugs.

Believe me, I tested every other variable I could think of before concluding that the MSN site must be involved. It's not directly affecting the background image in any way I could find. I can only guess that it's having some side effect on IE's browser session that creates the conditions for the crash.

I ran those tests on XPMode in Win7's virtual PC, with a fresh install of IE8 and all critical updates installed.

This morning I tried on a few other machines. Win7+IE8 had no crashing. Vista+IE8 crashed consistently, without the MSN step, and could not recover the page.

comment:24 Changed 12 years ago by anonymous

This bug is incorrectly marked as closed, IE8 on XP still exhibits the crash bug when css containing a body background image is specified before calling jquery-1.6.2.min.js

Fixes for this:

  • commenting out /* background: ...; */
  • moving css containing body{ background: ...; } below jquery-1.6.2.min.js call.
  • The REAL solution: adding background: "none" to the jQuery code which seems to have gone missing from the fix as per comment:18 on this page which refers to

https://github.com/jquery/jquery/commit/f1392d82089323ec9ef97b33909b960cc16c25b6/

comment:25 Changed 12 years ago by Timmy Willison

I don't think it's possible that 1.6.2 interferes with the background anymore as the "background: none" was removed from the support source. https://github.com/jquery/jquery/blob/master/src/support.js#L144

comment:26 in reply to:  20 Changed 12 years ago by JorisDebonnet

Hmm... I understand it's confusing why there is still a problem, but I see four different people reporting that there's still a problem. Regardless how strange it is, isn't that reason enough to reopen this ticket?... :)

Replying to [email protected]:

Steps to reproduce in IE8/XP:

  1. Go to http://www.msn.com/?ocid=iehp (IE default home page)
  2. In the same tab, go to this jsFiddle: http://fiddle.jshell.net/ZKPZq/6/show/

There's a way to reproduce this problem without involving MSN or any other site.

  1. Go to http://fiddle.jshell.net/ZKPZq/6/ with IE8.
  2. Right click in the result screen, and make it refresh.
  3. Boom, crash.

And it messes up IE8 pretty good, because after it 'recovers' the tab, jsFiddle doesn't work anymore until I completely restart IE8.

So what have we learned: whether it's MSN or jsFiddle or any other site with heavy javscript (perhaps onunload handlers?), the problem seems to occur only when IE8 has certain things in the tab's memory.

Perhaps some jQuery initialisation code is begin executed "too soon" for IE8? We'd expect a clean sheet to initialise in of course, but perhaps IE8 isn't completely giving us that.

comment:27 Changed 12 years ago by pennedav

I can confirm this is still an issue with jQuery 1.6.2.

Removing background: declaration for <body> resolves the issue.

Visiting MSN has nothing to do with it.

There's a Stack Overflow post about this that references http://onpoint.wbur.org/op_full.html as an example. Load the second link, hit the refresh button, and the tab crashes. (This is on XP SP3.)

In rare cases I've had it actually crash the iexplore.exe process, but I've not been able to reproduce that case easily.

Note: See TracTickets for help on using tickets.