-
Notifications
You must be signed in to change notification settings - Fork 940
Selector: Defend against oldIE cloning caches #328
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
Conversation
|
@gibson042 Sometimes I wonder if this cache code is more than its worth. Have we ever done perf testing focused on how much we gain with dir caching? If we could do away with all of this, we'd resolve the issue and have cleaner code. |
|
I think we have checked, but I can't find anything about it now. As I remember, though, it was highly valuable in precisely the cases one would expect: long-prefix selectors against deep DOM trees (since dir caching shortcuts everything to the left of a combinator when a node is visited multiple times by the same filter). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needless blank line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intentional. The first comment applies broadly, the second only to use of node instead of parent.
|
So to provide other side of the argument, that adds a lot of logic and code, whereas if we would just expose the expando and remove it in core code it would be simple without additional byte hit. This way is more correct, but what we would solve here? |
|
The size difference is negligible (+7 to Sizzle for exposing expando and an additional +7 to jQuery for using it vs. +12 to Sizzle for being inherently cloneNode-safe in oldIE), and The cache data was always supposed to have single-element scope; this just guarantees that cloneNode doesn't violate that intention. |
|
Okay then, i assume we don't need additional tests in core? If so, we can close jquery/jquery#1709 from the latest commit in here? |
|
Correct. |
|
So you would need to change commit message of the last commit? |
|
I don't think so. What did you have in mind? |
|
You know, little stuff, no big deals :-). We have three commits here with identical commit headers, i would either distinguish them more clearly or unite those changes in one commit. And not Also, https://github.com/jquery/sizzle/pull/328/files#r27660499. But that would be fixed either way with jscs at some point, oh and btw, how about we do jquery/jquery#2056 for the sizzle, before releasing the new version? Since code-styles now is changed so much? |
I'll be collapsing them before a merge to master.
I can change it to "Fixes", but jquery/jquery#1709 won't auto-close—and rightly so, since it still exists until jQuery pulls in the change. @jquery/core: thoughts on "Ref" vs. "Fixes" here? As for updating grunt-jscs before release, I think that's feasible. |
|
I'd go with |
Right, but the issue itself is fixed, just in another repo, we could do that when we will update Sizzle, but it has good probability of ignoring this issue or issues like this. If we would follow this logic, we could close jquery tickets (or issues of any other project) only after we would release it. |
The issue is fixed if it's fixed on |
|
I guess better way would be to make it a sizzle issue, not a core one |
This resolves jquery/jquery#1709 by tolerating attroperty cloning, requiring no jQuery changes and reverting gh-310.
@jquery/core & @markelog: thoughts?