As mentioned in the pointer event spec issue https://github.com/w3c/pointerevents/issues/176 the behavior of the Chrome is incorrect when these two APIs are used at the same time. We need to follow a standard and meaningful behavior for that.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f commit 3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f Author: lanwei <lanwei@chromium.org> Date: Tue May 30 17:09:27 2017 No pointer captured when the pointer lock is applied We want to make the pointer lock always take priority over the capture. There are three cases: 1. If we set a pointer lock, at the same time we want to set the pointer capture as well, we should not set pointer capture and send out 'gotpointercapture' event. 2. After we set a pointer lock, we should throw an error when trying to set any pointer capture. 3. If there is a pointer capture and when trying to request a pointer lock, we should release the pointer capture. Testing pages: http://jsbin.com/zasesu/quiet http://jsbin.com/qabopik/quiet http://jsbin.com/fucewup/quiet BUG= 697581 Review-Url: https://codereview.chromium.org/2807433003 Cr-Commit-Position: refs/heads/master@{#475572} [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/content/browser/renderer_host/input/synthetic_mouse_driver.cc [add] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_after_pointercapture-manual.html [add] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_supercedes_capture-manual.html [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_common_input.js [add] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerlock/pointerevent_pointerlock_after_pointercapture-manual-automation.js [add] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerlock/pointerevent_pointerlock_supercedes_capture-manual-automation.js [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/core/dom/Element.cpp [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.h [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/core/input/EventHandler.cpp [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/core/input/EventHandler.h [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/core/input/PointerEventManager.cpp [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/core/input/PointerEventManager.h [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp [modify] https://crrev.com/3d0d129b2cbc4e9547e34ffbf67a5e872b7d006f/third_party/WebKit/Source/web/WebViewImpl.cpp
Comment 1 by mustaq@chromium.org
, May 18 2017