In article <[EMAIL PROTECTED]>,
 mike_lee <[EMAIL PROTECTED]> wrote:

> No, but I was able to fine tune the problem down to the nsISelection 
> object. For some reason the selection of the editor is lost prior to 
> entering the nsIEditActionListener instance. The position is correct, 
> but the range disappeared. So I can not get the selection of the editor 
> from within the nsIEditActionListener instance. Is this by design or bug?
> 
> I need this so I can drag and drop a url from a browser and replace the 
> text description with the current selection.

The problem is that the nsIEditActionListener callback API
is too low-level for what you are trying to do. The methods
on this API will get called when the editor is in the middle
of editing operations, so the current selection state is
undefined (since the selection will change as the editor does
node operations during the edit). Your problem here has
nothing to do with JS scoping issues.

In addition, the methods on nsIEditActionListener will get
called *a lot* during normal editing operations, copy and
paste etc. By implementing this interface in JS, you probably
seriously impact editor performance (try large pastes, for
example).

Give us a detailed description of what you are trying to do,
and we'll try to suggest some alternative solutions.

Simon

-- 
          Simon Fraser   Entomologist
  [EMAIL PROTECTED]   http://people.netscape.com/sfraser/

Reply via email to