LibWeb: Fail CSS color parse for "rgba(123, 123, 123, "
This matches the behavior of other browsers and fixes a WPT test.
This commit is contained in:
parent
4590c081c2
commit
902586a21d
Notes:
github-actions[bot]
2024-10-04 18:02:20 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/902586a21de Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1629
3 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
#008000
|
||||
#008000
|
|
@ -0,0 +1,12 @@
|
|||
<script src="../include.js"></script>
|
||||
<canvas id="c" width=300 height=300></canvas>
|
||||
<script>
|
||||
test(() => {
|
||||
let x = c.getContext("2d");
|
||||
x.fillStyle = 'green';
|
||||
println(x.fillStyle);
|
||||
x.fillStyle = 'rgba(255, 0, 0, ';
|
||||
println(x.fillStyle);
|
||||
c.remove();
|
||||
});
|
||||
</script>
|
|
@ -2848,6 +2848,9 @@ RefPtr<CSSStyleValue> Parser::parse_rgb_color_value(TokenStream<ComponentValue>&
|
|||
|
||||
alpha = parse_number_percentage_value(inner_tokens);
|
||||
|
||||
if (!alpha)
|
||||
return {};
|
||||
|
||||
inner_tokens.skip_whitespace();
|
||||
|
||||
if (inner_tokens.has_next_token())
|
||||
|
|
Loading…
Add table
Reference in a new issue