LibWeb: Default to an empty string when a string attr substitution fails

When a string-type attr() substitution produces no value and no fallback
had been specified, the spec mandates we default to the empty string.
This commit is contained in:
Timothy Flynn 2024-04-16 12:42:23 -04:00 committed by Andreas Kling
commit bf1c82724f
Notes: sideshowbarker 2024-07-16 23:34:49 +09:00
6 changed files with 34 additions and 10 deletions

View file

@ -9,6 +9,9 @@
.string::before {
content: attr(foo string, "WHF!");
}
.string-no-fallback::before {
content: attr(foo string);
}
.length {
width: attr(foo length, 200px);
}
@ -20,6 +23,7 @@
}
</style>
<div class="string"></div>
<div class="string-no-fallback"></div>
<div class="length" foo="90pizzas"></div>
<div class="px" foo="twohundred"></div>
<div class="color" foo="grunge"></div>