mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17:35 +00:00
Tests/LibWeb: Add some text tests for 'parsing a legacy color value'
I was not aware of this framework back when implementing this back in
bc54560e59
. Add in some basic tests for
this now that we are compliant with the specification.
This commit is contained in:
parent
59cab85002
commit
a9e37be7a0
2 changed files with 32 additions and 0 deletions
24
Tests/LibWeb/Text/input/css/legacy-color-value.html
Normal file
24
Tests/LibWeb/Text/input/css/legacy-color-value.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
function checkColor(color) {
|
||||
document.body.bgColor = color;
|
||||
const computedStyle = getComputedStyle(document.body);
|
||||
const bgcolor = computedStyle.backgroundColor;
|
||||
println(`'${color}' => ${bgcolor}`);
|
||||
}
|
||||
|
||||
for (color of [
|
||||
"red",
|
||||
"#408080",
|
||||
"transparent",
|
||||
" GreeN ",
|
||||
"cafe",
|
||||
"",
|
||||
"deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", // longer than 128 chars of hex
|
||||
"#emoji above U+FFFF 🙃",
|
||||
]) {
|
||||
checkColor(color);
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue