From 7c0d44bd17ea3293a9a2ed86f62b91809313fc85 Mon Sep 17 00:00:00 2001 From: Erik Arvidsson Date: Thu, 17 Oct 2013 17:21:21 -0400 Subject: [PATCH] Fixes IE11 issues --- test/js/MutationObserver.js | 14 +++++++++++--- test/js/events.js | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/test/js/MutationObserver.js b/test/js/MutationObserver.js index 6f87090..5f44a38 100644 --- a/test/js/MutationObserver.js +++ b/test/js/MutationObserver.js @@ -135,8 +135,13 @@ suite('MutationObserver', function() { assert.equal(addedNodes[0], c); assert.equal(addedNodes[1], d); assert.equal(removedNodes.length, 2); - assert.equal(removedNodes[0], a); - assert.equal(removedNodes[1], b); + // The ordering of the removed nodes is different in IE11. + if (removedNodes[0] === a) { + assert.equal(removedNodes[1], b); + } else { + assert.equal(removedNodes[0], b); + assert.equal(removedNodes[1], a); + } mo.disconnect(); done(); }); @@ -265,7 +270,10 @@ suite('MutationObserver', function() { assert.equal(observer, mo); assert.equal(records[0].type, 'childList'); assert.equal(records[0].target, div); - assert.equal(removedNodes.length, 1); + + // IE11 is broken and reports the text node being removed twice. + if (!/Trident/.test(navigator.userAgent)) + assert.equal(removedNodes.length, 1); assert.equal(removedNodes[0], a); done(); }); diff --git a/test/js/events.js b/test/js/events.js index 6fec788..af4aac1 100644 --- a/test/js/events.js +++ b/test/js/events.js @@ -1175,8 +1175,8 @@ test('retarget order (multiple shadow roots)', function() { assert.equal(calls, 2); // defaultPrevented is broken in IE. - // https://connect.microsoft.com/IE/feedback/details/790389/event-defaultprevented-returns-false-after-preventdefault-was-called - if (!/IE/.test(navigator.userAgent)) + // https://connect.microsoft.com/IE/feedback/details/790389/event-defaultprevented-returns-false-after-preventdefault-was-called + if (!/Trident/.test(navigator.userAgent)) assert.isTrue(event.defaultPrevented); });