-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Event: Ensure delegation doesn't error on comment nodes #2659
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
|
This was fixed in Sizzle, right? Seems like the test is going to be brittle since these events are deprecated and will be removed eventually. If this is the only text-node event we need to guard against, how about if you add a check for DOMNodeInserted in this unit test before doing the actual test? That way we could do something like |
|
Sizzle still throws on text node input, but 9d820fb in jQuery protects it from seeing them. |
test/unit/event.js
Outdated
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.
The deprecation of DOMNodeInserted event could be addressed by a plan B that uses fireNative to synthesize an event on a comment node.
2e4f9fe to
cb273e5
Compare
|
Added fallback for when DOMNodeInserted is no longer supported. |
test/unit/event.js
Outdated
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.
This should be document.createComment, since we don't assert that jQuery.parseHTML handles comments (and in fact explicitly avoid doing so).
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.
Well, I wouldn't call that explicitly avoiding it, just explicitly accounting for their possible absence, but I forgot that some browsers remove them.
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.
I see, we mean the same thing, I think.
From my preliminary tests, the
DOMNodeInsertedevent is still supported in our supported browsers.Fixes gh-2055