mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 12:42:54 +00:00
LibWeb: Fix Document construction mishap in <template> element
Ref-counted objects must not be stack allocated. Make DOM::Document's constructor private to avoid this issue. (I wish we could mark classes as heap-only..)
This commit is contained in:
parent
691b105885
commit
46c15276e9
Notes:
sideshowbarker
2024-07-19 01:47:41 +09:00
Author: https://github.com/awesomekling
Commit: 46c15276e9
7 changed files with 11 additions and 9 deletions
Libraries/LibWeb/HTML
|
@ -44,8 +44,8 @@ DOM::Document& HTMLTemplateElement::appropriate_template_contents_owner_document
|
|||
{
|
||||
if (!document.created_for_appropriate_template_contents()) {
|
||||
if (!document.associated_inert_template_document()) {
|
||||
DOM::Document new_document;
|
||||
new_document.set_created_for_appropriate_template_contents(true);
|
||||
auto new_document = DOM::Document::create();
|
||||
new_document->set_created_for_appropriate_template_contents(true);
|
||||
|
||||
// FIXME: If doc is an HTML document, mark new doc as an HTML document also.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue