diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp
index d38e0cfcf3..9d52a400c0 100644
--- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp
@@ -8,6 +8,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -2099,4 +2100,18 @@ void Navigable::paint(Painting::RecordingPainter& recording_painter, PaintConfig
}
}
+// https://html.spec.whatwg.org/multipage/browsing-the-web.html#event-uni
+UserNavigationInvolvement user_navigation_involvement(DOM::Event const& event)
+{
+ // For convenience at certain call sites, the user navigation involvement for an Event event is defined as follows:
+
+ // 1. Assert: this algorithm is being called as part of an activation behavior definition.
+ // 2. Assert: event's type is "click".
+ VERIFY(event.type() == "click"_fly_string);
+
+ // 3. If event's isTrusted is initialized to true, then return "activation".
+ // 4. Return "none".
+ return event.is_trusted() ? UserNavigationInvolvement::Activation : UserNavigationInvolvement::None;
+}
+
}
diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.h b/Userland/Libraries/LibWeb/HTML/Navigable.h
index 9ea1e097f4..7b4e8b6456 100644
--- a/Userland/Libraries/LibWeb/HTML/Navigable.h
+++ b/Userland/Libraries/LibWeb/HTML/Navigable.h
@@ -227,5 +227,6 @@ HashTable& all_navigables();
bool navigation_must_be_a_replace(AK::URL const& url, DOM::Document const& document);
void finalize_a_cross_document_navigation(JS::NonnullGCPtr, HistoryHandlingBehavior, JS::NonnullGCPtr);
void perform_url_and_history_update_steps(DOM::Document& document, AK::URL new_url, Optional = {}, HistoryHandlingBehavior history_handling = HistoryHandlingBehavior::Reload);
+UserNavigationInvolvement user_navigation_involvement(DOM::Event const&);
}