Closed
Bug 856143
Opened 12 years ago
Closed 9 years ago
When using dispatchEvent to trigger mouse events on a contenteditable="true" DIV the cursor and selection are not set correctly.
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: cory, Unassigned, NeedInfo)
Details
(Keywords: testcase-wanted)
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
Steps to reproduce:
var x = 10;
var y = 10;
var event = document.createEvent('MouseEvents');
event.initMouseEvent('mousedown', true, true, window, 1, element.offsetLeft + x, element.offsetY + y, x, y, false, false, false, false, 0, null);
element.dispatchEvent(event);
Actual results:
Does not set a cursor in a contenteditable DIB defines as element unless you have first clicked that DIV previous. When it is set (after having attained focus previously) it is not set in the correct position, nor is selection possible.
Expected results:
The cursor position should change when x and y correspond to mouse coordinates (such as for a DIV placed over the contenteditable DIV where x and y correspond appropriately).
Provide a testcase, please (simple html file showing the issue).
Flags: needinfo?(cory)
Keywords: testcase-wanted
Updated•12 years ago
|
Component: Untriaged → Editor
Product: Firefox → Core
Here is a fiddle demonstrating it:
http://jsfiddle.net/CoryG/SgBy4/1/
Flags: needinfo?(cory)
Correction, this one makes it easier to see the text area (bug exhibited in both):
http://jsfiddle.net/CoryG/SgBy4/
Comment 4•9 years ago
|
||
Hello Reporter, thank you for contacting us for this problem and we would like to resolve it in case it is still an issue for you. But I am having difficulty understanding this problem and ultimately reproducing it. May I request you a favor. Can you please double check if you are still having this issue on the latest released version of Firefox (44.0.2). In case you still encounter it, can you please describe it clearly with steps to duplicate and the problem. Also, let us know if you see the same issue with even other browsers like Chrome, IE, etc.
It would be great if you could attach a reduced test case for this problem. Below is the link that illustrates what do we mean by reduced test case and how can it be created.
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Reducing_testcases
If I understand it and able to recreate the issue then I can also create the test case but the problem is I am not fully clear with the actual issue here. I see similar behavior in both Chrome and Firefox with the URL that you provided (http://jsfiddle.net/CoryG/SgBy4/) and the javascript that you wrote in the bug description.
Flags: needinfo?(cory)
Comment 5•9 years ago
|
||
Resolved-Incomplete due to time since last communication/update by reporter.
Please feel free to reopen if the error occurs in a current Firefox version.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•