LibWeb: Validate literal numeric values at parse time

This brings a couple of advantages:
 - Previously we relied on the caller validating the parsed value was in
   bounds after the fact - this was usually fine but there are a couple
   of places that it was forgotten (see the tests added in this commit),
   requiring the bounds to be passed as arguments makes us consider the
   desired range more explicitly.
 - In a future commit we will use the passed bounds as the clamping
   bounds for computed values, removing the need for the existing
   `ValueParsingContext` based method we have at the moment.
 - Generating code is easier with this approach
This commit is contained in:
Callum Law
2026-04-16 14:15:53 +12:00
committed by Sam Atkins
parent ca1b433d27
commit 76250ba142
Notes: github-actions[bot] 2026-04-22 13:25:26 +00:00
12 changed files with 346 additions and 443 deletions

View File

@@ -0,0 +1,15 @@
<!doctype html>
<style>
#foo {
border-top-left-radius: -1px;
border-top-right-radius: 1px -1px;
border-bottom-right-radius: -1px 1px;
border-bottom-left-radius: -1px -1px;
}
</style>
<script src="../include.js"></script>
<script>
test(() => {
println(document.styleSheets[0].cssRules[0].cssText);
});
</script>