Side navigation
#12314 closed bug (fixed)
Opened August 15, 2012 11:24PM UTC
Closed August 24, 2012 10:08PM UTC
$.contains fatal error in IE9 when 2nd parameter is null
Reported by: | konp | Owned by: | konp |
---|---|---|---|
Priority: | low | Milestone: | 1.8.1 |
Component: | selector | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Summary
Calls to $.contains fail when parameter is null, breaks all scripts.
Reason
The reason for failure is that when element.''compareDocumentPosition'' is called with null in IE9 it returns invalid argument. Returns false in Chrome as expected.
jQuery Version: 1.8.0
Browser: IE9 RTM
jsFiddle: http://jsfiddle.net/Zj8VQ/
Attachments (0)
Change History (4)
Changed August 15, 2012 11:27PM UTC by comment:1
owner: | → konp |
---|---|
status: | new → pending |
Changed August 16, 2012 12:11AM UTC by comment:2
_comment0: | Replying to [comment:1 dmethvin]: \ > 1) Is there some place within jQuery that calls $.contains with the second arg of `null`? Or was this a direct use inside your own code? \ \ From within jQuery UI animations callback to removeWrapper() function - the document.activeElement is used as the second parameter. In IE9, active element can be null (such is the case with certain animations and calls to .blur()). Although I found this bug in jQuery UI, I am considering this a bug in jQuery as it is a breaking change between 1.7.2 and 1.8.0. Again, please look at the same code working with 1.7.2 - http://jsfiddle.net/Zj8VQ/1 \ \ > \ > 2) DO NOT TAUNT HAPPY FUN $.CONTAINS! \ \ SRR \ \ ---- \ \ Either way, the expected behavior should be the same across browsers. → 1345076065521383 |
---|---|
_comment1: | Replying to [comment:1 dmethvin]: \ > 1) Is there some place within jQuery that calls $.contains with the second arg of `null`? Or was this a direct use inside your own code? \ \ From within jQuery UI animations callback to removeWrapper() function - the document.activeElement is used as the second parameter. In IE9, active element can be null (such is the case with certain animations and calls to .blur()). Although I found this bug in jQuery UI, I am considering this a bug in jQuery as it is a breaking change between 1.7.2 and 1.8.0. Again, please look at the same code working with 1.7.2 - http://jsfiddle.net/Zj8VQ/1 \ \ EDIT: In Chrome, activeElement returns body instead of null. \ \ > \ > 2) DO NOT TAUNT HAPPY FUN $.CONTAINS! \ \ SRR \ \ ---- \ \ Either way, the expected behavior should be the same across browsers. → 1345076397337453 |
status: | pending → new |
Replying to [comment:1 dmethvin]:
1) Is there some place within jQuery that calls $.contains with the second arg of null
? Or was this a direct use inside your own code?
From within jQuery UI animations callback to removeWrapper() function - the document.activeElement is used as the second parameter. In IE9, active element can be null (such is the case with certain animations and calls to .blur()). Although I found this bug by using jQuery UI, I am considering this a bug in jQuery as it is a breaking change between 1.7.2 and 1.8.0. Again, please look at the same code working with 1.7.2 - http://jsfiddle.net/Zj8VQ/1
EDIT: In Chrome, activeElement returns body instead of null.
2) DO NOT TAUNT HAPPY FUN $.CONTAINS!
SRR
Either way, the expected behavior should be the same across browsers.
Changed August 21, 2012 12:33AM UTC by comment:3
component: | unfiled → selector |
---|---|
milestone: | None → 1.8.1 |
priority: | undecided → low |
status: | new → open |
1) Is there some place within jQuery that calls $.contains with the second arg of
null
? Or was this a direct use inside your own code?2) DO NOT TAUNT HAPPY FUN $.CONTAINS!