mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
LibWeb: Remove unecessary dependence on Window from HTML classes
These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes.
This commit is contained in:
parent
a2ccb00e1d
commit
f0c5f77f99
122 changed files with 334 additions and 317 deletions
|
@ -44,20 +44,20 @@ public:
|
|||
|
||||
JS::NonnullGCPtr<CanvasGradient> create_radial_gradient(double x0, double y0, double r0, double x1, double y1, double r1)
|
||||
{
|
||||
auto& window = static_cast<IncludingClass&>(*this).global_object();
|
||||
return CanvasGradient::create_radial(window, x0, y0, r0, x1, y1, r1);
|
||||
auto& realm = static_cast<IncludingClass&>(*this).realm();
|
||||
return CanvasGradient::create_radial(realm, x0, y0, r0, x1, y1, r1);
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<CanvasGradient> create_linear_gradient(double x0, double y0, double x1, double y1)
|
||||
{
|
||||
auto& window = static_cast<IncludingClass&>(*this).global_object();
|
||||
return CanvasGradient::create_linear(window, x0, y0, x1, y1);
|
||||
auto& realm = static_cast<IncludingClass&>(*this).realm();
|
||||
return CanvasGradient::create_linear(realm, x0, y0, x1, y1);
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<CanvasGradient> create_conic_gradient(double start_angle, double x, double y)
|
||||
{
|
||||
auto& window = static_cast<IncludingClass&>(*this).global_object();
|
||||
return CanvasGradient::create_conic(window, start_angle, x, y);
|
||||
auto& realm = static_cast<IncludingClass&>(*this).realm();
|
||||
return CanvasGradient::create_conic(realm, start_angle, x, y);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue