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 585beca84fb915bb397971818812de64b35f9488..6af0d0f60234672acf34fe6d4d9c24855c72361c 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -3029,12 +3029,17 @@ void Element::insertAdjacentHTML(const String& where, |
void Element::setPointerCapture(int pointerId, ExceptionState& exceptionState) { |
if (document().frame()) { |
- if (!document().frame()->eventHandler().isPointerEventActive(pointerId)) |
+ if (!document().frame()->eventHandler().isPointerEventActive(pointerId)) { |
exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId"); |
- else if (!isConnected()) |
+ } else if (!isConnected()) { |
exceptionState.throwDOMException(InvalidStateError, "InvalidStateError"); |
- else |
+ } else if (document().page() && |
+ document().page()->pointerLockController().element()) { |
+ exceptionState.throwDOMException( |
+ InvalidStateError, "Cannot capture when the mouse is locked"); |
Navid Zolghadr
2017/04/10 17:16:14
I believe we need to put the error in pointer even
lanwei
2017/05/17 13:56:00
Done.
|
+ } else { |
document().frame()->eventHandler().setPointerCapture(pointerId, this); |
+ } |
} |
} |