Ticket #948 (closed defect: invalid)
Event tries to access .nodeType property of div.anonymos-div in Forefox 3
| Reported by: | Jed | Owned by: | |
|---|---|---|---|
| Type: | defect | Priority: | minor |
| Milestone: | Mootools version 1.2 | Component: | Core |
| Keywords: | Cc: |
Description
Hi,
(this may be related to #474)
Current SVN version of Mootools 1.2 breaks in Firefox 3 when the 'mouseout' event fires on an element that has been hidden, if the element is hidden and a textfield moves to under the cursor.
This would make the target element of the event the textfield, in theory, but Firefox throws the error "Permission denied to get property HTMLDivElement.nodeType".
This may actually be Mozilla's bug, in which case perhaps it should be logged there? I'm using Beta 5, I cannot reproduce it in Firefox 2.
To work around it in MooTools, simply change line 52 of Event.js (the initialize function) to read
while (related && related.nodeType == 3 && related.parentNode.className != 'anonymous-div') related = related.parentNode;
instead of
while (related && related.nodeType == 3) related = related.parentNode;
... possibly not the cleanest, but it does stop errors being thrown...