Re: DOM mutation events don't fire for radio,checkbox

wastedScal <[email protected]>
Newsgroups gmane.comp.mozilla.devel.editor
Message-ID <[email protected]>
HGreg Amerson wrote:
> Hello all,
> 
> I'm embedding the Mozilla editor in an application and I have noticed 
> that mozilla doesn't fire DOMNodeInserted or DOMNodeRemoved events for 
> radio or checkbox input elements.  However, the correct mutation events 
> are fired for all other types of nodes to my knowledge.  I wonder what 
> is going on with checkbox and radio.
> 
> The best way to illustrate is when an simple HTML document.
> 
> Load the following document:
> <html>
>   <head>
>     <script>
>     function domhandler(event) {
>         alert(event.type+': '+event.target.nodeName);
>     }
>     function load() {
>         document.designMode = 'on';
>         document.addEventListener("DOMNodeRemoved", domhandler, false);
>         document.addEventListener("DOMNodeInserted", domhandler, false);
>     }
>     </script>
>   </head>
>   <body onload="load()" >
>   text: <input type="text"/> :text<br>
>   radio: <input type="radio"/> :radio<br>
>   checkbox: <input type="checkbox"/> :checkbox<br>
>   <checkbox/>
>   </body>
> </html>
> 
> Notice that when you select the textfield and press "delete" you will 
> get a DOMNodeRemoved event for the INPUT type="text" element.  However, 
> if you delete either the radio or checkbox it will not fire a 
> DOMNodeRemoved.  The same is true for when you copy/paste a radio or 
> checkbox, when you paste it, it doesn't fire a DOMNodeInserted event.
> 
> Is there something different about radio's and checkboxes that keep them 
> from firing DOM mutation events?
> 
> Best regards,
> Greg

Hi;
I'm running into the same problem but with the event "click"; the editor 
never triggers the click on radio/checkbox input type I add into my 
iframe's document.
It works fine for all other elements I tried (so far).

Andi, in a reply, proposed to try the nsIEditActionListener; what is 
this? Where can I get information on how to implement this. This isn't 
simple JavaScript is it?

Thanks for any advices/tips

Scal
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.