Changeset 120031 in webkit
- Timestamp:
- Jun 11, 2012 8:02:16 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r120028 r120031 1 2012-06-11 Vincent Scheib <scheib@chromium.org> 2 3 Add new Pointer Lock spec attribute webkitPointerLockElement. 4 https://bugs.webkit.org/show_bug.cgi?id=88799 5 6 Part of a series of refactoring changes to update pointer lock API to 7 the fullscreen locking style. https://bugs.webkit.org/show_bug.cgi?id=84402 8 9 New attribute webkitPointerLockElement added. Follow up patches 10 will remove the previous isLocked attribute. Tests updated to use 11 the new attribute. 12 13 Reviewed by Dimitri Glazkov. 14 15 * pointer-lock/lock-already-locked-expected.txt: 16 * pointer-lock/lock-already-locked.html: 17 * pointer-lock/pointer-lock-api-expected.txt: 18 * pointer-lock/pointer-lock-api.html: 19 * pointer-lock/pointerlocklost-event-expected.txt: 20 * pointer-lock/pointerlocklost-event.html: 21 1 22 2012-06-11 Dominic Cooney <dominicc@chromium.org> 2 23 -
trunk/LayoutTests/pointer-lock/lock-already-locked-expected.txt
r119763 r120031 8 8 PASS navigator.webkitPointer.isLocked is true 9 9 PASS document.onwebkitpointerlockchange event received. 10 PASS document.webkitPointerLockElement is targetdiv1 10 11 PASS Lock target1 succeeded again. 11 12 PASS navigator.webkitPointer.isLocked is true 12 13 PASS document.onwebkitpointerlockchange event received. 14 PASS document.webkitPointerLockElement is targetdiv1 13 15 PASS expectTarget1Unlock is true 14 16 PASS Lock target2 succeeded. 15 17 PASS navigator.webkitPointer.isLocked is true 16 18 PASS document.onwebkitpointerlockchange event received. 19 PASS document.webkitPointerLockElement is targetdiv2 17 20 PASS document.onwebkitpointerlockchange event received. 21 PASS document.webkitPointerLockElement is targetdiv2 18 22 PASS successfullyParsed is true 19 23 -
trunk/LayoutTests/pointer-lock/lock-already-locked.html
r119763 r120031 17 17 18 18 // Expect change event only for all transitions below. 19 document.onwebkitpointerlockchange = 20 function () { testPassed("document.onwebkitpointerlockchange event received."); }; 19 expectedTargetToBeLockedString = ""; 20 document.onwebkitpointerlockchange = function () 21 { 22 testPassed("document.onwebkitpointerlockchange event received."); 23 shouldBe("document.webkitPointerLockElement", expectedTargetToBeLockedString); 24 }; 21 25 document.onwebkitpointerlockerror = 22 26 function () { testFailed("document.onwebkitpointerlockerror event received."); finishJSTest(); }; … … 46 50 finishJSTest(); 47 51 }); 52 expectedTargetToBeLockedString = "targetdiv1"; 48 53 }, 49 54 function () { … … 58 63 finishJSTest(); 59 64 }); 60 65 expectedTargetToBeLockedString = "targetdiv1"; 61 66 }, 62 67 function () { … … 72 77 finishJSTest(); 73 78 }); 74 79 expectedTargetToBeLockedString = "targetdiv2"; 75 80 }, 76 81 finishJSTest -
trunk/LayoutTests/pointer-lock/pointer-lock-api-expected.txt
r119763 r120031 1 Basic API existence test for Pointer Lock. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 1 6 PASS navigator.webkitPointer is defined. 2 7 PASS typeof navigator.webkitPointer.isLocked is 'boolean' 3 8 PASS navigator.webkitPointer.isLocked is false 4 9 PASS navigator.webkitPointer.lock() threw exception TypeError: Not enough arguments. 5 PASS navigator.webkitPointer.lock(document ) is undefined10 PASS navigator.webkitPointer.lock(document.body) is undefined 6 11 PASS navigator.webkitPointer.unlock() is undefined 7 12 PASS document.onwebkitpointerlockchange is defined. 8 13 PASS document.onwebkitpointerlockerror is defined. 14 PASS document.webkitPointerLockElement is null 9 15 PASS successfullyParsed is true 10 16 11 17 TEST COMPLETE 12 18 doNextStep for manual testing -
trunk/LayoutTests/pointer-lock/pointer-lock-api.html
r119763 r120031 5 5 </head> 6 6 <body> 7 <button onclick="doNextStep('manual');">doNextStep for manual testing</button> 7 8 <script> 8 shouldBeDefined("navigator.webkitPointer"); 9 shouldEvaluateTo("navigator.webkitPointer.isLocked", false); 10 shouldThrow("navigator.webkitPointer.lock()", "'TypeError: Not enough arguments'"); 11 shouldEvaluateTo("navigator.webkitPointer.lock(document)", "undefined"); 12 shouldEvaluateTo("navigator.webkitPointer.unlock()", "undefined"); 13 shouldBeDefined("document.onwebkitpointerlockchange"); 14 shouldBeDefined("document.onwebkitpointerlockerror"); 9 description("Basic API existence test for Pointer Lock.") 10 window.jsTestIsAsync = true; 11 12 currentStep = 0; 13 function doNextStep(manual) 14 { 15 if (!window.layoutTestController && !manual) 16 return; 17 if (currentStep < todo.length) 18 setTimeout(function () { todo[currentStep++](); }, 0); 19 else if (currentStep++ == todo.length) 20 setTimeout(function () { finishJSTest(); }, 0); 21 } 22 todo = [ 23 function () { 24 shouldBeDefined("navigator.webkitPointer"); 25 shouldEvaluateTo("navigator.webkitPointer.isLocked", false); 26 shouldThrow("navigator.webkitPointer.lock()", "'TypeError: Not enough arguments'"); 27 shouldEvaluateTo("navigator.webkitPointer.lock(document.body)", "undefined"); 28 // Exit call stack to allow lock to take effect. 29 doNextStep(); 30 }, 31 function () { 32 shouldEvaluateTo("navigator.webkitPointer.unlock()", "undefined"); 33 // Exit call stack to allow unlock to take effect. 34 doNextStep(); 35 }, 36 function () { 37 shouldBeDefined("document.onwebkitpointerlockchange"); 38 shouldBeDefined("document.onwebkitpointerlockerror"); 39 shouldEvaluateTo("document.webkitPointerLockElement", null); 40 doNextStep(); 41 }, 42 ]; 43 doNextStep(); 15 44 </script> 16 45 <script src="../fast/js/resources/js-test-post.js"></script> -
trunk/LayoutTests/pointer-lock/pointerlocklost-event-expected.txt
r119763 r120031 6 6 PASS window.layoutTestController is defined. 7 7 PASS navigator.webkitPointer.isLocked is true 8 PASS document.webkitPointerLockElement is targetdiv 8 9 JavaScript initiated unlock. 9 10 PASS webkitpointerlocklost handler call 0 … … 12 13 PASS onwebkitpointerlockchange received. 13 14 PASS All expected onwebkitpointerlockchange events received. 15 PASS document.webkitPointerLockElement is null 14 16 PASS navigator.webkitPointer.isLocked is false 15 17 PASS navigator.webkitPointer.isLocked is true 18 PASS document.webkitPointerLockElement is targetdiv 16 19 Host initiated unlock. 17 20 PASS webkitpointerlocklost handler call 0 … … 21 24 PASS All expected onwebkitpointerlockchange events received. 22 25 PASS navigator.webkitPointer.isLocked is false 26 PASS document.webkitPointerLockElement is null 23 27 PASS successfullyParsed is true 24 28 -
trunk/LayoutTests/pointer-lock/pointerlocklost-event.html
r119763 r120031 66 66 }, 67 67 function () { 68 shouldBe("document.webkitPointerLockElement", "targetdiv"); 68 69 debug("JavaScript initiated unlock.") 69 70 locklostreceipts = 0; … … 72 73 function () { 73 74 // locklostHandler will catch unlocks and call doNextStep to bring us here. 75 shouldBe("document.webkitPointerLockElement", "null"); 74 76 shouldBe("navigator.webkitPointer.isLocked", "false"); 75 77 doNextStep(); … … 87 89 }, 88 90 function () { 91 shouldBe("document.webkitPointerLockElement", "targetdiv"); 89 92 debug("Host initiated unlock.") 90 93 lockchangeToUnlockedReceipts = 0; … … 95 98 // locklostHandler will catch unlocks and call doNextStep to bring us here. 96 99 shouldBe("navigator.webkitPointer.isLocked", "false"); 100 shouldBe("document.webkitPointerLockElement", "null"); 97 101 doNextStep(); 98 102 }, -
trunk/Source/WebCore/ChangeLog
r120030 r120031 1 2012-06-11 Vincent Scheib <scheib@chromium.org> 2 3 Add new Pointer Lock spec attribute webkitPointerLockElement. 4 https://bugs.webkit.org/show_bug.cgi?id=88799 5 6 Reviewed by Dimitri Glazkov. 7 8 Part of a series of refactoring changes to update pointer lock API to 9 the fullscreen locking style. https://bugs.webkit.org/show_bug.cgi?id=84402 10 11 New attribute webkitPointerLockElement added. Follow up patches 12 will remove the previous isLocked attribute. Tests updated to use 13 the new attribute. 14 15 * bindings/generic/RuntimeEnabledFeatures.h: 16 (WebCore::RuntimeEnabledFeatures::webkitPointerLockElementEnabled): 17 * dom/Document.cpp: 18 (WebCore): 19 (WebCore::Document::webkitPointerLockElement): 20 * dom/Document.h: 21 (Document): 22 * dom/Document.idl: 23 * page/PointerLockController.h: 24 (WebCore::PointerLockController::element): 25 1 26 2012-06-11 Vincent Scheib <scheib@chromium.org> 2 27 -
trunk/Source/WebCore/dom/Document.cpp
r119895 r120031 121 121 #include "PlatformKeyboardEvent.h" 122 122 #include "PluginDocument.h" 123 #include "PointerLockController.h" 123 124 #include "PopStateEvent.h" 124 125 #include "ProcessingInstruction.h" … … 5732 5733 #endif 5733 5734 5735 #if ENABLE(POINTER_LOCK) 5736 Element* Document::webkitPointerLockElement() const 5737 { 5738 return page() ? page()->pointerLockController()->element() : 0; 5739 } 5740 #endif 5741 5734 5742 void Document::decrementLoadEventDelayCount() 5735 5743 { -
trunk/Source/WebCore/dom/Document.h
r119937 r120031 1065 1065 #endif 1066 1066 1067 #if ENABLE(POINTER_LOCK) 1068 Element* webkitPointerLockElement() const; 1069 #endif 1070 1067 1071 // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event. 1068 1072 void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } -
trunk/Source/WebCore/dom/Document.idl
r120030 r120031 257 257 [V8EnabledAtRuntime] void webkitExitFullscreen(); 258 258 #endif 259 260 readonly attribute [Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] Element webkitPointerLockElement; 259 261 260 262 #if defined(ENABLE_CSS_REGIONS) && ENABLE_CSS_REGIONS -
trunk/Source/WebCore/page/PointerLockController.cpp
r119763 r120031 92 92 } 93 93 94 Element* PointerLockController::element() const 95 { 96 return m_element.get(); 97 } 98 94 99 void PointerLockController::didAcquirePointerLock() 95 100 { -
trunk/Source/WebCore/page/PointerLockController.h
r119763 r120031 47 47 void requestPointerUnlock(); 48 48 bool isLocked(); 49 Element* element() const; 49 50 50 51 void didAcquirePointerLock(); -
trunk/Tools/ChangeLog
r120029 r120031 1 2012-06-11 Vincent Scheib <scheib@chromium.org> 2 3 Add new Pointer Lock spec attribute webkitPointerLockElement. 4 https://bugs.webkit.org/show_bug.cgi?id=88799 5 6 Reviewed by Dimitri Glazkov. 7 8 Part of a series of refactoring changes to update pointer lock API to 9 the fullscreen locking style. https://bugs.webkit.org/show_bug.cgi?id=84402 10 11 New attribute webkitPointerLockElement added. Follow up patches 12 will remove the previous isLocked attribute. Tests updated to use 13 the new attribute. 14 15 WebViewHost logic required modification to correctly repond to 16 a lock, unlock, pointerLockElement call series. Specifically, 17 unlocking must be queued after a lock command is issued always 18 as the lock state may not be set yet with a lock request in flight. 19 20 * DumpRenderTree/chromium/WebViewHost.cpp: 21 (WebViewHost::requestPointerUnlock): Always post didLosePointerLock task. 22 (WebViewHost::didLosePointerLock): Signal didLosePointerLock only if pointer was locked. 23 1 24 2012-06-11 Alexis Menard <alexis.menard@openbossa.org> 2 25 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r119832 r120031 846 846 void WebViewHost::requestPointerUnlock() 847 847 { 848 if (m_pointerLocked) 849 postDelayedTask(new HostMethodTask(this, &WebViewHost::didLosePointerLock), 0); 848 postDelayedTask(new HostMethodTask(this, &WebViewHost::didLosePointerLock), 0); 850 849 } 851 850 … … 870 869 void WebViewHost::didLosePointerLock() 871 870 { 872 ASSERT(m_pointerLocked);871 bool wasLocked = m_pointerLocked; 873 872 m_pointerLocked = false; 874 webWidget()->didLosePointerLock(); 873 if (wasLocked) 874 webWidget()->didLosePointerLock(); 875 875 } 876 876 #endif
Note: See TracChangeset
for help on using the changeset viewer.