Open Bug 471975 Opened 15 years ago Updated 2 years ago

Impossible to get range during an onmousedown event

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: jean.claveau, Unassigned)

References

()

Details

(Keywords: dom2)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008122113 GranParadiso/3.0.5 FirePHP/0.2.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008122113 GranParadiso/3.0.5 FirePHP/0.2.1

This bug only happends on local computer, not on server.

Reproducible: Always

Steps to Reproduce:
1. Make a function tu get a range of a selection at mousedown event
2.
3.
Actual Results:  
Javascript error :
[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsISelection.getRangeAt]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: file:///home/oam/terem/intranet/svgd/version%20html/bug.html :: bouh :: line 13" data: no]

Expected Results:  
It may alert the startcontainer of the selection
Keywords: dom2
Please give a testcase that shows this on the bug. That makes it easier. Think this is core dom for now.
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
On Windows XP I see the error also when the testcase is loaded from server.
I see it also when I test it with old Firefox builds like Firefox 1 so this is not a (recent) regression.
OS: Linux → All
Hardware: x86 → All
i uploaded my original work at this adress : http://demos.ornelle.net/net/bugsFFX/rangemdown/stagiaire.html

My original goal is to know if a textnode is targeted during the clic (using selection is quite dirty but event.target will only return the container of the textnode and it is not enough for my work).

The error occurs only at the first mousedown (when any selection has already been made).

Then, if you retry a selection, the script returns the startContainer of the last range as if a mousedown is not enough to change the result of window.getSelection(). The window.getSelection() result seems to change only after the mouseup.
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: