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

Commit 35adade

Browse files
committed
test(sortedHtml): ignore bogus rowspan=1 and colspan=1 in IE
1 parent 86b33eb commit 35adade

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

test/testabilityPatch.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,19 @@ function sortedHtml(element, showNgClass) {
162162
attr.name !='style' &&
163163
attr.name.substr(0, 6) != 'jQuery') {
164164
// in IE we need to check for all of these.
165-
if (!/ng-\d+/.exec(attr.name) &&
166-
attr.name != 'getElementById' &&
165+
if (/ng-\d+/.exec(attr.name) ||
166+
attr.name == 'getElementById' ||
167167
// IE7 has `selected` in attributes
168-
attr.name !='selected' &&
168+
attr.name == 'selected' ||
169169
// IE7 adds `value` attribute to all LI tags
170-
(node.nodeName != 'LI' || attr.name != 'value'))
171-
attrs.push(' ' + attr.name + '="' + attr.value + '"');
170+
(node.nodeName == 'LI' && attr.name == 'value') ||
171+
// IE8 adds bogus rowspan=1 and colspan=1 to TD elements
172+
(node.nodeName == 'TD' && attr.name == 'rowSpan' && attr.value == '1') ||
173+
(node.nodeName == 'TD' && attr.name == 'colSpan' && attr.value == '1')) {
174+
continue;
175+
}
176+
177+
attrs.push(' ' + attr.name + '="' + attr.value + '"');
172178
}
173179
}
174180
attrs.sort();

0 commit comments

Comments
 (0)