|
44 | 44 | assert_equals(selectedOption.innerHTML, optionTwo.innerHTML,
|
45 | 45 | 'The innerHTML of <selectedoption> should change after the selected option is changed.');
|
46 | 46 |
|
| 47 | + let oldInnerHTML = optionTwo.innerHTML; |
47 | 48 | spanTwo.textContent = 'new span';
|
48 | 49 | await new Promise(queueMicrotask);
|
49 |
| - assert_equals(selectedOption.innerHTML, optionTwo.innerHTML, |
50 |
| - '<selectedoption> should respond to text content changes.'); |
| 50 | + assert_equals(selectedOption.innerHTML, oldInnerHTML, |
| 51 | + '<selectedoption> should not respond to <option> text content changes.'); |
51 | 52 |
|
52 | 53 | spanTwo.appendChild(document.createElement('div'));
|
53 | 54 | await new Promise(queueMicrotask);
|
54 |
| - assert_equals(selectedOption.innerHTML, optionTwo.innerHTML, |
55 |
| - '<selectedoption> should respond to new elements being added to descendants.'); |
| 55 | + assert_equals(selectedOption.innerHTML, oldInnerHTML, |
| 56 | + '<selectedoption> should not respond to new elements being added to descendants of <option>.'); |
56 | 57 |
|
57 | 58 | spanTwo.setAttribute('data-foo', 'bar');
|
58 | 59 | await new Promise(queueMicrotask);
|
59 |
| - assert_equals(selectedOption.innerHTML, optionTwo.innerHTML, |
60 |
| - '<selectedoption> should respond to attributes being added to descendants.'); |
| 60 | + assert_equals(selectedOption.innerHTML, oldInnerHTML, |
| 61 | + '<selectedoption> should not respond to attributes being added to descendants of <option>.'); |
61 | 62 |
|
62 | 63 | form.reset();
|
63 | 64 | await new Promise(queueMicrotask);
|
|
90 | 91 | optionOne.remove();
|
91 | 92 | assert_equals(selectedOption.innerHTML, '',
|
92 | 93 | 'The content of <selectedoption> should be cleared if there is no selected <option>.');
|
| 94 | + |
| 95 | + // TODO(crbug.com/336844298): Add tests for mutation records during parsing |
93 | 96 | }, 'The <selectedoption> element should reflect the HTML contents of the selected <option>.');
|
94 | 97 | </script>
|
0 commit comments