Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Fix #10259 (mouseenter in svg template in IE) #10276

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/jqLite.js
Original file line number Diff line number Diff line change
@@ -784,6 +784,10 @@ forEach({
handle = expandoStore.handle = createEventHandler(element, events);
}

var contains = Node.prototype.contains || function (arg) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment saying this is IE specific

return !!(this.compareDocumentPosition(arg) & 16);
};

// http://jsperf.com/string-indexof-vs-split
var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];
var i = types.length;
@@ -804,7 +808,7 @@ forEach({
var target = this, related = event.relatedTarget;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if (!related || (related !== target && !target.contains(related))) {
if (!related || (related !== target && !contains.call(target, related))) {
handle(event, type);
}
});