mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Fix a LibJSGCVerifier warning in DOM::Text
This commit is contained in:
parent
164db73bdc
commit
7001e0a428
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/mattco98
Commit: 7001e0a428
Pull-request: https://github.com/SerenityOS/serenity/pull/23861
Reviewed-by: https://github.com/awesomekling
3 changed files with 14 additions and 6 deletions
|
@ -35,8 +35,7 @@ void Text::visit_edges(Cell::Visitor& visitor)
|
|||
{
|
||||
Base::visit_edges(visitor);
|
||||
SlottableMixin::visit_edges(visitor);
|
||||
|
||||
visitor.visit(dynamic_cast<JS::Cell*>(m_owner.ptr()));
|
||||
visitor.visit(m_owner);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-text-text
|
||||
|
@ -47,6 +46,15 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> Text::construct_impl(JS::Realm& real
|
|||
return realm.heap().allocate<Text>(realm, window.associated_document(), data);
|
||||
}
|
||||
|
||||
EditableTextNodeOwner* Text::editable_text_node_owner()
|
||||
{
|
||||
if (!m_owner)
|
||||
return nullptr;
|
||||
EditableTextNodeOwner* owner = dynamic_cast<EditableTextNodeOwner*>(m_owner.ptr());
|
||||
VERIFY(owner);
|
||||
return owner;
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-text-splittext
|
||||
// https://dom.spec.whatwg.org/#concept-text-split
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> Text::split_text(size_t offset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue