Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 259c2bb

Browse files
committed
last failing ie test remaining
1 parent 47ec218 commit 259c2bb

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
lines changed

src/Compiler.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,15 @@ function eachNode(element, fn){
182182
}
183183

184184
function eachAttribute(element, fn){
185-
var i, attrs = element[0].attributes || [], chld, attr, attrValue = {};
185+
var i, attrs = element[0].attributes || [], chld, attr, name, value, attrValue = {};
186186
for (i = 0; i < attrs.length; i++) {
187187
attr = attrs[i];
188-
attrValue[attr.name] = attr.value;
188+
name = attr.name;
189+
value = attr.value;
190+
if (msie && name == 'href') {
191+
value = decodeURIComponent(element[0].getAttribute(name, 2));
192+
}
193+
attrValue[name] = value;
189194
}
190195
foreachSorted(attrValue, fn);
191196
}

src/jqLite.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ function jqClearData(element) {
2929
removeEventListener(element, type, fn);
3030
});
3131
delete jqCache[cacheId];
32-
delete element[jqName];
32+
if (msie)
33+
element[jqName] = ''; // ie does not allow deletion of attributes on elements.
34+
else
35+
delete element[jqName];
3336
}
3437
}
3538

src/markups.js

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ angularTextMarkup('{{}}', function(text, textNode, parentElement) {
4343
} else {
4444
newElement = self.text(text);
4545
}
46+
if (msie && text.charAt(0) == ' ') {
47+
newElement = jqLite('<span>&nbsp;</span>');
48+
var nbsp = newElement.html();
49+
newElement.text(text.substr(1));
50+
newElement.html(nbsp + newElement.html());
51+
}
4652
cursor.after(newElement);
4753
cursor = newElement;
4854
});

test/BinderTest.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ BinderTest.prototype.setUp = function(){
1616
};
1717

1818
BinderTest.prototype.tearDown = function(){
19-
if (this.element && this.element.dealoc) this.element.dealoc();
19+
if (this.element && this.element.dealoc) {
20+
this.element.dealoc();
21+
}
2022
};
2123

2224

@@ -100,8 +102,8 @@ BinderTest.prototype.testBindingSpaceConfusesIE = function() {
100102
'<b><span ng-bind="a"></span><span>'+nbsp+'</span><span ng-bind="b"></span></b>',
101103
this.compileToHtml("<b>{{a}} {{b}}</b>"));
102104
assertEquals(
103-
'<span ng-bind="A"></span><span>'+nbsp+'x </span><span ng-bind="B"></span><span>'+nbsp+'(</span><span ng-bind="C"></span>',
104-
this.compileToHtml("{{A}} x {{B}} ({{C}})"));
105+
'<b><span ng-bind="A"></span><span>'+nbsp+'x </span><span ng-bind="B"></span><span>'+nbsp+'(</span><span ng-bind="C"></span>)</b>',
106+
this.compileToHtml("<b>{{A}} x {{B}} ({{C}})</b>"));
105107
};
106108

107109
BinderTest.prototype.testBindingOfAttributes = function() {
@@ -586,13 +588,13 @@ BinderTest.prototype.testItShouldSelectTheCorrectRadioBox = function() {
586588
var female = jqLite(c.node[0].childNodes[0]);
587589
var male = jqLite(c.node[0].childNodes[1]);
588590

589-
trigger(female, 'click');
591+
female.trigger('click');
590592
assertEquals("female", c.scope.sex);
591593
assertEquals(true, female[0].checked);
592594
assertEquals(false, male[0].checked);
593595
assertEquals("female", female.val());
594596

595-
trigger(male, 'click');
597+
male.trigger('click');
596598
assertEquals("male", c.scope.sex);
597599
assertEquals(false, female[0].checked);
598600
assertEquals(true, male[0].checked);

test/testabilityPatch.js

-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ extend(angular, {
2727
});
2828

2929

30-
function trigger(element, type) {
31-
var evnt = document.createEvent('MouseEvent');
32-
evnt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
33-
(element[0] || element).dispatchEvent(evnt);
34-
}
35-
3630
function sortedHtml(element) {
3731
var html = "";
3832
foreach(element, function toString(node) {

0 commit comments

Comments
 (0)