mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Disallow random() in canvas context value setters
This introduces two new top-level `ValueParsingContext`s, `OnScreenCanvasContextFontValue` and `CanvasContextGenericValue`, while these are handled the same for now, there is a distinction is whether or not they allow tree counting functions (which will come in a later commit)
This commit is contained in:
Notes:
github-actions[bot]
2026-04-08 13:34:02 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/1fdcea2b7bb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8787 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -295,7 +295,7 @@ void OffscreenCanvasRenderingContext2D::set_shadow_color(String color)
|
||||
// 1. Let context be this's canvas attribute's value, if that is an element; otherwise null.
|
||||
|
||||
// 2. Let parsedValue be the result of parsing the given value with context if non-null.
|
||||
auto style_value = parse_css_value(CSS::Parser::ParsingParams(), color, CSS::PropertyID::Color);
|
||||
auto style_value = parse_css_value(CSS::Parser::ParsingParams { CSS::Parser::SpecialContext::CanvasContextGenericValue }, color, CSS::PropertyID::Color);
|
||||
if (style_value && style_value->has_color()) {
|
||||
auto parsedValue = style_value->to_color({}).value_or(Color::Black);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user