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 9e22bf067b59f01a58ce245bc9a14358d1735e64..d9a7ac0d112bdb993e4813cbb41e6a1c39b29b83 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -3066,14 +3066,21 @@ void Element::setPointerCapture(int pointer_id, |
ExceptionState& exception_state) { |
if (GetDocument().GetFrame()) { |
if (!GetDocument().GetFrame()->GetEventHandler().IsPointerEventActive( |
- pointer_id)) |
+ pointer_id)) { |
exception_state.ThrowDOMException(kInvalidPointerId, "InvalidPointerId"); |
- else if (!isConnected()) |
+ } else if (!isConnected()) { |
exception_state.ThrowDOMException(kInvalidStateError, |
"InvalidStateError"); |
- else |
+ } else if (GetDocument().GetPage() && GetDocument() |
+ .GetPage() |
+ ->GetPointerLockController() |
+ .GetElement()) { |
+ exception_state.ThrowDOMException(kInvalidStateError, |
+ "InvalidStateError"); |
+ } else { |
GetDocument().GetFrame()->GetEventHandler().SetPointerCapture(pointer_id, |
this); |
+ } |
} |
} |