Open Bug 366416 Opened 18 years ago Updated 2 years ago

wrong rangeOffset in a wrapped span when double-clicking

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect

Tracking

()

People

(Reporter: asher.szmulewicz, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

double clicking on a word which is not in the first line of a wrapped span
returns a wrong value of the event.rangeOffset.
single click event.rangeOffset returns the right value 

Reproducible: Always

Steps to Reproduce:
1.load the very simple page in firefox(see additional information)
2.adjust the width of browser to get the sentence wrapped
3. double click on the repeated sentence on the second line
Actual Results:  
by double clicking on the last word of the second sentence, the alert returns 22 which is wrong

Expected Results:  
by single clicking on the last word first sentence, the alert returns 138 which is right

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
 
<body>
<span onclick="alert(event.rangeOffset)">This is a span which seems to cause problems with getting the rangeOffset when doing a doubleclick. What can we do about this? I don't know. </span>
<br><br>
<span ondblclick="alert(event.rangeOffset)">This is a span which seems to cause problems with getting the rangeOffset when doing a doubleclick. What can we do about this? I don't know. </span>
</body>
</html>
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2pre) Gecko/20070108 Minefield/3.0a2pre
Get the same result in trunk.
Confirming with:
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a2pre) Gecko/20070105 Minefield/3.0a2pre ID:2007010506 [cairo]
Status: UNCONFIRMED → NEW
Component: General → Selection
Ever confirmed: true
OS: Windows XP → All
Product: Firefox → Core
Hardware: PC → All
Version: unspecified → Trunk
Keywords: testcase
Assignee: nobody → selection
QA Contact: general
This appears to be an event handling problem. The target frame for the double-click event is the inline frame for the first line (not the second-line continuation frame!).

For single-click, the target frame is the continuing text frame, which works.
Assignee: selection → events
Component: Selection → Event Handling
QA Contact: ian
Assignee: events → nobody
QA Contact: ian → events
Component: Event Handling → User events and focus handling
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: