Closed Bug 314095 Opened 16 years ago Closed 7 years ago
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?
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.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.