From 9bc1318a7834a7f141c93b33e0120c4c3b88e26e Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 29 May 2024 10:54:08 -0600 Subject: [PATCH] LibWeb: Consume user activation when showing a picker dialog --- Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 3f01f79be5e..760ef991695 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -248,7 +248,10 @@ static void show_the_picker_if_applicable(HTMLInputElement& element) // 1. If element's relevant global object does not have transient activation, then return. auto& global_object = relevant_global_object(element); - if (!is(global_object) || !static_cast(global_object).has_transient_activation()) + if (!is(global_object)) + return; + auto& relevant_global_object = static_cast(global_object); + if (!relevant_global_object.has_transient_activation()) return; // 2. If element is not mutable, then return. @@ -256,6 +259,7 @@ static void show_the_picker_if_applicable(HTMLInputElement& element) return; // 3. Consume user activation given element's relevant global object. + relevant_global_object.consume_user_activation(); // 4. If element's type attribute is in the File Upload state, then run these steps in parallel: if (element.type_state() == HTMLInputElement::TypeAttributeState::FileUpload) {