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

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, 6 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 3055 matching lines...) Expand 10 before | Expand all | Expand 10 after
3066 exception_state); 3066 exception_state);
3067 if (!fragment) 3067 if (!fragment)
3068 return; 3068 return;
3069 InsertAdjacent(where, fragment, exception_state); 3069 InsertAdjacent(where, fragment, exception_state);
3070 } 3070 }
3071 3071
3072 void Element::setPointerCapture(int pointer_id, 3072 void Element::setPointerCapture(int pointer_id,
3073 ExceptionState& exception_state) { 3073 ExceptionState& exception_state) {
3074 if (GetDocument().GetFrame()) { 3074 if (GetDocument().GetFrame()) {
3075 if (!GetDocument().GetFrame()->GetEventHandler().IsPointerEventActive( 3075 if (!GetDocument().GetFrame()->GetEventHandler().IsPointerEventActive(
3076 pointer_id)) 3076 pointer_id)) {
3077 exception_state.ThrowDOMException(kInvalidPointerId, "InvalidPointerId"); 3077 exception_state.ThrowDOMException(kInvalidPointerId, "InvalidPointerId");
3078 else if (!isConnected()) 3078 } else if (!isConnected() ||
3079 (GetDocument().GetPage() && GetDocument()
3080 .GetPage()
3081 ->GetPointerLockController()
3082 .GetElement())) {
3079 exception_state.ThrowDOMException(kInvalidStateError, 3083 exception_state.ThrowDOMException(kInvalidStateError,
3080 "InvalidStateError"); 3084 "InvalidStateError");
3081 else 3085 } else {
3082 GetDocument().GetFrame()->GetEventHandler().SetPointerCapture(pointer_id, 3086 GetDocument().GetFrame()->GetEventHandler().SetPointerCapture(pointer_id,
3083 this); 3087 this);
3088 }
3084 } 3089 }
3085 } 3090 }
3086 3091
3087 void Element::releasePointerCapture(int pointer_id, 3092 void Element::releasePointerCapture(int pointer_id,
3088 ExceptionState& exception_state) { 3093 ExceptionState& exception_state) {
3089 if (GetDocument().GetFrame()) { 3094 if (GetDocument().GetFrame()) {
3090 if (!GetDocument().GetFrame()->GetEventHandler().IsPointerEventActive( 3095 if (!GetDocument().GetFrame()->GetEventHandler().IsPointerEventActive(
3091 pointer_id)) 3096 pointer_id))
3092 exception_state.ThrowDOMException(kInvalidPointerId, "InvalidPointerId"); 3097 exception_state.ThrowDOMException(kInvalidPointerId, "InvalidPointerId");
3093 else 3098 else
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
4353 } 4358 }
4354 4359
4355 DEFINE_TRACE_WRAPPERS(Element) { 4360 DEFINE_TRACE_WRAPPERS(Element) {
4356 if (HasRareData()) { 4361 if (HasRareData()) {
4357 visitor->TraceWrappers(GetElementRareData()); 4362 visitor->TraceWrappers(GetElementRareData());
4358 } 4363 }
4359 ContainerNode::TraceWrappers(visitor); 4364 ContainerNode::TraceWrappers(visitor);
4360 } 4365 }
4361 4366
4362 } // namespace blink 4367 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698