serenity/Tests/LibWeb/Ref/css-attr-typed-fallback.html
Timothy Flynn bf1c82724f 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.
2024-04-17 07:13:26 +02:00

31 lines
744 B
HTML

<!doctype html>
<link rel="match" href="reference/css-attr-typed-ref.html" />
<style>
div {
width: 100px;
height: 20px;
border: 1px solid black;
}
.string::before {
content: attr(foo string, "WHF!");
}
.string-no-fallback::before {
content: attr(foo string);
}
.length {
width: attr(foo length, 200px);
}
.px {
width: attr(foo px, 200px);
}
.color {
background-color: attr(foo color, lime);
}
</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>
<div class="color" foo="rgb(0,0,0)"></div>