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
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-editor

Reply via email to