Skip to main content

Bug Tracker

Side navigation

#4267 closed bug (worksforme)

Opened February 27, 2009 01:55PM UTC

Closed June 12, 2010 01:25PM UTC

document.body is null in Firefox 3

Reported by: AvengingAngel Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: document.body is null Cc:
Blocked by: Blocking:
Description

I'm developing a site that uses jquery

I noticed a strange error when using Firefox

If i refresh my page superfast(holding F5) I get a document.body is null from the jquery file (according to FireBug 1.3.3)

I do not have any code using jquery on that page just the jquery file included.

The tricky thing is that the error seems related to timing as it only does it somtimes.

I know that peoble dont normally get this error but I still felt that is was too strange not to repport.

So the question is! in what logic is jquery using document.body when the file is loaded by the browser and why is it NULL?

Looking through the source I can see that too figure out if the W3C box model works as expected there is some use of document.body.

using

jquery-1.3.2.min.js

Firefox version 3.0.6

local dev site on IIS7 vista

Attachments (1)
  • jquerytest.png (56.4 KB) - added by AvengingAngel March 03, 2009 02:41PM UTC.

    bug shown in firebug

Change History (7)

Changed February 27, 2009 02:43PM UTC by AvengingAngel comment:1

if i use the non min jquery file

the error is on line 3204 document.body.appendChild( div );

it's in the W3C box model function

lookes like document.body is null in the document ready event ??

Changed March 01, 2009 11:47PM UTC by dmethvin comment:2

Can you provide a test case that demonstrates the problem?

Changed March 03, 2009 03:02PM UTC by AvengingAngel comment:3

This bug is hard to recreate in a test case.

There had to be some content and images before the bug showed.

Today I could only get the bug one time.?

Mayby this timing thing is a bug in firfox?

Yesteday I tried building a custom version of jquery where I put a simpel "if" around the document.body and that permenantly removed the bug from showing. The boxModel wasn't effected as constant holding the F5 key always endded in a working page.

Changed March 10, 2009 02:37PM UTC by uwalter comment:4

Hi @all.

This is definitely a bug in an XULRunner component, namely the feed fetcher, respectively IStreamListener. It does not occur when no live bookmarks are set.

Anytime when a document is loaded and the nsLivemarkService.js crashes at the same time, jQuery fails at the box model check, because the JavaScript engine doesn't create the DOM tree properly.

BugZilla: https://bugzilla.mozilla.org/show_bug.cgi?id=433748#c5

Best Regards

Uwe

Changed March 19, 2009 05:23PM UTC by phloc_bg comment:5

Replying to [comment:4 uwalter]:

Hi @all. This is definitely a bug in an XULRunner component, namely the feed fetcher, respectively IStreamListener. It does not occur when no live bookmarks are set. Anytime when a document is loaded and the nsLivemarkService.js crashes at the same time, jQuery fails at the box model check, because the JavaScript engine doesn't create the DOM tree properly. BugZilla: https://bugzilla.mozilla.org/show_bug.cgi?id=433748#c5 Best Regards Uwe

Hi Uwe,

For FF that might be true, but the problem also occurrs in IE (See also #4320, i.e. my comment in that issue). This seems to be reproducible quite easily and looks like a pure timing problem. A null check would be definitely a good thing here.

Changed May 28, 2009 10:26AM UTC by vmaury comment:6

I've the same issue.

jquery min 1.3.2

FF 3.0.10

Firebug 1.3.3

No problem with IE7

Changed June 12, 2010 01:25PM UTC by dmethvin comment:7

component: unfiledcore
resolution: → worksforme
status: newclosed

The original report was for 1.3.2, but it hasn't been reported since the release of 1.4. If anyone is having a problem in 1.4, which contains the same W3C box model code, please reopen the ticket. I would desperately like to see a test case with it as well.