User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en_US; rv:1.9) Gecko/2008051909 (Gentoo) Firefox/3.0
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en_US; rv:1.9) Gecko/2008051909 (Gentoo) Firefox/3.0
In Firefox 3 (tested in RC1 and RC2 on mac and linux, didn't exist in FF2), the getSelection function is returning from cursor to the end of the page as a selection, even when nothing is selected
Steps to Reproduce:
1.Go to URL http://xinha.gogo.co.nz/xinha-nightly/examples/ExtendedDemo.html
2. Go to HTML source view of Xinha (click the third icon from the right, looks like a page with angle brackets)
3. Paste the following HTML "General Resources<br />
4. Go back to document view (re-click the same icon)
5. Now click the end of the first line and hit the enter key. The text of the second line will disapper.
The second line has disappeared, since getselection reports a selection to the end of the iframe
an inserted line, becuase there is no selection
This will not block the final release of Firefox 3.0. A patch with tests may be considered for a 3.0.x release.
Regression happened between the two nightly builds:
WORKING -> 2006-10-21-06-trunk
BROKEN -> 2006-10-22-05-trunk
WORKING -> ftp://ftp.mozilla.org/pub/firefox/nightly/2006/10/2006-10-21-06-trunk/firefox-3.0a1.en-US.mac.dmg
BROKEN -> ftp://ftp.mozilla.org/pub/firefox/nightly/2006/10/2006-10-22-05-trunk/firefox-3.0a1.en-US.mac.dmg
bent: any ideas?
The test case is WFM. I couldn't make anything funny happen no matter where I pasted that text. Douglas, could you clarify these steps any? Do I have to paste that text in a particular place?
I can reproduce the test case every time on many computers... You have to go to HTML mode before inserting the text, then return to document mode, but upon further inspection, the algorithm behind this page is so poorly written that I've come to believe it's miswritten, and is just dependent on the behavior pre-Firefox3, even if that behavior is wrong. I looked at the code differences in Firefox, and it's a change in nsRange.cpp which looks like it is a valid change (Before, trying to create a range in reverse resulted in an invalid range. Now, trying to create a range in reverse collapses the range... I see this as valid behavior, but I was hoping to wait till the end of the week to finish my testing...
Not wanted for 1.9.1, but if this turns out to really be a bug that needs fixing, patches would still be considered.