Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347876 - [client] FF4 error when using Esc to dismiss Open Resource
Summary: [client] FF4 error when using Esc to dismiss Open Resource
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Mark Macdonald CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-31 20:05 EDT by Susan McCourt CLA
Modified: 2011-09-01 11:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2011-05-31 20:05:09 EDT
FF4.
Hit "T" to open the "Open Resource" dialog
Hit Esc.
Next time you hit "T" you'll see 3 errors in the console:

exception in animation handler for: beforeBegin
fx.js (line 153)
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLInputElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost:8080/org.dojotoolkit/dijit/_base/focus.js :: <TOP_LEVEL> :: line 48" data: no]
console.error(e);
fx.js (line 154)
_t.curve is undefined
[Break On This Error] var value = _t.curve.getValue(_t._getStep()); 

This is very similar to bug 345292. The focus node at the time you try to open the dialog again affects whether you get the error or not.
Comment 1 Susan McCourt CLA 2011-06-16 13:14:10 EDT
Changing title of bug.  The red herring here was that only the open resource dialog is opened via key binding and I noticed this bug just after adding keybindign support.  As a test, I added a keybinding to open the link dialog, and it does not exhibit the problem.  So the problem is specific to OpenResourceDialog.
Comment 2 Susan McCourt CLA 2011-06-16 13:34:12 EDT
It turns out that this one is simply a specific case of bug 345292.  It seems I must have fixed every dialog except OpenResource, because it's workarounds are different than the other ones.

I'm afraid I'm going to have to pass this one onto Mark.
We no longer launch open resource from an image, so the way to get this to happen is to launch open resource by keybinding outside of the editor.  (Use "T"). 

If you set focus somewhere before reopening open resource, everything is ok. So steps are

Hit "T"
Hit Esc
[Click on checkbox in navigator first?]
   if yes, hit "T" again,  no problem
   if no, hit "T" again, you see the problem.

So I think that some of the old workarounds involving focus nodes need to be removed from this dialog.  I tried the easiest thing which was to remove the dialog.refocus = false workaround and that was not enough.

Since the timing of onHide has changed, I tried putting the clearTimeout code in the hide method, after the animation deferred completed.  That did not work either.

Then I started to get nervous that I didn't understand the code enough to go further. 

I don't think this bug is critical given it only affects open resource, but if you have time to investigate it would be worth a look....
Comment 3 Mark Macdonald CLA 2011-06-20 11:33:04 EDT
OpenResourceDialog is unlike the other dialogs in that it creates a dijit.Dialog as a child widget, rather than extending dijit.Dialog. There's really no reason for this.

I refactored it to extend from dijit.Dialog instead, and it does fix the problem described in Comment 2. Will release the fix in 0.3.
Comment 4 Mark Macdonald CLA 2011-06-27 18:41:56 EDT
http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=a57be4b36d0eb8e2e49a162c8c4b7ca57f695069

Refactored as described in Comment 3, and removed old workarounds that didn't do anything.