Quantcast

nsIEditor: Getting a pres shell?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

nsIEditor: Getting a pres shell?

Alex Vincent
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
_______________________________________________
dev-tech-editor mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-editor
Loading...