Sharovatov’s Weblog

designMode and Firefox

Posted in browsers, Firefox, javascript, wysiwyg by sharovatov on 13 April 2009

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.

Digg This

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: