diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-19 20:50:33 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-20 10:32:14 +0200 |
commit | d4acdac3175da4edf0ca88c246a9e58307e3eefd (patch) | |
tree | c56fc149669558ce170029bf2aabdcfa64513c32 /Userland/Libraries/LibWeb/DOM/Document.h | |
parent | 5908873b45ecf6dd43411b7df55701576b8e63a6 (diff) | |
download | serenity-d4acdac3175da4edf0ca88c246a9e58307e3eefd.zip |
LibWeb+WebContent+Browser: Plumb visibility state from GUI to web pages
OOPWV now reacts to show/hide events and informs LibWeb about the state
change. This makes visibilitychange events fire when switching tabs. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Document.h')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 8be46b9dc1..230d810f71 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -31,6 +31,7 @@ #include <LibWeb/HTML/Origin.h> #include <LibWeb/HTML/SandboxingFlagSet.h> #include <LibWeb/HTML/Scripting/Environments.h> +#include <LibWeb/HTML/VisibilityState.h> #include <LibWeb/HTML/Window.h> namespace Web::DOM { @@ -319,7 +320,7 @@ public: String visibility_state() const; // https://html.spec.whatwg.org/multipage/interaction.html#update-the-visibility-state - void update_the_visibility_state(String visibility_state); + void update_the_visibility_state(HTML::VisibilityState); void run_the_resize_steps(); void run_the_scroll_steps(); @@ -382,6 +383,9 @@ public: // https://html.spec.whatwg.org/multipage/dom.html#concept-document-policy-container HTML::PolicyContainer policy_container() const; + // https://html.spec.whatwg.org/multipage/browsers.html#list-of-the-descendant-browsing-contexts + Vector<NonnullRefPtr<HTML::BrowsingContext>> list_of_descendant_browsing_contexts() const; + protected: virtual void visit_edges(Cell::Visitor&) override; @@ -527,7 +531,7 @@ private: HTML::PolicyContainer m_policy_container; // https://html.spec.whatwg.org/multipage/interaction.html#visibility-state - String m_visibility_state { "hidden" }; + HTML::VisibilityState m_visibility_state { HTML::VisibilityState::Hidden }; }; } |