From d0edc117045eb1252116e64a1df5c094ab6c2c54 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Fri, 17 Jun 2011 22:48:22 +0200 Subject: Fix failing unit tests in IE7 (Binder, select widget) The fix does not change any production code, we only need to ignore couple of attributes that IE7 should not display: * value attribute for LI * selected attribut for SELECT Simplified condition in compiler test, this should have been part of f9f0905f4ad7b1d0bb9b606a6d25fb1f88354a78 --- test/CompilerSpec.js | 2 +- test/testabilityPatch.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js index 7e636ec1..95f0be4c 100644 --- a/test/CompilerSpec.js +++ b/test/CompilerSpec.js @@ -40,7 +40,7 @@ describe('compiler', function(){ compiler.compile('
A
'); }).toThrow("Cannot compile multiple element roots: " + ie("
A
")); function ie(text) { - return msie && msie < 9 ? uppercase(text) : text; + return msie < 9 ? uppercase(text) : text; } }); diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 121d6900..b44a2dac 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -223,7 +223,12 @@ function sortedHtml(element, showNgClass) { attr.name !='style' && attr.name.substr(0, 6) != 'jQuery') { // in IE we need to check for all of these. - if (!/ng-\d+/.exec(attr.name) && attr.name != 'getElementById') + if (!/ng-\d+/.exec(attr.name) && + attr.name != 'getElementById' && + // IE7 has `selected` in attributes + attr.name !='selected' && + // IE7 adds `value` attribute to all LI tags + (node.nodeName != 'LI' || attr.name != 'value')) attrs.push(' ' + attr.name + '="' + attr.value + '"'); } } -- cgit v1.2.3