Chromium Code Reviews| 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 af710a5670f2b3475c8303f1f71f48bc76d84b35..2e3a39a28ce2bd838d0a5e96dfbc9a894d4604a0 100644 |
| --- a/third_party/WebKit/Source/core/dom/Element.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp |
| @@ -3074,14 +3074,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() |
|
mustaq
2017/05/26 14:56:18
Nit: Combine with the above |if| with an OR, since
lanwei
2017/05/29 18:30:07
Done.
|
| + .GetPage() |
| + ->GetPointerLockController() |
| + .GetElement()) { |
| + exception_state.ThrowDOMException(kInvalidStateError, |
| + "InvalidStateError"); |
| + } else { |
| GetDocument().GetFrame()->GetEventHandler().SetPointerCapture(pointer_id, |
| this); |
| + } |
| } |
| } |