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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1838973003: Send lostpointercapture on touch capturing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 6523dac47b4d641b4552b341d50e41fc7b81a1bc..1c5afa56ac770a822255f033548c83cd4e5bbaba 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2651,6 +2651,10 @@ void Element::setPointerCapture(int pointerId, ExceptionState& exceptionState)
exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
else if (!inDocument())
exceptionState.throwDOMException(InvalidStateError, "InvalidStateError");
+ // TODO(crbug.com/579553): This next "else if" is a hack to notify JS that we don't (yet) support
+ // explicit set/release of touch pointers (which are implicitly captured for performance reasons).
+ else if (document().frame()->eventHandler().getPointerEventType(pointerId) == WebPointerProperties::PointerType::Touch)
+ exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
else
document().frame()->eventHandler().setPointerCapture(pointerId, this);
}
@@ -2661,6 +2665,10 @@ void Element::releasePointerCapture(int pointerId, ExceptionState& exceptionStat
if (document().frame()) {
if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
+ // TODO(crbug.com/579553): This next "else if" is a hack to notify JS that we don't (yet) support
+ // explicit set/release of touch pointers (which are implicitly captured for performance reasons).
+ else if (document().frame()->eventHandler().getPointerEventType(pointerId) == WebPointerProperties::PointerType::Touch)
+ exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
else
document().frame()->eventHandler().releasePointerCapture(pointerId, this);
}

Powered by Google App Engine
This is Rietveld 408576698