Closed Bug 314095 Opened 19 years ago Closed 10 years ago

Eliminate nsIContent::GetDocument

Categories

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

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: bzbarsky, Assigned: smaug)

Details

Attachments

(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.

https://tbpl.mozilla.org/?tree=Try&rev=cd373d42ec03
Attachment #8476757 - Flags: review?(jst)
Additional patch to fix some OSX specific code paths.
Comment on attachment 8476757 [details] [diff] [review]
remove_nsIContent_GetDocument.diff

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
https://hg.mozilla.org/mozilla-central/rev/9684e1598f4e
Status: NEW → RESOLVED
Closed: 10 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.

Attachment

General

Created:
Updated:
Size: