1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:37:34 +00:00

LibWeb: Treat invalid StyleValues that included var() as unset

This means StyleComputer::resolve_unresolved_style_value() always
returns a value, so we can change its return type.

However, it does still return an UnresolvedStyleValue sometimes, so we
can't remove those checks from the user code.
This commit is contained in:
Sam Atkins 2023-08-26 12:08:07 +01:00 committed by Sam Atkins
parent 6b66e80fb8
commit 240ec9aeed
5 changed files with 28 additions and 21 deletions

View file

@ -0,0 +1,5 @@
<!doctype html><style>
div {
color: black;
}
</style><div>This text should be black.

View file

@ -0,0 +1,6 @@
<!doctype html><style>
div {
color: red;
color: var(--wat);
}
</style><div>This text should be black.

View file

@ -3,6 +3,7 @@
"css-any-link-selector.html": "css-any-link-selector-ref.html",
"css-gradient-currentcolor.html": "css-gradient-currentcolor-ref.html",
"css-gradients.html": "css-gradients-ref.html",
"css-invalid-var.html": "css-invalid-var-ref.html",
"css-lang-selector.html": "css-lang-selector-ref.html",
"css-local-link-selector.html": "css-local-link-selector-ref.html",
"css-placeholder-shown-selector.html": "css-placeholder-shown-selector-ref.html",