selector = handleObj.selector,
oldType, ret;
+ // NB: No relatedTarget if the mouse left/entered the browser window
if ( selector && related ) {
// Delegated event; find the real relatedTarget
related = jQuery( related ).closest( selector )[0];
}
- if ( !related || related !== target && !jQuery.contains( target, related ) ) {
+ // For mouseover/out, contains isn't needed; handle() already determined it's the right target
+ if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) {
oldType = event.type;
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
<html>
<head>
<title>Hover tests</title>
-<script src="http://code.jquery.com/jquery-1.6.2.js" type='text/javascript'></script>
+<script src="../dist/jquery.js" type='text/javascript'></script>
<style>
/* Remove body dimensions so we can test enter/leave to surrounding browser chrome */
body, html {