1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

LibWeb: Make Selection GC-allocated

This commit is contained in:
Andreas Kling 2022-09-04 13:20:53 +02:00
parent be9d3860b9
commit 8f2a711132
5 changed files with 24 additions and 14 deletions

View file

@ -4,15 +4,24 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Selection/Selection.h>
namespace Web::Selection {
NonnullRefPtr<Selection> Selection::create()
JS::NonnullGCPtr<Selection> Selection::create(HTML::Window& window)
{
return adopt_ref(*new Selection);
return *window.heap().allocate<Selection>(window.realm(), window);
}
Selection::Selection(HTML::Window& window)
: PlatformObject(window.realm())
{
set_prototype(&window.cached_web_prototype("Selection"));
}
Selection::~Selection() = default;
DOM::Node* Selection::anchor_node()
{
TODO();