mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
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 f9f0905f4a
This commit is contained in:
parent
f9f0905f4a
commit
d0edc11704
2 changed files with 7 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ describe('compiler', function(){
|
|||
compiler.compile('<div>A</div><span></span>');
|
||||
}).toThrow("Cannot compile multiple element roots: " + ie("<div>A</div><span></span>"));
|
||||
function ie(text) {
|
||||
return msie && msie < 9 ? uppercase(text) : text;
|
||||
return msie < 9 ? uppercase(text) : text;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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 + '"');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue