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