mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibWeb: Change DOM::Position to be GC-allocated
This commit is contained in:
parent
35623ad52e
commit
46254101f7
10 changed files with 72 additions and 62 deletions
|
@ -13,8 +13,8 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
Position::Position(Node& node, unsigned offset)
|
||||
: m_node(JS::make_handle(node))
|
||||
Position::Position(JS::GCPtr<Node> node, unsigned offset)
|
||||
: m_node(node)
|
||||
, m_offset(offset)
|
||||
{
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ ErrorOr<String> Position::to_string() const
|
|||
{
|
||||
if (!node())
|
||||
return String::formatted("DOM::Position(nullptr, {})", offset());
|
||||
return String::formatted("DOM::Position({} ({})), {})", node()->node_name(), node(), offset());
|
||||
return String::formatted("DOM::Position({} ({})), {})", node()->node_name(), node().ptr(), offset());
|
||||
}
|
||||
|
||||
bool Position::increment_offset()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue