| Index: tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
|
| diff --git a/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
|
| index 34e29bb54ad15732d2ce8c6f2e86c6ebb4d3ff3e..a2a23c6823e390c738df00ea26a971f5c6e791f9 100644
|
| --- a/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
|
| +++ b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
|
| @@ -529,14 +529,33 @@ main() {
|
| "<input id='bad' onmouseover='alert(1)'>",
|
| "");
|
|
|
| - testHtml('tagName makes containing form invalid',
|
| - validator,
|
| - "<form onmouseover='alert(2)'><input name='tagName'>",
|
| - "");
|
| + test('tagName makes containing form invalid', () {
|
| + var fragment = document.body.createFragment(
|
| + "<form onmouseover='alert(2)'><input name='tagName'>",
|
| + validator: validator);
|
| + var form = fragment.lastChild;
|
| + // If the tagName was clobbered, the sanitizer should have removed
|
| + // the whole thing and form is null.
|
| + // If the tagName was not clobbered, then there will be content,
|
| + // but the tagName should be the normal value. IE11 has started
|
| + // doing this.
|
| + if (form != null) {
|
| + expect(form.tagName, 'FORM');
|
| + }
|
| + });
|
|
|
| - testHtml('tagName without mouseover',
|
| - validator,
|
| - "<form><input name='tagName'>",
|
| - "");
|
| + test('tagName without mouseover', () {
|
| + var fragment = document.body.createFragment(
|
| + "<form><input name='tagName'>",
|
| + validator: validator);
|
| + var form = fragment.lastChild;
|
| + // If the tagName was clobbered, the sanitizer should have removed
|
| + // the whole thing and form is null.
|
| + // If the tagName was not clobbered, then there will be content,
|
| + // but the tagName should be the normal value.
|
| + if (form != null) {
|
| + expect(form.tagName, 'FORM');
|
| + }
|
| + });
|
| });
|
| }
|
|
|