Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sizzle expando after clone action #1709

Closed
mgol opened this issue Oct 16, 2014 · 15 comments
Closed

Remove sizzle expando after clone action #1709

mgol opened this issue Oct 16, 2014 · 15 comments

Comments

@mgol
Copy link
Member

mgol commented Oct 16, 2014

Originally reported by Jogi: http://bugs.jquery.com/ticket/15104

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/

@mgol mgol added the Bug label Oct 16, 2014
@mgol mgol added this to the 3.0.0 milestone Oct 16, 2014
@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

Jogi:

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

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

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

@gibson042:

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?

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

@gibson042:

http://bugs.jquery.com/ticket/15103 is a duplicate of this ticket.

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

Jogi:

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.

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

@gibson042:

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

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

Jogi:

Ok i've reduced the exemple:

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

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

Jogi:

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

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

Jogi:

other observation:

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

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

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

@gibson042:

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.

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

Jogi:

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

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

@gibson042:

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.

@mgol
Copy link
Member Author

mgol commented Oct 16, 2014

@gibson042:

PR: #1652

@mgol mgol added the 1.x-only label Oct 16, 2014
@dmethvin
Copy link
Member

Per the discussion on gh-1652 we decided there was no good solution but the least bad solution was that we'd clear the Sizzle expando. Is that correct?

@gibson042
Copy link
Member

Correct.

@markelog markelog assigned markelog and unassigned gibson042 Feb 13, 2015
@markelog markelog changed the title .clone copies non-scalar properties, including the sizzle cache Remove sizzle expando after clone action Feb 13, 2015
@markelog
Copy link
Member

markelog commented Mar 8, 2015

@gibson042 please ping me up when you gonna update sizzle

gibson042 added a commit to gibson042/sizzle that referenced this issue Mar 29, 2015
gibson042 added a commit to gibson042/sizzle that referenced this issue Mar 29, 2015
gibson042 added a commit to jquery/sizzle that referenced this issue Apr 10, 2015
timmywil added a commit that referenced this issue Apr 13, 2015
timmywil added a commit that referenced this issue Nov 10, 2015
@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

5 participants