Changes

Jump to: navigation, search

Implementing the Mouse Lock API in Firefox

221 bytes added, 01:11, 10 December 2011
Tests: Tabulated requirements list
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:
# {| border=1 style="border: 1px solid darkgray;"|Id|Description|Test Author(s)|Test File|-|1|<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'''# |-|2|<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'''# |-|3|"no mouse cursor is displayed" -- mouse cursor should be hidden while locked - |'''dvillase'''# |-|4|<s>navigator.pointer (readonly) is a MouseLockable</s> - |<strong>abhatnagar</strong> - |'''test_navigatorPointer.html'''# |-|5|<s>MouseLockable has lock(), unlock(), islocked()</s> - |<strong>abhatnagar</strong> - |'''test_mouseLockableHasRequiredMethods.html'''# |-|6|<s>islocked() returns true if mouse is locked, false if not locked</s> - |<strong>JSilver999</strong># |-|7|<s>lock(target) expects a DOM element, and takes two optional callbacks: successcallback, failurecallback.</s> - |<strong>JSilver999</strong># |-|8|<s>lock() should return immediately and call callbacks when lock succeeds or fails</s> - |<strong>JSilver999</strong># |-|9|<s>"Mouse lock must succeed only if the window is in focus" - |'''johnno'''</s> - |'''test_UserAgentIsActive.html'''# |-|10|<s>"Mouse lock must succeed only if...the user-agent is the active application of the operating system"</s> - |'''johnno''' - |'''test_UserAgentIsActive.html'''# |-|11|<s>"The target of lock need not be in focus" - </s>|'''johnno'''</s> - |'''file_targetOutOfFocus.html'''# |-|12|<s>"Mouse lock must succeed only if the target is in the DOM tree"</s> - |'''Anachid''' - |'''file_DOMtree.html'''# |-|13|<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'''# |-|14|<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'''# |-|15|<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'''# |-|16|<s>"The Mouse Lock API must provide a default system action to unlock the mouse" namely ESC.</s> - |'''CloudScorpion''' - |'''file_defaultUnlock.html'''# |-|17|<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'''# |-|18|<s>"Events that require the concept of a mouse cursor must not be dispatched (for example: mouseover, mouseout)"</s> - |'''rhung'''# |-|19|"Movement and button presses of the mouse must not cause the window to lose focus" - # |-|20|<s>"Synthetic mouse events created by application script act the same regardless of lock state"</s> - |'''Tentacle'''# |-|21|<s>"The unlock method cancels the mouse lock state"</s> - |'''abhatnagar1'''# |-|22|"[Upon unlock() t]he system mouse cursor must be displayed again and positioned at the same location that it was when mouse lock was entered (the same location that is reported in screenX/Y when the mouse is locked)" - |'''dvillase'''# |-|23|<s>"When mouse lock is lost or disabled for any reason user agents must fire an event named mouselocklost with its bubble attribute set to true to the mouse lock target element"</s> - |'''stsang'''# |-|24|<s>MouseEvent must contain (readonly) movementX and movementY</s> - |'''KeyR, JSilver999'''# |-|25|<s>"The members movementX and movementY must provide the change in position of the mouse, as if the values of screenX/Y were stored between two subsequent mousemove events eNow and ePrevious and the difference taken movementX = eNow.screenX-ePrevious.screenX"</s> - |'''KeyR, JSilver999'''# |-|26|<s>"movementX/Y must be valid regardless of mouse lock state"</s> - |'''KeyR, JSilver999'''# |-|27|<s>"When unlocked, the system cursor can exit and re-enter the user agent window. If it does so and the user agent was not the target of operating system mouse move events then the most recent mouse position will be unknown to the user agent and movementX/Y can not be computed and must be set to zero"</s> - |'''moussa1''' - |'''test_mousePos.html'''# |-|28|<s>"When mouse lock is enabled clientX, clientY, screenX, and screenY must hold constant values as if the mouse did not move at all once mouse lock was entered"</s> - |'''jbraffoul''' - |'''file_constantxy.html'''# |-|29|<s>"The Mouse Lock API must exit the mouse lock state if the user agent, window, or tab loses focus"</s> - |'''drigato''' - |'''test_exitMouselockOnLoseFocus.html'''# |-|30|Test to make sure that mouse lock only occurs when an element is in full screen mode (not F11 or done via the menus). This includes:## Switching focus to another window - |'''jsiu3'''# |-|31|<s>Tests for mouselocklost event</s> - |'''stsang''' - |'''file_mouselocklost.html'''|-|}
====Reviewing Tests====

Navigation menu