Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Unified Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 1968653005: Set width=height=1 of mouse like pointer events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/input/PointerEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
index 4e948617bf2f6250081ac4692728f1e888585c61..0e764b369cac07d3ee685f6307973e691634fc47 100644
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -165,15 +165,17 @@ EventTarget* PointerEventManager::getEffectiveTargetForPointerEvent(
return target;
}
-void PointerEventManager::sendMouseAndPossiblyPointerNodeTransitionEvents(
+void PointerEventManager::sendMouseAndPossiblyPointerBoundaryEvents(
Node* exitedNode,
Node* enteredNode,
const PlatformMouseEvent& mouseEvent,
bool isFrameBoundaryTransition)
{
- // Pointer event type does not matter as it will be overridden in the sendNodeTransitionEvents
- PointerEvent* pointerEvent =
- m_pointerEventFactory.create(EventTypeNames::mouseout, mouseEvent,
+ // Mouse event type does not matter as this pointerevent will only be used
+ // to create boundary pointer events and its type will be overridden in
+ // |sendBoundaryEvents| function.
+ PointerEvent* dummyPointerEvent =
+ m_pointerEventFactory.create(EventTypeNames::mousedown, mouseEvent,
nullptr, m_frame->document()->domWindow());
// TODO(crbug/545647): This state should reset with pointercancel too.
@@ -181,17 +183,17 @@ void PointerEventManager::sendMouseAndPossiblyPointerNodeTransitionEvents(
// stage. So if the event is not frame boundary transition it is only a
// compatibility mouse event and we do not need to change pointer event
// behavior regarding preventMouseEvent state in that case.
- if (isFrameBoundaryTransition && pointerEvent->buttons() == 0
- && pointerEvent->isPrimary()) {
+ if (isFrameBoundaryTransition && dummyPointerEvent->buttons() == 0
+ && dummyPointerEvent->isPrimary()) {
m_preventMouseEventForPointerType[toPointerTypeIndex(
mouseEvent.pointerProperties().pointerType)] = false;
}
- processCaptureAndPositionOfPointerEvent(pointerEvent, enteredNode,
+ processCaptureAndPositionOfPointerEvent(dummyPointerEvent, enteredNode,
exitedNode, mouseEvent, true, isFrameBoundaryTransition);
}
-void PointerEventManager::sendNodeTransitionEvents(
+void PointerEventManager::sendBoundaryEvents(
EventTarget* exitedTarget,
EventTarget* enteredTarget,
PointerEvent* pointerEvent,
@@ -324,12 +326,12 @@ void PointerEventManager::setNodeUnderPointer(
EventTargetAttributes(target, false));
}
if (sendEvent)
- sendNodeTransitionEvents(node.target, target, pointerEvent);
+ sendBoundaryEvents(node.target, target, pointerEvent);
} else if (target) {
m_nodeUnderPointer.add(pointerEvent->pointerId(),
EventTargetAttributes(target, false));
if (sendEvent)
- sendNodeTransitionEvents(nullptr, target, pointerEvent);
+ sendBoundaryEvents(nullptr, target, pointerEvent);
}
}
@@ -576,7 +578,7 @@ void PointerEventManager::processCaptureAndPositionOfPointerEvent(
}
if (sendMouseEvent && !isCaptureChanged) {
// lastNodeUnderMouse is needed here because it is still stored in EventHandler.
- sendNodeTransitionEvents(lastNodeUnderMouse, hitTestTarget,
+ sendBoundaryEvents(lastNodeUnderMouse, hitTestTarget,
pointerEvent, mouseEvent, true);
}
}
@@ -607,10 +609,10 @@ bool PointerEventManager::processPendingPointerCapture(
if (sendMouseEvent) {
// Send pointer event transitions as the line after this if
// block sends the mouse events
- sendNodeTransitionEvents(nodeUnderPointerAtt.target, nullptr,
+ sendBoundaryEvents(nodeUnderPointerAtt.target, nullptr,
pointerEvent);
}
- sendNodeTransitionEvents(nodeUnderPointerAtt.target, nullptr,
+ sendBoundaryEvents(nodeUnderPointerAtt.target, nullptr,
pointerEvent, mouseEvent, sendMouseEvent);
}
if (pointerCaptureTarget) {
@@ -628,7 +630,7 @@ bool PointerEventManager::processPendingPointerCapture(
}
// Set pointerCaptureTarget from pendingPointerCaptureTarget. This does
- // affect the behavior of sendNodeTransitionEvents function. So the
+ // affect the behavior of sendBoundaryEvents function. So the
// ordering of the surrounding blocks of code for sending transition events
// are important.
if (pendingPointerCaptureTarget)
@@ -647,9 +649,9 @@ bool PointerEventManager::processPendingPointerCapture(
if (sendMouseEvent) {
// Send pointer event transitions as the line after this if
// block sends the mouse events
- sendNodeTransitionEvents(nullptr, hitTestTarget, pointerEvent);
+ sendBoundaryEvents(nullptr, hitTestTarget, pointerEvent);
}
- sendNodeTransitionEvents(nullptr, hitTestTarget, pointerEvent,
+ sendBoundaryEvents(nullptr, hitTestTarget, pointerEvent,
mouseEvent, sendMouseEvent);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698