-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename <selectedoption> to <selectedcontent>
This rename was decided here: openui/open-ui#1112 Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
- Loading branch information
1 parent
4537d92
commit d286f2f
Showing
8 changed files
with
87 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...s/forms/the-select-element/customizable-select/selectedcontentelement-attr.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/openui/open-ui/issues/1063"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<select style="appearance:base-select"> | ||
<option class=one value=one>one<span>span</span></option> | ||
<option class=two value=two>two<span>span</span></option> | ||
</select> | ||
<selectedcontent id=myselectedcontent></selectedcontent> | ||
|
||
<script> | ||
promise_test(async () => { | ||
const select = document.querySelector('select'); | ||
const selectedcontent = document.querySelector('selectedcontent'); | ||
const optionOne = document.querySelector('option.one'); | ||
const optionTwo = document.querySelector('option.two'); | ||
|
||
select.setAttribute('selectedcontentelement', 'myselectedcontent'); | ||
assert_equals(selectedcontent.innerHTML, optionOne.innerHTML, | ||
'Setting the selectedcontentelement attribute via setAttribute should synchronously assign the contents of <selectedcontent>.'); | ||
|
||
select.removeAttribute('selectedcontentelement'); | ||
assert_equals(selectedcontent.innerHTML, '', | ||
'Removing the selectedcontentelement attribute via removeAttribute should synchronously clear the contents of the <selectedcontent>.'); | ||
|
||
select.selectedContentElement = selectedcontent; | ||
assert_equals(selectedcontent.innerHTML, optionOne.innerHTML, | ||
'Setting the selectedcontentelement attribute via IDL should synchronously assign the contents of <selectedcontent>.'); | ||
|
||
select.selectedContentElement = null; | ||
assert_equals(selectedcontent.innerHTML, '', | ||
'Removing the selectedcontentelement attribute via IDL should synchronously clear the contents of the <selectedcontent>.'); | ||
|
||
select.selectedContentElement = selectedcontent; | ||
assert_equals(selectedcontent.innerHTML, optionOne.innerHTML, | ||
'Re-setting the selectedcontentelement attribute via IDL should synchronously assign the contents of <selectedcontent>.'); | ||
|
||
let oldInnerHTML = optionOne.innerHTML; | ||
optionOne.querySelector('span').remove(); | ||
await new Promise(queueMicrotask); | ||
assert_equals(selectedcontent.innerHTML, oldInnerHTML, | ||
'Mutating the selected <option> should not update the <selectedcontent> contents.'); | ||
|
||
select.value = 'two'; | ||
assert_equals(selectedcontent.innerHTML, optionTwo.innerHTML, | ||
'Changing which <option> is selected should synchronously update the <selectedcontent> contents.'); | ||
}, 'The selectedcontentelement attribute should set up an association between a select and a selectedcontent.'); | ||
</script> |
50 changes: 0 additions & 50 deletions
50
...cs/forms/the-select-element/customizable-select/selectedoptionelement-attr.tentative.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters