mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
LibWeb: Make the HTMLParser GC-allocated
This prevents a reference cycle between a HTMLParser opened via document.open() and the document. It was one of many things keeping some documents alive indefinitely.
This commit is contained in:
parent
68452c749a
commit
6e0f80fbe0
8 changed files with 71 additions and 35 deletions
|
@ -340,6 +340,8 @@ void Document::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_all);
|
||||
visitor.visit(m_selection);
|
||||
|
||||
visitor.visit(m_parser);
|
||||
|
||||
for (auto& script : m_scripts_to_execute_when_parsing_has_finished)
|
||||
visitor.visit(script.ptr());
|
||||
for (auto& script : m_scripts_to_execute_as_soon_as_possible)
|
||||
|
@ -2149,7 +2151,7 @@ void Document::abort()
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dom.html#active-parser
|
||||
RefPtr<HTML::HTMLParser> Document::active_parser()
|
||||
JS::GCPtr<HTML::HTMLParser> Document::active_parser()
|
||||
{
|
||||
if (!m_parser)
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue