I was reviewing some of my old DOM experiments and getting excited because so much stuff has been fixed in the latest versions of Mozilla. My excitement, however was dampened by the fact that Bug 58850 – this.selectionStart is broken in XBL handler for textarea was still open and has been pushed back in fact and is now targeted at mozilla1.0.1. For some perspective, this bug was opened in Nov 2000, I first encountered this problem back in Dec 2000 when I was trying to replicate the blogger interface (over the summer I was trying to replicate the Blogger HTML editing widgets and was blocked by getSelection (searching through the moz source revealed the function was empty) but when I gave it another go, I ended up being blocked by 58850 and was so frustrated that I have never returned and swore off moz DOM dev until v1.0 – I guess now it’ll be v1.0.1) getSelection is needed so that you can find out where your selectionRange starts so you can inline any changes into the TextArea.

Here’s an actual comment on the bug from a Netscape engineer:

Yes, selectionStart and selectionEnd don’t work for multiline text fields

(because it’s hard to calculate them from content). This is a known problem.

I just can’t wrap my head around what he’s trying to say. We just skipped over it and waited for someone to submit a bug because we were lazy? (it wasn’t in bugzilla before someone reported the problem) We only get paid to fix the easy stuff? I dunno, it’s just beyond my comprehension I guess.