Skip to main content

Bug Tracker

Side navigation

#15104 closed bug (migrated)

Opened May 21, 2014 09:43AM UTC

Closed October 16, 2014 06:01PM UTC

.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/

Attachments (0)
Change History (13)

Changed May 21, 2014 10:00AM UTC by Jogi comment:1

wrong jsfiddle

http://jsfiddle.net/kwfHZ/3/

i'm trying to reproduce my case correctly ...

Changed May 21, 2014 11:33AM UTC by gibson042 comment:2

owner: → Jogi
status: newpending

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?

Changed May 21, 2014 11:34AM UTC by gibson042 comment:3

#15103 is a duplicate of this ticket.

Changed May 26, 2014 12:43PM UTC by Jogi comment:4

status: pendingnew

0k So there is my case:

http://jsfiddle.net/xorkk/JTtu3/

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.

Changed May 26, 2014 02:50PM UTC by gibson042 comment:5

status: newpending

We'll need something more reduced than 1.4 KB of HTML plus a script unrelated to this issue.

Changed May 26, 2014 03:23PM UTC by Jogi comment:6

_comment0: Ok i've reduce the exemple: \ \ http://jsfiddle.net/xorkk/JTtu3/1401119617437666
status: pendingnew

Ok i've reduced the exemple:

http://jsfiddle.net/xorkk/JTtu3/

Changed May 26, 2014 03:25PM UTC by Jogi comment:7

i See one more thing,

if i remove the line with .prop("disabled", false) , my selector works correclty.

Changed May 26, 2014 03:31PM UTC by Jogi comment:8

other observation:

$("#tblMF .numasaCmp_1 [name='NUMASA_CMP']") => undefined

but $("#tblAA .numasaCmp_1 [name='NUMASA_CMP']") => work

Changed May 26, 2014 06:12PM UTC by gibson042 comment:9

owner: Jogigibson042
status: newassigned

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.

Changed June 24, 2014 03:23PM UTC by Jogi comment:10

_comment0: Same problem with ":input" instead of [name...] \ \ $(".nonStructAssetTemplate :input").length == 0 \ $(".nonStructAssetTemplate").find(":input").length != 01403623672588349

Same problem with ":input" instead of [name...]

$(".nonStructAssetTemplate :input").length == 0

$(".nonStructAssetTemplate").find(":input").length != 0

Changed July 25, 2014 01:53PM UTC by gibson042 comment:11

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''.

Changed September 09, 2014 08:51PM UTC by gibson042 comment:12

component: selectormanipulation
milestone: None1.12
summary: Space in selector problem.clone copies non-scalar properties, including the Sizzle cache

Changed October 16, 2014 06:01PM UTC by m_gol comment:13

resolution: → migrated
status: assignedclosed