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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 3011 matching lines...) Expand 10 before | Expand all | Expand 10 after
3022 DocumentFragment* fragment = createFragmentForInnerOuterHTML( 3022 DocumentFragment* fragment = createFragmentForInnerOuterHTML(
3023 markup, contextElement, AllowScriptingContent, "insertAdjacentHTML", 3023 markup, contextElement, AllowScriptingContent, "insertAdjacentHTML",
3024 exceptionState); 3024 exceptionState);
3025 if (!fragment) 3025 if (!fragment)
3026 return; 3026 return;
3027 insertAdjacent(where, fragment, exceptionState); 3027 insertAdjacent(where, fragment, exceptionState);
3028 } 3028 }
3029 3029
3030 void Element::setPointerCapture(int pointerId, ExceptionState& exceptionState) { 3030 void Element::setPointerCapture(int pointerId, ExceptionState& exceptionState) {
3031 if (document().frame()) { 3031 if (document().frame()) {
3032 if (!document().frame()->eventHandler().isPointerEventActive(pointerId)) 3032 if (!document().frame()->eventHandler().isPointerEventActive(pointerId)) {
3033 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId"); 3033 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
3034 else if (!isConnected()) 3034 } else if (!isConnected()) {
3035 exceptionState.throwDOMException(InvalidStateError, "InvalidStateError"); 3035 exceptionState.throwDOMException(InvalidStateError, "InvalidStateError");
3036 else 3036 } else if (document().page() &&
3037 document().page()->pointerLockController().element()) {
3038 exceptionState.throwDOMException(
3039 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.
3040 } else {
3037 document().frame()->eventHandler().setPointerCapture(pointerId, this); 3041 document().frame()->eventHandler().setPointerCapture(pointerId, this);
3042 }
3038 } 3043 }
3039 } 3044 }
3040 3045
3041 void Element::releasePointerCapture(int pointerId, 3046 void Element::releasePointerCapture(int pointerId,
3042 ExceptionState& exceptionState) { 3047 ExceptionState& exceptionState) {
3043 if (document().frame()) { 3048 if (document().frame()) {
3044 if (!document().frame()->eventHandler().isPointerEventActive(pointerId)) 3049 if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
3045 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId"); 3050 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
3046 else 3051 else
3047 document().frame()->eventHandler().releasePointerCapture(pointerId, this); 3052 document().frame()->eventHandler().releasePointerCapture(pointerId, this);
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
4270 } 4275 }
4271 4276
4272 DEFINE_TRACE_WRAPPERS(Element) { 4277 DEFINE_TRACE_WRAPPERS(Element) {
4273 if (hasRareData()) { 4278 if (hasRareData()) {
4274 visitor->traceWrappers(elementRareData()); 4279 visitor->traceWrappers(elementRareData());
4275 } 4280 }
4276 ContainerNode::traceWrappers(visitor); 4281 ContainerNode::traceWrappers(visitor);
4277 } 4282 }
4278 4283
4279 } // namespace blink 4284 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698