From 09fa9df4809dcd7527a36d86c0688a58436bb289 Mon Sep 17 00:00:00 2001 From: Kuzminov Aleksandr Sergeevich Date: Sun, 30 Nov 2014 14:17:09 +0300 Subject: [PATCH 1/3] #10259 fix ng-mouseenter in IE9-11 --- src/jqLite.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jqLite.js b/src/jqLite.js index 9670341bcba0..d3894fea7c03 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -784,6 +784,10 @@ forEach({ handle = expandoStore.handle = createEventHandler(element, events); } + var contains = Node.prototype.contains || function (node, arg) { + return !!(node.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(target, related))) { handle(event, type); } }); From b1c3cfa7626cee81af0fba7f16a5fdb76479c349 Mon Sep 17 00:00:00 2001 From: Kuzminov Aleksandr Sergeevich Date: Sun, 30 Nov 2014 14:25:39 +0300 Subject: [PATCH 2/3] #10259 fix ng-mouseenter in IE9-11 --- src/jqLite.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jqLite.js b/src/jqLite.js index d3894fea7c03..d830375ad831 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -784,8 +784,8 @@ forEach({ handle = expandoStore.handle = createEventHandler(element, events); } - var contains = Node.prototype.contains || function (node, arg) { - return !!(node.compareDocumentPosition(arg) & 16); + var contains = Node.prototype.contains || function (arg) { + return !!(this.compareDocumentPosition(arg) & 16); }; // http://jsperf.com/string-indexof-vs-split @@ -808,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 && !contains(target, related))) { + if (!related || (related !== target && !contains.call(target, related))) { handle(event, type); } }); From f6700d3357ea72a9ce533447e509d9f29747adaf Mon Sep 17 00:00:00 2001 From: Kuzminov Aleksandr Sergeevich Date: Tue, 2 Dec 2014 12:17:46 +0300 Subject: [PATCH 3/3] Add comment --- src/jqLite.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jqLite.js b/src/jqLite.js index d830375ad831..586d316af140 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -784,6 +784,7 @@ forEach({ handle = expandoStore.handle = createEventHandler(element, events); } + // IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259. var contains = Node.prototype.contains || function (arg) { return !!(this.compareDocumentPosition(arg) & 16); };