Skip to content

Commit 5d2bb2c

Browse files
committed
test(sortedHtml): ignore bogus rowspan=1 and colspan=1 in IE
1 parent 9039ddb commit 5d2bb2c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

test/testabilityPatch.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,19 @@ function sortedHtml(element, showNgClass) {
133133
attr.name !='style' &&
134134
attr.name.substr(0, 6) != 'jQuery') {
135135
// in IE we need to check for all of these.
136-
if (!/ng-\d+/.exec(attr.name) &&
137-
attr.name != 'getElementById' &&
136+
if (/ng-\d+/.exec(attr.name) ||
137+
attr.name == 'getElementById' ||
138138
// IE7 has `selected` in attributes
139-
attr.name !='selected' &&
139+
attr.name == 'selected' ||
140140
// IE7 adds `value` attribute to all LI tags
141-
(node.nodeName != 'LI' || attr.name != 'value'))
142-
attrs.push(' ' + attr.name + '="' + attr.value + '"');
141+
(node.nodeName == 'LI' && attr.name == 'value') ||
142+
// IE8 adds bogus rowspan=1 and colspan=1 to TD elements
143+
(node.nodeName == 'TD' && attr.name == 'rowSpan' && attr.value == '1') ||
144+
(node.nodeName == 'TD' && attr.name == 'colSpan' && attr.value == '1')) {
145+
continue;
146+
}
147+
148+
attrs.push(' ' + attr.name + '="' + attr.value + '"');
143149
}
144150
}
145151
attrs.sort();

0 commit comments

Comments
 (0)