summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.cpp12
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h3
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.idl3
3 files changed, 18 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp
index 3c1dd8a464..875a36e0a4 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Document.cpp
@@ -1062,4 +1062,16 @@ Bindings::LocationObject* Document::location()
return window().wrapper()->location_object();
}
+// https://w3c.github.io/page-visibility/#hidden-attribute
+bool Document::hidden() const
+{
+ return false;
+}
+
+// https://w3c.github.io/page-visibility/#visibilitystate-attribute
+String Document::visibility_state() const
+{
+ return hidden() ? "hidden" : "visible";
+}
+
}
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index 27b2f45223..dfa07c1b05 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -298,6 +298,9 @@ public:
bool page_showing() const { return m_page_showing; }
void set_page_showing(bool value) { m_page_showing = value; }
+ bool hidden() const;
+ String visibility_state() const;
+
private:
explicit Document(const AK::URL&);
diff --git a/Userland/Libraries/LibWeb/DOM/Document.idl b/Userland/Libraries/LibWeb/DOM/Document.idl
index dca0c8cfb7..c86cbc6799 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.idl
+++ b/Userland/Libraries/LibWeb/DOM/Document.idl
@@ -139,4 +139,7 @@ interface Document : Node {
attribute EventHandler onwebkittransitionend;
attribute EventHandler onwheel;
+ readonly boolean hidden;
+ readonly DOMString visibilityState;
+
};