designMode and Firefox

Another weird bug reported back in 2004 and unfortunately still not resolved – bug 232791, marked as a dup for bug 474255 (testcase here – if you click on the editable window, neither delete nor backspace button works, and if you add a character, it springs back to life). When you work with wysiwyg editor in Firefox (MIDAS), and programmatically add a text node to the end of the editable document, Firefox creates a dumb BR node of type _moz with _moz_editor_bogus_node attribute.

Yuh-Ruey Chen proposed a workaround – you set designMode to 'off' and then back to 'on' and it works, and this approach is used in YUI library (see ticket 1946017).

The weird thing I noticed now in FF 3.0.8 is that while the bug is still not fixed, the bogus BR node is not visible through Firebug for some reason! And that’s strange – node’s invisible, but still there.

However, workaround still works so nothing to worry about, just interesting.

comments powered by Disqus