Closed Bug 314095 Opened 16 years ago Closed 7 years ago

Eliminate nsIContent::GetDocument


(Core :: DOM: Core & HTML, defect)

Not set





(Reporter: bzbarsky, Assigned: smaug)



(1 file, 3 obsolete files)

We should replace this with either GetOwnerDoc or GetCurrentDoc (or both if some caller needs both!).

The basic split is:  if the caller is doing something that depends on the DOM, use GetOwnerDoc.  If it depends on the presentation, use GetCurrentDoc.  s/depends on/affects/ if desired

So e.g. nsIDocumentObserver notifications would use the current doc (or both if they're not the same?).

Events are a pain since they need both, in some cases

Security checks... probably the owner doc.  This needs thought in some cases.

Base URIs... owner doc.
I wonder if we should clarify the names a bit. And even adding something that returns what GetCurrentDoc returns now.
(In reply to comment #1)
> And even adding something that returns what GetCurrentDoc returns now.

Why? GetCurrentDoc isn't going to change, is it?
Ignore me ;-). Do we have concrete usecases for such a function though?
Assignee: general → nobody
QA Contact: ian → general
Assignee: nobody → bugs
GetUncomposedDoc() is the same as the old GetCurrentDoc(), and
GetComposedDoc() returns a valid value also in case the node is somewhere in
shadow dom which is attached to normal dom subtree which is in document.
Attachment #8476757 - Flags: review?(jst)
Additional patch to fix some OSX specific code paths.
Comment on attachment 8476757 [details] [diff] [review]

r=jst. We should file bugs on your XXX comments though.
Attachment #8476757 - Flags: review?(jst) → review+
Filed Bug 1057470 for GetElementById, and other XXX have bugs.
Attached patch combined (obsolete) — Splinter Review
Attachment #8476757 - Attachment is obsolete: true
Attachment #8476775 - Attachment is obsolete: true
Attached patch combinedSplinter Review
Attachment #8477610 - Attachment is obsolete: true
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.