summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Document.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-12-09 12:51:05 +0100
committerAndreas Kling <kling@serenityos.org>2021-12-09 21:28:52 +0100
commitd368b0869822cb554238ed66d6e4cd9e8659f949 (patch)
tree2f200588c45f3ec3646124839d3394297304e4b1 /Userland/Libraries/LibWeb/DOM/Document.h
parente1287a9a45f3b7faaa34dde0bf9357bd05d99679 (diff)
downloadserenity-d368b0869822cb554238ed66d6e4cd9e8659f949.zip
LibWeb: Make DOMImplementation forward its ref count to DOM::Document
This allows document.implementation to keep the underlying document alive for as long as we need it (for example, if someone holds on to a DOMImplementation JS wrapper after the document is GC'd.)
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Document.h')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index 4c4330cfce..9f374ec385 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -22,7 +22,6 @@
#include <LibWeb/CSS/StyleComputer.h>
#include <LibWeb/CSS/StyleSheetList.h>
#include <LibWeb/Cookie/Cookie.h>
-#include <LibWeb/DOM/DOMImplementation.h>
#include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/DOM/NonElementParentNode.h>
#include <LibWeb/DOM/ParentNode.h>
@@ -264,7 +263,7 @@ public:
void completely_finish_loading();
- const NonnullRefPtr<DOMImplementation> implementation() const { return m_implementation; }
+ NonnullRefPtr<DOMImplementation> implementation() const;
RefPtr<HTML::HTMLScriptElement> current_script() const { return m_current_script; }
void set_current_script(Badge<HTML::HTMLScriptElement>, RefPtr<HTML::HTMLScriptElement> script) { m_current_script = move(script); }
@@ -376,7 +375,7 @@ private:
bool m_ready_for_post_load_tasks { false };
- NonnullRefPtr<DOMImplementation> m_implementation;
+ NonnullOwnPtr<DOMImplementation> m_implementation;
RefPtr<HTML::HTMLScriptElement> m_current_script;
bool m_should_invalidate_styles_on_attribute_changes { true };