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

Bug 468684

Summary: [Hover] Anchor area in html for script blocks is larger than the text
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: ClientAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: 9.0   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=457883
Whiteboard:

Description Curtis Windatt CLA 2015-05-28 12:31:26 EDT
<html>
<script src="http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg"></script>
</html>

If you hover anywhere on the line, even after the text, you still get the popup image.
Comment 1 Curtis Windatt CLA 2015-05-28 12:41:28 EDT
This is essentially a dupe of Bug 457883.  The mouse is outside of the text, but we get the offset for the end of the text on that line.  The anchor area is correct, which is worse because every time you move the mouse the hover is closing and reopening.
Comment 2 Curtis Windatt CLA 2015-05-28 15:51:23 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=5769b84a52ca2f7d2e08cde1f3ee6e46367c1d7f
Two parts to the fix
1) In addition to the existing check to see if we are on a document line, add a check to compare the x coordinate with the bounds at the offset text view returns.  If the x position is past the bounds, than the hover was outside of text.  I'm not sure if the editor supports RTL/BIDI, but this fix would likely not work with it.
2) The HTML node finder does not check the end offset (possibly because this information wasn't available previously).  This means that any trailing whitespace or any other characters that don't constitute a new node are treated as part of the previous node.  Simple fix to limit the found node to its range.