mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
LibWeb: Add textarea value properties
This commit is contained in:
parent
e33ae9a58b
commit
091faf1aae
5 changed files with 105 additions and 9 deletions
39
Tests/LibWeb/Text/input/textarea-value.html
Normal file
39
Tests/LibWeb/Text/input/textarea-value.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let testCounter = 1;
|
||||
function testPart(part) {
|
||||
println(`${testCounter++}. ${JSON.stringify(part())}`);
|
||||
}
|
||||
|
||||
// 1. Textarea get value
|
||||
testPart(() => {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.textContent = 'PASS';
|
||||
return textarea.value;
|
||||
});
|
||||
|
||||
// 2. Textarea set value
|
||||
testPart(() => {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.textContent = 'PASS';
|
||||
textarea.value = 'FAIL';
|
||||
return textarea.textContent;
|
||||
});
|
||||
|
||||
// 3. Textarea set default value
|
||||
testPart(() => {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.textContent = 'FAIL';
|
||||
textarea.defaultValue = 'PASS';
|
||||
return textarea.textContent;
|
||||
});
|
||||
|
||||
// 4. Textarea text length
|
||||
testPart(() => {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.innerHTML = 'PASS';
|
||||
return textarea.textLength;
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue