mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/awesomekling
Commit: 6e0f80fbe0
Pull-request: https://github.com/SerenityOS/serenity/pull/15672
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