Background about the MouseLock API
Before I continue, I noticed I missed some intro as to what the MouseLock API is about. So, here is small summary.
From the draft specifications:
The Mouse Lock API provides for input methods of applications based on the movement of the mouse, not just the absolute position of a cursor. A popular example is that of first person movement controls in three dimensional graphics applications such as games. Movement of the mouse is interpreted for rotation of the view-port, there is no limit to how far movement can go, and no mouse cursor is displayed.
Mouse Lock is related to Mouse Capture. Capture provides continued event delivery to a target element while a mouse is being dragged, but ceases when the mouse button is released. Mouse Lock differs by being persistent, not limited by screen boundaries, sending events regardless of mouse button state, hiding the cursor, and not releasing until an API call or specific release gesture by the user.
My Recent Contributions
Going back to my topic of this post, I wrote a small test scenario that is used to check for two conditions:
- “Mouse lock must succeed only if the target is in the DOM tree”
- “If the target is removed from the DOM tree after mouse lock is entered then mouse lock will be lost.”
While running Mochitest, my biggest issue was compiling the code multiple number of times for every change of my test. This caused a big problem when debugging my test as I had to wait 17-26 mins for the code to re-compile when I change the code. This issue may exists only on Windows environment as a friend of mine didn’t experience the problem (he runs his build on those expensive machines called a Mac).
Now that I have uploaded my code along with the rest of the people working on this MouseLock, we are awaiting a review of our code when we push it up to Mozilla’s repositories.
Below if the screen of my test working: