From 34b2a4f7caf8693ca38765e03dcada649cbe988b Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 25 May 2024 14:24:07 +0100 Subject: [PATCH] LibWeb: Add getter for history-action activation --- Userland/Libraries/LibWeb/HTML/Window.cpp | 7 +++++++ Userland/Libraries/LibWeb/HTML/Window.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index 28667ca2be5..ac8baea3bc8 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -631,6 +631,13 @@ bool Window::has_transient_activation() const return false; } +// https://html.spec.whatwg.org/multipage/interaction.html#history-action-activation +bool Window::has_history_action_activation() const +{ + // When the last history-action activation timestamp of W is not equal to the last activation timestamp of W, then W is said to have history-action activation. + return m_last_history_action_activation_timestamp != m_last_activation_timestamp; +} + // https://w3c.github.io/requestidlecallback/#start-an-idle-period-algorithm void Window::start_an_idle_period() { diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h index 2ca57ef6061..2d8d1712cd5 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -122,6 +122,9 @@ public: // https://html.spec.whatwg.org/multipage/interaction.html#transient-activation bool has_transient_activation() const; + // https://html.spec.whatwg.org/multipage/interaction.html#history-action-activation + bool has_history_action_activation() const; + WebIDL::ExceptionOr initialize_web_interfaces(Badge); Vector> pdf_viewer_plugin_objects();