mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +00:00
LibWeb: Remove unecessary dependence on Window from SVG classes
These classes only needed Window to get at its realm. Pass a realm directly to construct SCG classes.
This commit is contained in:
parent
62a8c26b73
commit
320dddde6a
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/ADKaster
Commit: 320dddde6a
Pull-request: https://github.com/SerenityOS/serenity/pull/15349
Reviewed-by: https://github.com/linusg ✅
20 changed files with 87 additions and 93 deletions
|
@ -4,22 +4,22 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/SVG/SVGLength.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
JS::NonnullGCPtr<SVGLength> SVGLength::create(HTML::Window& window, u8 unit_type, float value)
|
||||
JS::NonnullGCPtr<SVGLength> SVGLength::create(JS::Realm& realm, u8 unit_type, float value)
|
||||
{
|
||||
return *window.heap().allocate<SVGLength>(window.realm(), window, unit_type, value);
|
||||
return *realm.heap().allocate<SVGLength>(realm, realm, unit_type, value);
|
||||
}
|
||||
|
||||
SVGLength::SVGLength(HTML::Window& window, u8 unit_type, float value)
|
||||
: PlatformObject(window.realm())
|
||||
SVGLength::SVGLength(JS::Realm& realm, u8 unit_type, float value)
|
||||
: PlatformObject(realm)
|
||||
, m_unit_type(unit_type)
|
||||
, m_value(value)
|
||||
{
|
||||
set_prototype(&window.cached_web_prototype("SVGLength"));
|
||||
set_prototype(&Bindings::cached_web_prototype(realm, "SVGLength"));
|
||||
}
|
||||
|
||||
SVGLength::~SVGLength() = default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue