mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Make CSS::Screen GC-allocated
This commit is contained in:
parent
d5e831988e
commit
8c90e08e0b
Notes:
sideshowbarker
2024-07-17 07:28:03 +09:00
Author: https://github.com/awesomekling
Commit: 8c90e08e0b
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
6 changed files with 36 additions and 21 deletions
|
@ -11,9 +11,22 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
Screen::Screen(HTML::Window& window)
|
||||
: m_window(JS::make_handle(window))
|
||||
JS::NonnullGCPtr<Screen> Screen::create(HTML::Window& window)
|
||||
{
|
||||
return *window.heap().allocate<Screen>(window.realm(), window);
|
||||
}
|
||||
|
||||
Screen::Screen(HTML::Window& window)
|
||||
: PlatformObject(window.realm())
|
||||
, m_window(window)
|
||||
{
|
||||
set_prototype(&window.cached_web_prototype("Screen"));
|
||||
}
|
||||
|
||||
void Screen::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_window.ptr());
|
||||
}
|
||||
|
||||
Gfx::IntRect Screen::screen_rect() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue