Closed
Bug 802394
Opened 13 years ago
Closed 13 years ago
document.body is null in aboutHome.js
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 19
People
(Reporter: jaws, Assigned: jaws)
Details
Attachments
(1 file, 2 obsolete files)
1.11 KB,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
Timestamp: 10/16/2012 3:29:58 PM
Error: TypeError: document.body is null
Source File: chrome://browser/content/abouthome/aboutHome.js
Line: 236
where line 236 is:
> } else if (document.body.hasAttribute("narrow")) {
Assignee | ||
Comment 1•13 years ago
|
||
STR:
Have about:home as the homepage for the browser
Open the Error Console
Open a New Window
Look at Error Console
Assignee | ||
Comment 2•13 years ago
|
||
By placing some alert()'s in the code, I found that new windows are getting the 'resize' event before 'load', and that is what is causing document.body to be null.
Attachment #672077 -
Flags: review?(fryn)
Comment 3•13 years ago
|
||
Comment on attachment 672077 [details] [diff] [review]
Patch
> function fitToWidth() {
>+ if (!gPageLoaded)
Does |if (document.readyState != "complete")| work here?
Assignee | ||
Comment 4•13 years ago
|
||
Yeah, that's a better approach and works well.
Attachment #672077 -
Attachment is obsolete: true
Attachment #672077 -
Flags: review?(fryn)
Attachment #672121 -
Flags: review?(dao)
Assignee | ||
Comment 5•13 years ago
|
||
Updated STR,
(In reply to Jared Wein [:jaws] from comment #1)
> STR:
> Have about:home as the homepage for the browser
Open a sidebar.
> Open the Error Console
> Open a New Window
> Look at Error Console
The open sidebar causes the resize before the document has loaded.
Comment 6•13 years ago
|
||
(In reply to Jared Wein [:jaws] from comment #5)
> The open sidebar causes the resize before the document has loaded.
Works for me, although this isn't too surprising if this is a race condition.
Do you get the error in Firefox 16, aurora, beta, nightly or only in a custom build?
Assignee | ||
Comment 7•13 years ago
|
||
I can reproduce in a regular Nightly build with the social sidebar open.
Comment 8•13 years ago
|
||
What code opens the social side bar?
Comment 9•13 years ago
|
||
Comment on attachment 672121 [details] [diff] [review]
Patch v2
Anyway... I think a better fix would be to move window.addEventListener("resize", fitToWidth); inside the load listener.
Attachment #672121 -
Flags: review?(dao) → review-
Assignee | ||
Comment 10•13 years ago
|
||
Attachment #672121 -
Attachment is obsolete: true
Attachment #672615 -
Flags: review?(dao)
Assignee | ||
Comment 11•13 years ago
|
||
To show the social sidebar, go to about:config and set social.active=true and social.enabled=true. You can then use the menu from the toolbar button to toggle the sidebar visibility.
![]() |
||
Comment 12•13 years ago
|
||
(In reply to Jared Wein [:jaws] from comment #11)
I think Dão was asking for the line(s) of code that perform that operation.
Assignee | ||
Comment 13•13 years ago
|
||
This is the call stack,
SocialSidebar_updateSidebar@chrome://browser/content/browser.js:4644
SocialSidebar_init@chrome://browser/content/browser.js:4605
SocialUI_providerReady@chrome://browser/content/browser.js:3977
chrome://browser/content/browser.js:4646
note that since browser.js was split into multiple files, much of this code will actually be found in browser-social.js.
Updated•13 years ago
|
Attachment #672615 -
Flags: review?(dao) → review+
Assignee | ||
Comment 14•13 years ago
|
||
Comment 15•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
You need to log in
before you can comment on or make changes to this bug.
Description
•