Side navigation
#6865 closed bug (invalid)
Opened August 03, 2010 05:32PM UTC
Closed August 04, 2010 12:38AM UTC
Last modified June 02, 2011 03:03AM UTC
Firefox - infinite loop: 'elem.ownerDocument.defaultView' is null
Reported by: | smitka | Owned by: | |
---|---|---|---|
Priority: | Milestone: | 1.4.3 | |
Component: | unfiled | Version: | 1.4.2 |
Keywords: | firefox loop | Cc: | |
Blocked by: | Blocking: |
Description
Some plugins (eg. PrettyPhoto) cause an infinite loop of errors in Firefox (tested on 3.6.4 and 3.6.8).
The problem is on line 4691 (jquery-1.4.2.js):
var defaultView = elem.ownerDocument.defaultView;
if ( !defaultView ) {
return null;
}
var computedStyle = defaultView.getComputedStyle( elem, null );
There must be a test if elem.ownerDocument is not null.
Simple workaround is to rewrite code to:
var defaultView = elem.ownerDocument;
if ( !defaultView ) {
return null;
}
defaultView=defaultView.defaultView;
if ( !defaultView ) {
return null;
}
var computedStyle = defaultView.getComputedStyle( elem, null );
Please reopen with a test case. It sounds like the plugins may be passing invalid information to jQuery methods. If so, the proposed fix will mask those errors and make it harder to debug the code on the page.