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

Fixes #12956 - Improve cloneFixAttributes function #1034

Closed
wants to merge 2 commits into from

Conversation

markelog
Copy link
Member

Events bounded via addEventListener will not be cloned in IE, events bounded via attachEvent will, but in IE9-10, jQuery does not use attachEvent method and even if it did, clear(merge)Attributes hack would not work for those events anyway.

So for new IE, there is no reason to use this hack.

Expando property is not cloned in IE9-10 and it might not exist at all, but removeAttribute method is expensive to use, it would be better to check for existence of expando before trying to remove it.

I would perform clear(merge)Attributes hack only if expando property is exist, but it would affect user events bounded via attachEvent, i'm wondering - is it a real issue?

/cc @dmethvin

@dmethvin
Copy link
Member

This makes sense too. We only want to use the clearAttributes/mergeAttributes junk on oldIE.

@markelog
Copy link
Member Author

@dmethvin

We only want to use the clearAttributes/mergeAttributes junk on oldIE

Do you?

From where i'm standing this is not true. If so, and this –

but it would affect user events bounded via attachEvent, i'm wondering - is it a real issue?

is not a problem, you can eliminate clear(merge)Attributes hack altogether, by using detachEvent,
which will speed up cloning process and solve #9646.

@dmethvin
Copy link
Member

For IE9 and higher, we use addEventListener for our own needs, so we don't need it there. It's possible that someone is using attachEvent on their own elements in IE and then cloning the element, is that the case you were concerned about? That is really undefined territory. Anything attached directly with either attachEvent or addEventListener is basically something the user would need to worry about.

@rwaldron
Copy link
Member

Two things... First, is there a ticket for this? Second, the patch needs to be rebased—Thanks! :)

@markelog
Copy link
Member Author

@rwldrn

First

No, do you need one?

Second

Wait a bit, i will rebase shortly

@rwaldron
Copy link
Member

No, do you need one?

We've been over this, yes, please make tickets for bugs/features/changes... everything

@markelog
Copy link
Member Author

We've been over this, yes, please make tickets for bugs/features/changes... everything

Yeah, we did, many times, but i ask because your policy often changes, and sometimes, you push commits without tickets... So, as i understand – de jure i have to, but not de facto.

@markelog
Copy link
Member Author

#12956

@rwaldron
Copy link
Member

If you're referring to 4fed8eb, @Krinkle and I discussed this in person and the change itself is trivial.

This still needs to be rebased.

@markelog
Copy link
Member Author

If you're referring to 4fed8eb, @Krinkle and I discussed this in person and the change itself is trivial.

By "you" i did not mean you specifically, i mean team does this – 1, 2, 3, 4...

This still needs to be rebased.

Before i do, i want to try couple of things with this code.

@rwaldron
Copy link
Member

  1. Doesn't change any jQuery source
  2. Doesn't change any jQuery source
  3. @dmethvin is the leader of the project and has more understanding of the entire code base then anyone else in the world.
  4. I agree that this should've had a ticket.

@markelog
Copy link
Member Author

Doesn't change any jQuery source

So?

@dmethvin is the leader of the project and has more understanding of the entire code base then anyone else in the world.

And?

These examples are not the only one, but never mind, i can create tickets if you like.

@markelog
Copy link
Member Author

@rwldrn Although, if issue is purely with code it would be nice if it was discussed only at github, it's tediously to converse in different places

@rwaldron
Copy link
Member

"Github Issues" is inadequate for our needs. I'm not interested in arguing about this any further.

@dmethvin
Copy link
Member

I'm not sure what is being argued, but @Orkel has been working on some of these tickets for a while. They just got tangled up with some other pull requests in the same vicinity.

@markelog
Copy link
Member Author

This still needs to be rebased.

done.

It's possible that someone is using attachEvent on their own elements in IE and then cloning the element, is that the case you were concerned about?

Yep.

Anything attached directly with either attachEvent or addEventListener is basically something the user would need to worry about.

OK, then let's try new approach, i added more tests, just in case.

@dmethvin
Copy link
Member

So what should we do with gh-1036? Do you want to rebase that after this lands?

@markelog
Copy link
Member Author

@dmethvin

Do you want to rebase that after this lands?

or vice-versa, whatever you decide...

@mikesherov
Copy link
Member

@jquerybot retest

leoken pushed a commit to leoken/jquery that referenced this pull request Dec 10, 2012
Fixes issue in non IE browsers that happen to come down this path
@dmethvin dmethvin closed this in 93e1892 Dec 12, 2012
mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
Fixes issue in non IE browsers that happen to come down this path
mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants