mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
LibWeb: Add HTMLPreElement width property
This commit is contained in:
parent
2e8ff1855c
commit
089a98607c
5 changed files with 54 additions and 1 deletions
3
Tests/LibWeb/Text/expected/HTML/pre-width.txt
Normal file
3
Tests/LibWeb/Text/expected/HTML/pre-width.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
1. 20
|
||||
2. 0
|
||||
3. 0
|
29
Tests/LibWeb/Text/input/HTML/pre-width.html
Normal file
29
Tests/LibWeb/Text/input/HTML/pre-width.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let testCounter = 1;
|
||||
function testPart(part) {
|
||||
println(`${testCounter++}. ${JSON.stringify(part())}`);
|
||||
}
|
||||
|
||||
// 1. Set the pre element width attributes
|
||||
testPart(() => {
|
||||
const pre = document.createElement('pre');
|
||||
pre.width = 20;
|
||||
return pre.width;
|
||||
});
|
||||
|
||||
// 2. Set the pre element width attributes with invalid data
|
||||
testPart(() => {
|
||||
const pre = document.createElement('pre');
|
||||
pre.width = 'dsafds';
|
||||
return pre.width;
|
||||
});
|
||||
|
||||
// 3. Get the pre element width attribute default value
|
||||
testPart(() => {
|
||||
const pre = document.createElement('pre');
|
||||
return pre.width;
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue