Modify ↓
Ticket #9672 (closed bug: wontfix)
Access to event.relatedTarget causes "Permission denied" exception in Firefox 3.5.x
| Reported by: | sereda | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | event | Version: | 1.6.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When jQuery handles mouseenter/mouseleave events and accesses relatedTarget property, it may cause permission exception in Firefox 3.5.x. (Tested on 3.5.7)
This happens when the relatedTarget is a XUL elemented inserted into DOM - like a scrollbar (not sure how it works exactly).
This is similar to other bugs like #4469, and jQuery has some workaround code (for example, at "var withinElement" near line 3161 @ version 1.6.1) for some cases, however, the following sample code still throws exceptions.
Reproduction sequence:
- Open code snippet below on Firefox 3.5.7.
- Move mouse over yellow area and then over to a scrollbar.
- The exception in the console says "Permission denied to access property 'nodeType' from a non-chrome context if ( selector.nodeType ) {"
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
<script>
$(function() {
window.onerror = function(e) { window.alert(e); };
var i = 0;
$('body').delegate('div', 'mouseleave', function() {
$("#info").val(++i);
});
});
</script>
</head>
<body>
<input type="text" id="info">
<div style="overflow: scroll; height: 100px; width: 300px" id="x">
<div id="y" style="background: #ffc; height: 100px; width: 300px"></div>
</div>
</body>
</html>
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

jsFiddle: http://jsfiddle.net/bnVML/1/