Bug Tracker

Ticket #4267 (closed bug: worksforme)

Opened 6 years ago

Last modified 5 years ago

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:
Blocking: Blocked by:

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

jquerytest.png Download (56.4 KB) - added by AvengingAngel 6 years ago.
bug shown in firebug

Change History

comment:1 Changed 6 years ago by AvengingAngel

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 ??

comment:2 Changed 6 years ago by dmethvin

Can you provide a test case that demonstrates the problem?

Changed 6 years ago by AvengingAngel

bug shown in firebug

comment:3 Changed 6 years ago by AvengingAngel

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.

comment:4 follow-up: ↓ 5 Changed 6 years ago by 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

comment:5 in reply to: ↑ 4 ; follow-up: ↓ 8 Changed 6 years ago by phloc_bg

Replying to 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.

comment:8 in reply to: ↑ 5 Changed 6 years ago by vmaury

I've the same issue. jquery min 1.3.2 FF 3.0.10 Firebug 1.3.3

No problem with IE7

comment:10 Changed 5 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme
  • Component changed from unfiled to core

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.

Note: See TracTickets for help on using tickets.