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

Unified Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 1635863006: Pointerevent capture APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yet another rebase Created 4 years, 10 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
Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
index a7716388383649708272f71e721d920a30048ba1..314475ec678b4c8baf296b7fb1367eff019b2fe4 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -90,6 +90,11 @@ PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactory::create(
pointerEventInit.setScreenY(mouseEvent.globalPosition().y());
pointerEventInit.setClientX(mouseEvent.position().x());
pointerEventInit.setClientY(mouseEvent.position().y());
+ pointerEventInit.setPressure(getPointerEventPressure(
+ mouseEvent.pointerProperties().force, pointerEventInit.buttons()));
+
+ UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit, mouseEvent.modifiers());
+
if (pointerEventName == EventTypeNames::pointerdown
|| pointerEventName == EventTypeNames::pointerup) {
pointerEventInit.setButton(mouseEvent.button());
@@ -98,10 +103,6 @@ PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactory::create(
// pointerevents should be resolved as part of this bug
pointerEventInit.setButton(NoButton);
}
- pointerEventInit.setPressure(getPointerEventPressure(
- mouseEvent.pointerProperties().force, pointerEventInit.buttons()));
-
- UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit, mouseEvent.modifiers());
// Make sure chorded buttons fire pointermove instead of pointerup/down.
if ((pointerEventName == EventTypeNames::pointerdown
@@ -266,13 +267,13 @@ int PointerEventFactory::addIdAndActiveButtons(const IncomingId p,
return mappedId;
}
-void PointerEventFactory::remove(
+bool PointerEventFactory::remove(
const PassRefPtrWillBeRawPtr<PointerEvent> pointerEvent)
{
int mappedId = pointerEvent->pointerId();
// Do not remove mouse pointer id as it should always be there
if (mappedId == s_mouseId || !m_pointerIdMapping.contains(mappedId))
- return;
+ return false;
IncomingId p = m_pointerIdMapping.get(mappedId).incomingId;
int type = p.pointerType();
@@ -281,6 +282,7 @@ void PointerEventFactory::remove(
if (m_primaryId[type] == mappedId)
m_primaryId[type] = PointerEventFactory::s_invalidId;
m_idCount[type]--;
+ return true;
}
bool PointerEventFactory::isPrimary(int mappedId) const

Powered by Google App Engine
This is Rietveld 408576698