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

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

Issue 2147263003: Send got/lostpointercapture immediately if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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 cc50085728994221c566246b27b820a06f5ede5c..a3c9b429371562ef7bac93c6f1c96de834f69151 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -208,16 +208,14 @@ PointerEvent* PointerEventFactory::createPointerCancelEvent(
}
PointerEvent* PointerEventFactory::createPointerCaptureEvent(
- PointerEvent* pointerEvent,
+ const int pointerId,
const AtomicString& type)
{
ASSERT(type == EventTypeNames::gotpointercapture
|| type == EventTypeNames::lostpointercapture);
PointerEventInit pointerEventInit;
- pointerEventInit.setPointerId(pointerEvent->pointerId());
- pointerEventInit.setPointerType(pointerEvent->pointerType());
- pointerEventInit.setIsPrimary(pointerEvent->isPrimary());
+ pointerEventInit.setPointerId(pointerId);
Rick Byers 2016/07/15 17:35:31 so for now you're just matching edge's behavior fo
Navid Zolghadr 2016/07/15 20:41:01 Not quite. Edge does set the attributes for the go
pointerEventInit.setBubbles(true);
pointerEventInit.setCancelable(false);
@@ -294,12 +292,12 @@ int PointerEventFactory::addIdAndActiveButtons(const IncomingId p,
bool isActiveButtons)
{
// Do not add extra mouse pointer as it was added in initialization
- if (p.pointerType() == toInt(WebPointerProperties::PointerType::Mouse)) {
+ if (p.pointerType() == WebPointerProperties::PointerType::Mouse) {
m_pointerIdMapping.set(s_mouseId, PointerAttributes(p, isActiveButtons));
return s_mouseId;
}
- int type = p.pointerType();
+ int type = p.pointerTypeInt();
if (m_pointerIncomingIdMapping.contains(p)) {
int mappedId = m_pointerIncomingIdMapping.get(p);
m_pointerIdMapping.set(mappedId, PointerAttributes(p, isActiveButtons));
@@ -322,7 +320,7 @@ bool PointerEventFactory::remove(const int mappedId)
return false;
IncomingId p = m_pointerIdMapping.get(mappedId).incomingId;
- int type = p.pointerType();
+ int type = p.pointerTypeInt();
m_pointerIdMapping.remove(mappedId);
m_pointerIncomingIdMapping.remove(p);
if (m_primaryId[type] == mappedId)
@@ -338,7 +336,7 @@ Vector<int> PointerEventFactory::getPointerIdsOfType(
for (auto iter = m_pointerIdMapping.begin(); iter != m_pointerIdMapping.end(); ++iter) {
int mappedId = iter->key;
- if (iter->value.incomingId.pointerType() == static_cast<int>(pointerType))
+ if (iter->value.incomingId.pointerType() == pointerType)
mappedIds.append(mappedId);
}
@@ -353,7 +351,7 @@ bool PointerEventFactory::isPrimary(int mappedId) const
return false;
IncomingId p = m_pointerIdMapping.get(mappedId).incomingId;
- return m_primaryId[p.pointerType()] == mappedId;
+ return m_primaryId[p.pointerTypeInt()] == mappedId;
}
bool PointerEventFactory::isActive(const int pointerId) const

Powered by Google App Engine
This is Rietveld 408576698