refactor: add CanGc as argument to methods in CanvasRenderingContext2D and OffscreenCanvasRenderingContext2D (#35732)

Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
Yerkebulan Tulibergenov 2025-03-01 06:45:37 -08:00 committed by GitHub
parent 5fa014d389
commit ce977636f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 17 deletions

View file

@ -173,8 +173,9 @@ impl OffscreenCanvasRenderingContext2DMethods<crate::DomTypeHolder>
y0: Finite<f64>,
x1: Finite<f64>,
y1: Finite<f64>,
can_gc: CanGc,
) -> DomRoot<CanvasGradient> {
self.context.CreateLinearGradient(x0, y0, x1, y1)
self.context.CreateLinearGradient(x0, y0, x1, y1, can_gc)
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createradialgradient
@ -186,8 +187,10 @@ impl OffscreenCanvasRenderingContext2DMethods<crate::DomTypeHolder>
x1: Finite<f64>,
y1: Finite<f64>,
r1: Finite<f64>,
can_gc: CanGc,
) -> Fallible<DomRoot<CanvasGradient>> {
self.context.CreateRadialGradient(x0, y0, r0, x1, y1, r1)
self.context
.CreateRadialGradient(x0, y0, r0, x1, y1, r1, can_gc)
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createpattern
@ -195,8 +198,9 @@ impl OffscreenCanvasRenderingContext2DMethods<crate::DomTypeHolder>
&self,
image: CanvasImageSource,
repetition: DOMString,
can_gc: CanGc,
) -> Fallible<Option<DomRoot<CanvasPattern>>> {
self.context.CreatePattern(image, repetition)
self.context.CreatePattern(image, repetition, can_gc)
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-save