Closed Bug 356034 Opened 18 years ago Closed 18 years ago

Setting selectionStart and selectionEnd on a empty line incorrectly places the caret on the line above

Categories

(Core :: DOM: Editor, defect)

1.8 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 334256

People

(Reporter: h4writer, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7 If you set the selectionStart and selectionEnd on a empty line, the caret comes on the line above. Reproducible: Always Steps to Reproduce: (see my testcase) 1. Click on "Put the caret on place 11" 2. Click on "Put the caret on place 12" 3. Click on "Put the caret on place 13" Actual Results: 1. the caret comes on de second line after the d 2. the caret comes on de second line after the d 3. the caret comes on the fourth line before the d Expected Results: 1. the caret comes on de second line after the d 2. the caret comes on de third line 3. the caret comes on the fourth line before the d - After you set the caret on the third line yourself (with your mouse), the testcase will work like expected. If you set the caret on another line (with your mouse), javascript will again makes mistakes - It seems that it occur when you have a 2 \n after eachother.
Attached file testcase
Here is the testcase I mentioned, where you can see the fault.
Component: General → JavaScript Engine
Product: Firefox → Core
Version: unspecified → 1.0 Branch
Assignee: nobody → selection
Component: JavaScript Engine → Selection
QA Contact: general
Version: 1.0 Branch → 1.8 Branch
Assignee: selection → nobody
Component: Selection → Editor
Summary: selectionStart and selectionEnd don't put the caret on the right location → Setting selectionStart and selectionEnd on a empty line incorrectly places the caret on the line above
confirming Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.0.8pre) Gecko/20061009 Firefox/1.5.0.8pre Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1) Gecko/20061009 SeaMonkey/1.1b
Status: UNCONFIRMED → NEW
Ever confirmed: true
Duplicate of bug 334256 (fixed on trunk - verified with the testcase on this bug). *** This bug has been marked as a duplicate of 334256 ***
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: