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); |
} |