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

Bug 361464

Summary: DOM exception on cut
Product: [ECD] Orion Reporter: Adam Peller <apeller>
Component: EditorAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: eclipse.felipe, Silenio_Quarti
Version: 0.3   
Target Milestone: 0.4 M1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Adam Peller CLA 2011-10-19 15:41:47 EDT
1. open minimaleditor.html
2. paste the following content into the buffer

http://pastebin.com/968e7WsX

3. select from the input to the /select
4. hit control-x / command-x to cut
5. there's an exception in cleanup where the child does not exist in _clientDiv. The native cut seems to remove it, so a (harmless) DOM exception occurs.
Comment 1 Felipe Heidrich CLA 2011-10-19 16:26:09 EDT
What browser and orion version ?

I fixed a bug similar to this in the past, it is race condition where the timer that runs updatePage() get executed  before the cleanUp() timer and removes the div. When tries to remove the div it throws an exception div is not in the clientDiv.
Comment 2 Felipe Heidrich CLA 2011-10-20 14:55:34 EDT
I did some investigation

To reproduce the problem we need to execute a cut operation that causes the view to scroll (to show the new location of the caret)

For that you can go to:
http://orion.eclipse.org/examples/textview/demo.html
create a java file
select a line that is bigger than the view (line 77 works for me)
cut

When the cut operation is over there will be two timers, one for the scroll event, and one for the cleanup
if the scroll handler runs first it calls updatePage() which removes  the div  - when the cleanup runs it fails.