nsIEditor: Getting a pres shell?

Alex Vincent <[email protected]>
Newsgroups gmane.comp.mozilla.devel.editor
Message-ID <[email protected]>
I'm looking at nsIEditor.init(), and it has this unusual comment:
http://mxr.mozilla.org/mozilla1.9.1/source/editor/idl/nsIEditor.idl#84

    * @param aPresShell    TEMP: The presentation shell displaying the 
document.
    *                      Once events can tell us from what pres shell
    *                      they originated, this will no longer be
    *                      necessary, and the editor will no longer be
    *                      linked to a single pres shell.

I'm wondering if we can use a procedure like this:

nsresult rv = event->GetTarget(getter_AddRefs(target));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIContent> targetContent(target);
nsPresContext* context = 
nsContentUtils::GetContextForContent(targetContent);
nsIPresShell* shell = context->GetPresShell();

I also notice nsDOMEvent.h has a protected member:
nsCOMPtr<nsPresContext>     mPresContext;

If we expose a public method, GetPresContext(), would that be enough?

Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.