Side navigation
#9028 closed bug (fixed)
Opened April 30, 2011 02:13PM UTC
Closed May 02, 2011 03:57PM UTC
Last modified August 05, 2011 08:23PM UTC
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).
Attachments (0)
Change History (28)
Changed April 30, 2011 02:57PM UTC by comment:1
_comment0: | Further reduction... \ \ http://jsfiddle.net/rwaldron/fdACd/1/ → 1304175760255996 |
---|---|
component: | unfiled → support |
Changed April 30, 2011 03:14PM UTC by comment:2
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):
Changed April 30, 2011 03:27PM UTC by comment:3
Thanks for the clarification there.
Changed April 30, 2011 05:41PM UTC by comment:4
component: | support → core |
---|---|
milestone: | 1.next → 1.6 |
priority: | undecided → blocker |
status: | new → open |
Confirmed. Not sure this is a jQuery problem, but we should probably look into it before 1.6 final.
Changed April 30, 2011 09:02PM UTC by comment:5
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.
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'
Changed May 02, 2011 03:01AM UTC by comment:6
cc: | → jaubourg |
---|---|
component: | core → support |
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.
Changed May 02, 2011 03:22AM UTC by comment:7
Replying to [comment:6 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.
Changed May 02, 2011 03:57PM UTC by comment:8
resolution: | → fixed |
---|---|
status: | open → closed |
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
Changed May 13, 2011 04:40PM UTC by comment:9
after using 1.6.1 my background image in ie-8 disappeared!
Changed May 13, 2011 05:03PM UTC by comment:10
@anonymous: see #9239
Changed June 02, 2011 07:51PM UTC by comment:11
Replying to [comment:8 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.
Changed June 02, 2011 11:22PM UTC by comment:12
@Josh: already done
Changed June 03, 2011 01:40PM UTC by comment:13
@timmywil: Way ahead of me, thanks! Somehow I was not looking at the master branch before.
Changed June 28, 2011 03:11PM UTC by comment:14
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.
Changed June 28, 2011 03:31PM UTC by comment:15
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.
Changed July 08, 2011 10:01AM UTC by comment:16
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.
Changed July 08, 2011 02:27PM UTC by comment:17
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... :)
Changed July 13, 2011 10:30PM UTC by comment:18
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.
Changed July 17, 2011 04:26PM UTC by comment:19
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
Changed July 21, 2011 11:03PM UTC by comment:20
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.
Changed July 21, 2011 11:50PM UTC by comment:21
You do realize that it's not possible that "visiting MSN first" would have anything to do with the background of another website, right?
Changed July 22, 2011 12:48AM UTC by comment:22
Replying to [comment:21 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?
Changed July 22, 2011 03:34PM UTC by comment:23
Replying to [comment:22 jaubourg]:
Replying to [comment:21 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.
Changed July 28, 2011 03:11PM UTC by comment:24
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/
Changed July 28, 2011 04:00PM UTC by comment:25
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
Changed July 31, 2011 08:43PM UTC by comment:26
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 [comment:20 riboyoflavin@…]:
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.
Changed August 05, 2011 07:26PM UTC by comment:27
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.
Further reduction...
http://jsfiddle.net/rwaldron/fdACd/1/
(Sorry, I'm on an IE-free machine right now)