Changes

Jump to: navigation, search

Implementing the Mouse Lock API in Firefox

82 bytes added, 00:13, 10 December 2011
Tests
The central repo with all the tests are located [https://github.com/rhung/mozilla-central/tree/mouselock-tests here]. For more information on how to make mochitests and how to send the pull request to the appropriate person, check out the [http://zenit.senecac.on.ca/wiki/index.php/Mochitest_FAQ Mochitest FAQ] List tests we need below:
# <s>"there is no limit to how far movement can go...not limited by screen boundaries" -- mouse lock should mean infinite movement in the X and Y axes...There will be no limit to movementX/Y values if the mouse is continuously moved in a single direction"</s> - '''hchun''' - '''file_limitlessScroll.html'''# <s>"The concept of the mouse cursor will have been removed, and it will not move off the window or be clamped by a screen edge"</s> - '''hchun''' - '''file_limitlessScroll.html'''
# "no mouse cursor is displayed" -- mouse cursor should be hidden while locked - '''dvillase'''
# <s>navigator.pointer (readonly) is a MouseLockable</s> - <strong>abhatnagar</strong> - '''test_navigatorPointer.html'''# <s>MouseLockable has lock(), unlock(), islocked()</s> - <strong>abhatnagar</strong> - '''test_mouseLockableHasRequiredMethods.html'''
# <s>islocked() returns true if mouse is locked, false if not locked</s> - <strong>JSilver999</strong>
# <s>lock(target) expects a DOM element, and takes two optional callbacks: successcallback, failurecallback.</s> - <strong>JSilver999</strong>
# <s>lock() should return immediately and call callbacks when lock succeeds or fails</s> - <strong>JSilver999</strong>
# <s>"Mouse lock must succeed only if the window is in focus" - '''johnno'''</s> - '''test_UserAgentIsActive.html'''# <s>"Mouse lock must succeed only if...the user-agent is the active application of the operating system"</s> - '''johnno''' - '''test_UserAgentIsActive.html'''# <s>"The target of lock need not be in focus" - '''johnno'''</s> - '''file_targetOutOfFocus.html'''# <s>"Mouse lock must succeed only if the target is in the DOM tree"</s> - '''Anachid''' - '''file_DOMtree.html'''# <s>"If the target is removed from the DOM tree after mouse lock is entered then mouse lock will be lost."</s> - '''Anachid''' - '''file_DOMtree.html'''# <s>"If the mouse is already locked to the same element, a repeated call to lock will succeed and the successCallback called"</s> - '''jboelen''' - '''test_doubleLockCallBack.html'''# <s>"If another element is locked [and lock() is called] a user agent must transfer the mouse lock to the new target and call the mouselocklost callback for the previous target"</s> - '''jboelen''' - '''DEFUNCT'''# <s>"The Mouse Lock API must provide a default system action to unlock the mouse" namely ESC.</s> - '''CloudScorpion''' - '''file_defaultUnlock.html'''
# <s>"Once in the locked state the user agent must fire all relevant user generated MouseEvent events (for example: mousemove, mousedown, mouseup, click, wheel)[DOM-LEVEL-3-CORE] to the target of mouse lock, and not fire mouse events to other elements"</s> - '''rhung'''
# <s>"Events that require the concept of a mouse cursor must not be dispatched (for example: mouseover, mouseout)"</s> - '''rhung'''

Navigation menu