Opened 9 years ago
Closed 8 years ago
#15104 closed bug (migrated)
.clone copies non-scalar properties, including the Sizzle cache
Reported by: | Jogi | Owned by: | gibson042 |
---|---|---|---|
Priority: | blocker | Milestone: | 1.12 |
Component: | manipulation | Version: | 1.11.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Issue with space in selector with jquery 1.11.1 and Internet explorer.
exemple:
$(".testCls [name='blabla']")
cannot find anything when with older version, it work.
jsfiddle: http://jsfiddle.net/kwfHZ/1/
Change History (13)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Owner: | set to Jogi |
---|---|
Status: | new → pending |
Your examples seem to be working correctly. Can you describe what you're trying to do, what behavior you're expecting, and what behavior you're seeing?
comment:4 Changed 9 years ago by
Status: | pending → new |
---|
0k So there is my case:
I don't understand why on IE8:
$("#tblMF .numasaCmp_1 [name='NUMASA_CMP']") => undefined
but $("#tblMF .numasaCmp_1").find("[name='NUMASA_CMP']") => works
On Firefox, both works.
comment:5 Changed 9 years ago by
Status: | new → pending |
---|
We'll need something more reduced than 1.4 KB of HTML plus a script unrelated to this issue.
comment:7 Changed 9 years ago by
i See one more thing, if i remove the line with .prop("disabled", false) , my selector works correclty.
comment:8 Changed 9 years ago by
other observation:
$("#tblMF .numasaCmp_1 [name='NUMASA_CMP']") => undefined
but $("#tblAA .numasaCmp_1 [name='NUMASA_CMP']") => work
comment:9 Changed 9 years ago by
Owner: | changed from Jogi to gibson042 |
---|---|
Status: | new → assigned |
I removed superfluous markup and script from your fiddle and changed .val()
to .length
for better insight: http://jsfiddle.net/JTtu3/57/
There is something to this that seems to be related to Sizzle combinator caching in oldIE.
comment:10 Changed 9 years ago by
Same problem with ":input" instead of [name...]
$(".nonStructAssetTemplate :input").length == 0
$(".nonStructAssetTemplate").find(":input").length != 0
comment:11 Changed 9 years ago by
This is actually a problem with .clone
: http://jsfiddle.net/JTtu3/59/
In IE8 (and other versions as well, I'm sure), the clone still has a reference to the Sizzle cache object of its referent, which wreaks all kinds of havoc with any operation using it. Maybe we can update fixCloneNodeIssues
to look for and remove attributes associated with reference-equal clone/source properties.
comment:12 Changed 8 years ago by
Component: | selector → manipulation |
---|---|
Milestone: | None → 1.12 |
Summary: | Space in selector problem → .clone copies non-scalar properties, including the Sizzle cache |
comment:13 Changed 8 years ago by
Resolution: | → migrated |
---|---|
Status: | assigned → closed |
Migrated to https://github.com/jquery/jquery/issues/1709
wrong jsfiddle http://jsfiddle.net/kwfHZ/3/
i'm trying to reproduce my case correctly ...