summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-22 22:11:42 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-22 22:11:42 +0200
commit43d16fa5b67d289b105aca45e43479144ad5e3fb (patch)
tree0ceee2e11ba1cca2dabf348f7cca15cde7626dac /Userland/Libraries/LibWeb
parente4df1b223ffcd5437d419342dd3848e9f11f0d63 (diff)
downloadserenity-43d16fa5b67d289b105aca45e43479144ad5e3fb.zip
LibWeb: Implement document.applets
This is a legacy interface that returns an always-empty HTMLCollection.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.cpp7
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h2
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.idl2
3 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp
index b1de98c8a5..e4f9ae1f47 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Document.cpp
@@ -510,6 +510,13 @@ NonnullRefPtr<HTMLCollection> Document::get_elements_by_class_name(FlyString con
});
}
+NonnullRefPtr<HTMLCollection> Document::applets()
+{
+ // FIXME: This should return the same HTMLCollection object every time,
+ // but that would cause a reference cycle since HTMLCollection refs the root.
+ return HTMLCollection::create(*this, [] { return false; });
+}
+
Color Document::link_color() const
{
if (m_link_color.has_value())
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index 684d5ced28..a470b0379b 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -140,6 +140,8 @@ public:
NonnullRefPtr<HTMLCollection> get_elements_by_tag_name(FlyString const&);
NonnullRefPtr<HTMLCollection> get_elements_by_class_name(FlyString const&);
+ NonnullRefPtr<HTMLCollection> applets();
+
const String& source() const { return m_source; }
void set_source(const String& source) { m_source = source; }
diff --git a/Userland/Libraries/LibWeb/DOM/Document.idl b/Userland/Libraries/LibWeb/DOM/Document.idl
index c3a26ef15a..cc31659525 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.idl
+++ b/Userland/Libraries/LibWeb/DOM/Document.idl
@@ -18,6 +18,8 @@ interface Document : Node {
HTMLCollection getElementsByTagName(DOMString tagName);
HTMLCollection getElementsByClassName(DOMString className);
+ readonly attribute HTMLCollection applets;
+
Element createElement(DOMString tagName);
Element createElementNS(DOMString? namespace, DOMString qualifiedName);
DocumentFragment createDocumentFragment();