mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibWeb: Add user activation for pointerdown/up
Fixed FIXME's for pointerdown and pointerup events.
This commit is contained in:
parent
a821fc03be
commit
87f6a11e47
Notes:
github-actions[bot]
2025-04-13 16:37:42 +00:00
Author: https://github.com/theIDinside 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/87f6a11e474 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4329 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/shannonbooth
1 changed files with 13 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2024, Glenn Skrzypczak <glenn.skrzypczak@gmail.com>
|
||||
* Copyright (c) 2025, Felipe Muñoz Mazur <felipe.munoz.mazur@protonmail.com>
|
||||
* Copyright (c) 2025, Simon Farre <simon.farre.cx@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -39,6 +40,7 @@
|
|||
#include <LibWeb/UIEvents/EventNames.h>
|
||||
#include <LibWeb/UIEvents/KeyCode.h>
|
||||
#include <LibWeb/UIEvents/KeyboardEvent.h>
|
||||
#include <LibWeb/UIEvents/PointerEvent.h>
|
||||
#include <LibWeb/WebIDL/AbstractOperations.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -822,10 +824,19 @@ bool EventTarget::dispatch_event(Event& event)
|
|||
if (event.type() == UIEvents::EventNames::mousedown)
|
||||
return true;
|
||||
|
||||
// FIXME:
|
||||
// pointerdown, provided the event's pointerType is "mouse".
|
||||
if (event.type() == UIEvents::EventNames::pointerdown) {
|
||||
if (auto* pointer_event = as_if<UIEvents::PointerEvent>(&event))
|
||||
return pointer_event->pointer_type() == "mouse"sv;
|
||||
}
|
||||
|
||||
// pointerup, provided the event's pointerType is not "mouse".
|
||||
// touchend.
|
||||
if (event.type() == UIEvents::EventNames::pointerup) {
|
||||
if (auto* pointer_event = as_if<UIEvents::PointerEvent>(&event))
|
||||
return pointer_event->pointer_type() != "mouse"sv;
|
||||
}
|
||||
|
||||
// FIXME: touchend
|
||||
|
||||
return false;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue