1. 09 Jul, 2012 1 commit
    • scheib@chromium.org's avatar
      Refactor common Pointer Lock test code to a harness. · 3684f627
      scheib@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=90813
      
      Reviewed by Adrienne Walker.
      
      * pointer-lock/bug90391-move-then-window-open-crash-expected.txt:
      * pointer-lock/bug90391-move-then-window-open-crash.html:
      * pointer-lock/lock-already-locked-expected.txt:
      * pointer-lock/lock-already-locked.html:
      * pointer-lock/lock-fail-responses-expected.txt:
      * pointer-lock/lock-fail-responses.html:
      * pointer-lock/mouse-event-delivery-expected.txt:
      * pointer-lock/mouse-event-delivery.html:
      * pointer-lock/pointer-lock-api-expected.txt:
      * pointer-lock/pointer-lock-api.html:
      * pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt:
      * pointer-lock/pointerlockchange-pointerlockerror-events.html:
      * pointer-lock/pointerlocklost-event-expected.txt:
      * pointer-lock/pointerlocklost-event.html:
      * pointer-lock/resources/pointer-lock-test-harness.js: Added.
      (doNextStep.else):
      (doNextStepWithUserGesture):
      (eventExpected.targetHanderNode.eventHandlerName):
      (eventExpected):
      (expectOnlyChangeEvent):
      (expectOnlyErrorEvent):
      (expectNoEvents):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3684f627
  2. 15 Jun, 2012 1 commit
    • scheib@chromium.org's avatar
      Add new Pointer Lock spec webkitRequestPointerLock and webkitExitPointerLock methods. · ebbfecc5
      scheib@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=88891
      
      Reviewed by Dimitri Glazkov.
      
      Part of a series of refactoring changes to update pointer lock API to
      the fullscreen locking style. https://bugs.webkit.org/show_bug.cgi?id=84402
      
      Entering and exiting mouse lock is provided in the new webkitRequestPointerLock and
      webkitExitPointerLock methods.
      
      Source/WebCore:
      
      Existing pointer-lock tests updated to use the new methods.
      
      * dom/Document.cpp:
      (WebCore::Document::webkitExitPointerLock):
      (WebCore):
      * dom/Document.h:
      (Document):
      * dom/Document.idl:
      * dom/Element.cpp:
      (WebCore):
      (WebCore::Element::webkitRequestPointerLock):
      * dom/Element.h:
      * dom/Element.idl:
      
      LayoutTests:
      
      Existing tests updated to use the new methods. Also, several updated to
      support manual testing.
      
      * pointer-lock/lock-already-locked-expected.txt:
      * pointer-lock/lock-already-locked.html:
      * pointer-lock/mouse-event-delivery-expected.txt:
      * pointer-lock/mouse-event-delivery.html:
      * pointer-lock/pointer-lock-api-expected.txt:
      * pointer-lock/pointer-lock-api.html:
      * pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt:
      * pointer-lock/pointerlockchange-pointerlockerror-events.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ebbfecc5
  3. 27 Jan, 2012 1 commit
    • scheib@chromium.org's avatar
      Pointer Lock: Implement pointer interface · 32c154ad
      scheib@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=75762
      
      Source/WebCore:
      
      Reviewed by Julien Chaffraix.
      
      Implement the navigator.pointer interface via a new
      PointerLockController class, as per
      http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html.
      
      The implementation is being made in steps, the feature is still behind
      compile-time and run-time flags, 'webkit' prefixed, and not yet enabled
      in any browser. (Chromium has a developer flag required.) Follow-up
      work will include handling DOM elements being removed, making all
      callbacks asynchronous, iframe permissions (similar to Full Screen),
      etc.
      
      PointerLockController maintains state of which Element is the current
      lock target and the success and failure callbacks. ChromeClient has
      methods added to expose the required state change requests.
      
      Tests: pointer-lock/lock-already-locked.html
             pointer-lock/lock-fail-responses.html
             pointer-lock/mouse-event-delivery.html
             pointer-lock/pointerlocklost-event.html
      
      * WebCore.gypi:
      * dom/EventNames.h:
      * page/ChromeClient.h:
      (WebCore::ChromeClient::requestPointerLock):
      (WebCore::ChromeClient::requestPointerUnlock):
      (WebCore::ChromeClient::isPointerLocked):
      * page/Navigator.cpp:
      (WebCore::Navigator::webkitPointer):
      * page/Page.cpp:
      (WebCore::Page::Page):
      * page/Page.h:
      (WebCore::Page::pointerLockController):
      * page/PointerLock.cpp:
      (WebCore::PointerLock::PointerLock):
      (WebCore::PointerLock::create):
      (WebCore::PointerLock::lock):
      (WebCore::PointerLock::unlock):
      (WebCore::PointerLock::isLocked):
      * page/PointerLock.h:
      (WebCore::PointerLock::create):
      * page/PointerLockController.cpp: Added.
      (WebCore::PointerLockController::PointerLockController):
      (WebCore::PointerLockController::requestPointerLock):
      (WebCore::PointerLockController::requestPointerUnlock):
      (WebCore::PointerLockController::isLocked):
      (WebCore::PointerLockController::didAcquirePointerLock):
      (WebCore::PointerLockController::didNotAcquirePointerLock):
      (WebCore::PointerLockController::didLosePointerLock):
      (WebCore::PointerLockController::dispatchLockedMouseEvent):
      * page/PointerLockController.h: Copied from Source/WebCore/page/PointerLock.h.
      
      Source/WebKit/chromium:
      
      Add calls to the PointerLockController added in this patch to WebCore.
      
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::close):
      (WebKit::WebViewImpl::didAcquirePointerLock):
      (WebKit::WebViewImpl::didNotAcquirePointerLock):
      (WebKit::WebViewImpl::didLosePointerLock):
      (WebKit::WebViewImpl::pointerLockMouseEvent):
      
      LayoutTests:
      
      Reviewed by Julien Chaffraix.
      
      * pointer-lock/lock-already-locked-expected.txt: Added.
      * pointer-lock/lock-already-locked.html: Added.
      * pointer-lock/lock-fail-responses-expected.txt: Added.
      * pointer-lock/lock-fail-responses.html: Added.
      * pointer-lock/mouse-event-delivery-expected.txt: Added.
      * pointer-lock/mouse-event-delivery.html: Added.
      * pointer-lock/pointerlocklost-event-expected.txt: Added.
      * pointer-lock/pointerlocklost-event.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      32c154ad