GetRootContent and GetDocumentElement callers must null-check

VERIFIED FIXED in mozilla0.9

Status

()

Core
DOM: Core & HTML
P3
critical
VERIFIED FIXED
18 years ago
10 years ago

People

(Reporter: dbaron, Assigned: Dan Rosen)

Tracking

({dom1})

Trunk
mozilla0.9
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

As vidur pointed out in bug 40121, we need to make sure that all callers of
nsIDocument::GetRootContent and nsIDOMDocument::GetDocumentElement check for
null, since these functions may return null in rare cases.
Created attachment 20659 [details] [diff] [review]
Proposed fix for some of the possible problems.
Created attachment 20660 [details] [diff] [review]
New patch without my stupid boogs that scc caught.

Comment 3

18 years ago
Looks good. r=blake
Thenks for the reviews (blake and scc), now there's only one place remaining
that needs to deal with null root element cases (possibly), that's at
http://lxr.mozilla.org/seamonkey/source/layout/xbl/src/nsXBLWindowHandler.cpp#193
so I'll let hyatt deal with that.
Assignee: jst → hyatt
OS: Linux → All
Hardware: PC → All

Comment 5

18 years ago
->moz0.9
Target Milestone: --- → mozilla0.9

Comment 6

18 years ago
->dr
Assignee: hyatt → dr
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 7

18 years ago
Created attachment 25407 [details] [diff] [review]
yet another null check
(Assignee)

Comment 8

18 years ago
this fixes this instance (looking for r=, etc...) but there are other places in
the code where these functions aren't null-checked (nsHTMLEditor.cpp and
nsXULElement.cpp to name a couple).

i'll check this in asap and then throw this back at jst, since he seemed to know
something about which calls should and shouldn't need null-checking.
Keywords: dom1
Component: DOM Level 1 → DOM Core
(Assignee)

Comment 9

18 years ago
Created attachment 26320 [details] [diff] [review]
previous patch, post-layout-content-split
(Assignee)

Updated

18 years ago
Keywords: review

Comment 10

18 years ago
r=jag
(Assignee)

Comment 11

18 years ago
sr=hyatt. i'll check in when the tree opens.
(Assignee)

Comment 12

18 years ago
checked in (cvs rev 1.5). jst, i'm marking this as fixed -- could you verify, if
there are indeed no more cases where this needs to be null-checked? i noticed
some calls in nsHTMLEditor.cpp, nsXULElement.cpp, but it sounded like you knew
something about those cases... thanks!
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Keywords: review
Resolution: --- → FIXED

Comment 13

18 years ago
QA contact Update
QA Contact: janc → desale

Comment 14

17 years ago
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala

Comment 15

17 years ago
johnny can u please verify this bug...
Verified.
Status: RESOLVED → VERIFIED

Updated

10 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.