#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/input/touch_event_manager.h"
#include <memory>
#include "base/ranges/algorithm.h"
#include "third_party/blink/public/common/input/web_coalesced_input_event.h"
#include "third_party/blink/public/common/input/web_touch_event.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/events/touch_event.h"
#include "third_party/blink/renderer/core/frame/event_handler_registry.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h"
#include "third_party/blink/renderer/core/input/event_handling_util.h"
#include "third_party/blink/renderer/core/input/touch_action_util.h"
#include "third_party/blink/renderer/core/layout/hit_test_canvas_result.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
namespace blink {
namespace {
bool HasEventHandlerInAncestorPath(
Node* touch_node,
EventHandlerRegistry::EventHandlerClass handler_class) { … }
bool HasTouchHandlers(const EventHandlerRegistry& registry) { … }
const AtomicString& TouchEventNameForPointerEventType(
WebInputEvent::Type type) { … }
WebTouchPoint::State TouchPointStateFromPointerEventType(
WebInputEvent::Type type,
bool stale) { … }
WebTouchPoint CreateWebTouchPointFromWebPointerEvent(
const WebPointerEvent& web_pointer_event,
bool stale) { … }
void SetWebTouchEventAttributesFromWebPointerEvent(
WebTouchEvent* web_touch_event,
const WebPointerEvent& web_pointer_event) { … }
class ChangedTouches final { … };
}
TouchEventManager::TouchEventManager(LocalFrame& frame) : … { … }
void TouchEventManager::Clear() { … }
void TouchEventManager::Trace(Visitor* visitor) const { … }
Touch* TouchEventManager::CreateDomTouch(
const TouchEventManager::TouchPointAttributes* point_attr,
bool* known_target) { … }
WebCoalescedInputEvent TouchEventManager::GenerateWebCoalescedInputEvent() { … }
WebInputEventResult
TouchEventManager::DispatchTouchEventFromAccumulatdTouchPoints() { … }
Node* TouchEventManager::GetTouchPointerNode(
const WebPointerEvent& event,
const event_handling_util::PointerEventTarget& pointer_event_target) { … }
void TouchEventManager::UpdateTouchAttributeMapsForPointerDown(
const WebPointerEvent& event,
Node* touch_node,
TouchAction effective_touch_action) { … }
void TouchEventManager::HandleTouchPoint(
const WebPointerEvent& event,
const Vector<WebPointerEvent>& coalesced_events,
const event_handling_util::PointerEventTarget& pointer_event_target) { … }
WebInputEventResult TouchEventManager::FlushEvents() { … }
void TouchEventManager::AllTouchesReleasedCleanup() { … }
bool TouchEventManager::IsAnyTouchActive() const { … }
Element* TouchEventManager::CurrentTouchDownElement() { … }
WebInputEventResult TouchEventManager::EnsureVerticalScrollIsPossible(
WebInputEventResult event_result) { … }
}