Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351242

Summary: [client][editor] error on firefox on mac holding commad+v down
Product: [ECD] Orion Reporter: Felipe Heidrich <eclipse.felipe>
Component: ClientAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Felipe Heidrich CLA 2011-07-05 17:03:49 EDT

    
Comment 1 Felipe Heidrich CLA 2011-07-05 17:06:15 EDT
On mac/firefox


run demo.html
create the text view
copy something
hit command+p and hold it down
the content is paste multiple times in the view as it should
but we also get a bunch of errors in the console
Node was not found" code: "8
[Break On This Error] self._clientDiv.removeChild(child);
textView.js (line 3046)
Comment 2 Felipe Heidrich CLA 2011-07-06 12:52:16 EDT
The repeat key is sending paste events very fast. The problem happens when a second paste events comes in before the getText timeout of the first event.

This is the order

1st paste event
-- create a pre element (child0) and select it
-- set timeout (timeout0) in zero
-- return to ua, ua executes the paste operation on child0
2nd paste event
-- create a pre element (child1) and select it
-- set timeout (timeout1) in zero
-- return to ua, ua executes the paste operation on child1
timeout0 runs
-- get the pasted text in child0
-- remove child0 from parent
-- add the text to view
timeout1 runs
-- get the text from child1
-- try to remove child1 from parent and fails.
At this point parent is NULL
This happens because updateRun() ran at the end of the timeout0 and removed all unnecessary nodes from the parent (including child1).

I suspect we can just fix that by testing parent === NULL
- it won't leak causes child1 is getting removed
- the paste works