mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
LibWeb: Consume user activation when showing a picker dialog
This commit is contained in:
parent
a3a74245d6
commit
9bc1318a78
Notes:
sideshowbarker
2024-07-16 23:03:06 +09:00
Author: https://github.com/ADKaster
Commit: 9bc1318a78
Pull-request: https://github.com/SerenityOS/serenity/pull/24478
Reviewed-by: https://github.com/jamierocks
1 changed files with 5 additions and 1 deletions
|
@ -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<HTML::Window>(global_object) || !static_cast<HTML::Window&>(global_object).has_transient_activation())
|
||||
if (!is<HTML::Window>(global_object))
|
||||
return;
|
||||
auto& relevant_global_object = static_cast<HTML::Window&>(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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue