Important: make sure caret browsing is enabled - hit [F7]
Problem:
XBL event handling is deregistered after a particular sequence of DOM operations that implement a "delete to previous line" option.
Instructions:
- Select mid point of line in the red bordered box that says [merged text]. A dotted black border will appear around the content area, indicating that XBL event handling is active for this area.
- Alternatively hit "delete" and backspaces keys until at beginning of line. They both work.
- Now hit either backspace or delete to merge the line you're on with the previous "base" line. You will now be on the top line of the content area at the point where text is merged.
- Now hit the delete key: it won't work. "delete" handling was registered in XBL. XBL event handling seems to have been deregistered.
- Now hit the backspace key: deletion happens as before. Unlike the XBL handling of "delete", handling for "backspace" was registered using 'addEventListener'. "Backspace" working like this means native DOM registration is fine as is selection. Only XBL handling seems broken.
- Now select on the point where the cursor/caret is. "delete" works again: XBL event handling has reregistered!
Note: a variation, where "merge" is invoked through a link outside the selected content area, makes XBL deregister though selection is still active in the content area. But that's another story.