From a97c04436195b02300d403530db44b434b651c94 Mon Sep 17 00:00:00 2001 From: Juriy Zaytsev Date: Fri, 20 Mar 2009 16:24:13 -0400 Subject: [PATCH] Remove sniffing from one of the DOM tests, making it pass in IE8. --- CHANGELOG | 2 ++ test/unit/dom_test.js | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index dda73b2..736fe7a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Remove sniffing from one of the DOM tests, which produced failures in IE8 (kangax) + * Fix `Form.reset` test where `respondsTo` wouldn't detect a method due to typeof returning "object" (rather than "function") in IE (kangax) * Remove Array#reduce which currently overrides native `reduce` in clients implementing JS1.8, e.g. Firefox 3+ (Tobie Langel, Andrew Dupont, kangax) diff --git a/test/unit/dom_test.js b/test/unit/dom_test.js index 3b6cd57..b38f748 100644 --- a/test/unit/dom_test.js +++ b/test/unit/dom_test.js @@ -73,7 +73,15 @@ new Test.Unit.Runner({ this.assertElementsMatch(document.getElementsByClassName('A'), 'p.A', 'ul#class_names_ul.A', 'li.A.C'); - if (Prototype.Browser.IE) + + var isElementPrototypeSupported = (function(){ + var el = document.createElement('div'); + var result = typeof el.show != 'undefined'; + el = null; + return result; + })(); + + if (!isElementPrototypeSupported) this.assertUndefined(document.getElementById('unextended').show); this.assertElementsMatch(div.getElementsByClassName('B'), 'ul#class_names_ul.A.B', 'div.B.C.D'); @@ -95,7 +103,8 @@ new Test.Unit.Runner({ this.assertElementsMatch(list.getElementsByClassName({})); // those lookups shouldn't have extended all nodes in document - if (Prototype.Browser.IE) this.assertUndefined(document.getElementById('unextended')['show']); + if (!isElementPrototypeSupported) + this.assertUndefined(document.getElementById('unextended')['show']); }, testElementInsertWithHTML: function() {