1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibWeb: Throw exception if any canvas radial gradient radius is < 0

As per the specification:
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createradialgradient
This commit is contained in:
MacDue 2023-01-28 00:05:10 +00:00 committed by Linus Groh
parent 8dc4e05ecf
commit f86b66dc2d
3 changed files with 10 additions and 3 deletions

View file

@ -16,7 +16,7 @@ class CanvasGradient final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(CanvasGradient, Bindings::PlatformObject);
public:
static JS::NonnullGCPtr<CanvasGradient> create_radial(JS::Realm&, double x0, double y0, double r0, double x1, double y1, double r1);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<CanvasGradient>> create_radial(JS::Realm&, double x0, double y0, double r0, double x1, double y1, double r1);
static JS::NonnullGCPtr<CanvasGradient> create_linear(JS::Realm&, double x0, double y0, double x1, double y1);
static JS::NonnullGCPtr<CanvasGradient> create_conic(JS::Realm&, double start_angle, double x, double y);