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

Bug 462882

Summary: [Hover] Exception while hovering in HTML file
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, emoffatt
Version: 8.0   
Target Milestone: 9.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2015-03-23 13:47:32 EDT
With the latest from master I was hovering around the following snippet:

<!DOCTYPE html>
<head>
<script src="../finding/es6.js">
</script>
<script>
    /* eslint-env amd */
    define('name', ["esprima"], /* @callback */ function(importname) {
        //
    });
    /*globals importScripts */
    /*eslint-env node */
    var s = importScripts('../es6');
    s = importScripts('./es6.js');
    s = importScripts('es6.js');
    s = importScripts('../finding/es6.js');
    
    s = require('../es6');
    s = require('./es6');
    s = require('es6');
    s = require('../finding/es6');
    s = require(['esprima', 'foo', 'es6']);
    if(s) {
        //todo
    }
</script>
</head>
<body>
 <img src="../CSS/css.png"/>
</body>
</html>

and got the following exception:

TypeError: Cannot read property 'x' of undefined

The trace:

Tooltip._captureLocationInfo (tooltip.js:279)
_showContents (tooltip.js:328)
(anonymous function) (tooltip.js:209)
settleDeferred (Deferred.js:70)
notify (Deferred.js:144)
run (Deferred.js:28)
Mutation (async)
(anonymous function) (Deferred.js:46)
enqueue (Deferred.js:58)
_resolve (Deferred.js:196)
resolve (Deferred.js:227)
_messageHandler (pluginregistry.js:395)
(anonymous function) (pluginregistry.js:1117)
_messageHandler (pluginregistry.js:1106)
postMessage (async)
_publish (plugin.js:58)
(anonymous function) (plugin.js:202)
settleDeferred (Deferred.js:70)
notify (Deferred.js:144)
run (Deferred.js:28)
Mutation (async)
(anonymous function) (Deferred.js:46)
enqueue (Deferred.js:58)
_resolve (Deferred.js:196)
resolve (Deferred.js:227)
_messageHandler (pluginregistry.js:395)
(anonymous function) (pluginregistry.js:1117)
_messageHandler (pluginregistry.js:1106)
postMessage (async)
_publish (plugin.js:58)
(anonymous function) (plugin.js:202)
settleDeferred (Deferred.js:70)
notify (Deferred.js:144)
run (Deferred.js:28)
Comment 1 Curtis Windatt CLA 2015-03-23 14:01:25 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8f8cab8abe039b58e3e69a63e746455c1d9bb8a8

Another drawback of the hide method having two purposes (see the TODO above the changed lines).  If you have a async hover that isn't done before you hover over some other content we may lose the info.
Comment 2 Eric Moffatt CLA 2015-03-25 15:01:54 EDT
If you are waiting on a hover and you move the mouse then we should 'cancel' any previous / outstanding hover calls. To paraphrase; if 'hide' gets called before any hover info is returned the defers should be cancelled. If we don't do this then we'll see odd cases where the hover will appear at a location unrelated to where the cursor *currently* is...