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

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

Issue 2807433003: No pointer captured when the pointer lock is applied (Closed)
Patch Set: pointer lock Created 3 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 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);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698