WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-88799-20120611143608.patch (text/plain), 18.31 KB, created by
Vincent Scheib
on 2012-06-11 14:36:09 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Vincent Scheib
Created:
2012-06-11 14:36:09 PDT
Size:
18.31 KB
patch
obsolete
>Subversion Revision: 119965 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 53f16929e4fb5fce8d9e8c0422d4f12b8cc83ffa..4c029141f85bb263dd9d212528438ffc9f6e4910 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2012-06-11 Vincent Scheib <scheib@chromium.org> >+ >+ Add new Pointer Lock spec attribute webkitPointerLockElement. >+ https://bugs.webkit.org/show_bug.cgi?id=88799 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 >+ >+ New attribute webkitPointerLockElement added. Follow up patches >+ will remove the previous isLocked attribute. Tests updated to use >+ the new attribute. >+ >+ * bindings/generic/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::webkitPointerLockElementEnabled): >+ * dom/Document.cpp: >+ (WebCore): >+ (WebCore::Document::webkitPointerLockElement): >+ * dom/Document.h: >+ (Document): >+ * dom/Document.idl: >+ * page/PointerLockController.h: >+ (WebCore::PointerLockController::element): >+ > 2012-06-11 Michael Brüning <michael.bruning@nokia.com> > > [Qt][WK2] Compute and set cache capacities using the current CacheModel >diff --git a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h >index ddd19d8ef16a1fc5822a58024ff70422141b508d..057871af8acc215741cd657b98a0ac9e98b277d1 100644 >--- a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h >@@ -96,6 +96,7 @@ public: > #endif > > #if ENABLE(POINTER_LOCK) >+ static bool pointerLockEnabled() { return isPointerLockEnabled; } > static bool webkitPointerLockEnabled() { return isPointerLockEnabled; } > static void setWebkitPointerLockEnabled(bool isEnabled) { isPointerLockEnabled = isEnabled; } > static bool webkitPointerEnabled() { return isPointerLockEnabled; } >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 26eae8c78a801d5123cec9dac8d409b6317d2587..b514e33dcf1792ea5ef59514d482bfd17fad3565 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -120,6 +120,7 @@ > #include "PageTransitionEvent.h" > #include "PlatformKeyboardEvent.h" > #include "PluginDocument.h" >+#include "PointerLockController.h" > #include "PopStateEvent.h" > #include "ProcessingInstruction.h" > #include "RegisteredEventListener.h" >@@ -5731,6 +5732,13 @@ void Document::addDocumentToFullScreenChangeEventQueue(Document* doc) > } > #endif > >+#if ENABLE(POINTER_LOCK) >+Element* Document::webkitPointerLockElement() const >+{ >+ return page() ? page()->pointerLockController()->element() : 0; >+} >+#endif >+ > void Document::decrementLoadEventDelayCount() > { > ASSERT(m_loadEventDelayCount); >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 8fd8c96764230c2aa590fe0f62ac02b66ae4f924..c3ebb46ef0dd54a7b29c5c40f9b52ac528c4034d 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -1064,6 +1064,10 @@ public: > void webkitExitFullscreen(); > #endif > >+#if ENABLE(POINTER_LOCK) >+ Element* webkitPointerLockElement() const; >+#endif >+ > // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event. > void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } > void decrementLoadEventDelayCount(); >diff --git a/Source/WebCore/dom/Document.idl b/Source/WebCore/dom/Document.idl >index 91334be82ed9ff741283a8a6395b54832071fccf..b52ba846db6873135cbe2d60d2d5dfe2bbda1d3f 100644 >--- a/Source/WebCore/dom/Document.idl >+++ b/Source/WebCore/dom/Document.idl >@@ -257,6 +257,10 @@ module core { > [V8EnabledAtRuntime] void webkitExitFullscreen(); > #endif > >+#if defined(ENABLE_POINTER_LOCK) && ENABLE_POINTER_LOCK >+ readonly attribute [V8EnabledAtRuntime=pointerLock] Element webkitPointerLockElement; >+#endif >+ > #if defined(ENABLE_CSS_REGIONS) && ENABLE_CSS_REGIONS > WebKitNamedFlow webkitGetFlowByName(in DOMString name); > #endif >diff --git a/Source/WebCore/page/PointerLockController.cpp b/Source/WebCore/page/PointerLockController.cpp >index 0bce13414bb33c44ad1ea74dd34ef9d0978917ce..55e46d4f305e171cdf5b54e13b9b76def34e8eb8 100644 >--- a/Source/WebCore/page/PointerLockController.cpp >+++ b/Source/WebCore/page/PointerLockController.cpp >@@ -91,6 +91,11 @@ bool PointerLockController::isLocked() > return m_page->chrome()->client()->isPointerLocked(); > } > >+Element* PointerLockController::element() const >+{ >+ return m_element.get(); >+} >+ > void PointerLockController::didAcquirePointerLock() > { > // FIXME: Keep enqueueEvent usage. (https://bugs.webkit.org/show_bug.cgi?id=84402) >diff --git a/Source/WebCore/page/PointerLockController.h b/Source/WebCore/page/PointerLockController.h >index bfa082249efb283caf20d8c35bfd374e04e8d46b..187308a4b7e1831ace3121318385ca0408213687 100644 >--- a/Source/WebCore/page/PointerLockController.h >+++ b/Source/WebCore/page/PointerLockController.h >@@ -46,6 +46,7 @@ public: > void requestPointerLock(Element* target, PassRefPtr<VoidCallback> successCallback, PassRefPtr<VoidCallback> failureCallback); > void requestPointerUnlock(); > bool isLocked(); >+ Element* element() const; > > void didAcquirePointerLock(); > void didNotAcquirePointerLock(); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 8b8f19b472e3b58b399f2de2bae7d45259f50fe8..6138b3168a3125b98f9c1fde940f4fc84c6cc5ec 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,26 @@ >+2012-06-11 Vincent Scheib <scheib@chromium.org> >+ >+ Add new Pointer Lock spec attribute webkitPointerLockElement. >+ https://bugs.webkit.org/show_bug.cgi?id=88799 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 >+ >+ New attribute webkitPointerLockElement added. Follow up patches >+ will remove the previous isLocked attribute. Tests updated to use >+ the new attribute. >+ >+ WebViewHost logic required modification to correctly repond to >+ a lock, unlock, pointerLockElement call series. Specifically, >+ unlocking must be queued after a lock command is issued always >+ as the lock state may not be set yet with a lock request in flight. >+ >+ * DumpRenderTree/chromium/WebViewHost.cpp: >+ (WebViewHost::requestPointerUnlock): Always post didLosePointerLock task. >+ (WebViewHost::didLosePointerLock): Signal didLosePointerLock only if pointer was locked. >+ > 2012-06-10 Ryosuke Niwa <rniwa@webkit.org> > > Expose layoutTestController as testRunner >diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp >index 196b23ec7d0b62038948ea43f5e6b23eccbe57d5..4abad5b83758587447a2fb99af1e5fcb377ec7ff 100644 >--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp >+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp >@@ -845,8 +845,7 @@ bool WebViewHost::requestPointerLock() > > void WebViewHost::requestPointerUnlock() > { >- if (m_pointerLocked) >- postDelayedTask(new HostMethodTask(this, &WebViewHost::didLosePointerLock), 0); >+ postDelayedTask(new HostMethodTask(this, &WebViewHost::didLosePointerLock), 0); > } > > bool WebViewHost::isPointerLocked() >@@ -869,9 +868,10 @@ void WebViewHost::didNotAcquirePointerLock() > > void WebViewHost::didLosePointerLock() > { >- ASSERT(m_pointerLocked); >+ bool wasLocked = m_pointerLocked; > m_pointerLocked = false; >- webWidget()->didLosePointerLock(); >+ if (wasLocked) >+ webWidget()->didLosePointerLock(); > } > #endif > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 0d22fe39e5f875eddf7ff2dcd8f8defd05ba0ff9..38773c1f5b12389d81d45d20dde531031b87825e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,24 @@ >+2012-06-11 Vincent Scheib <scheib@chromium.org> >+ >+ Add new Pointer Lock spec attribute webkitPointerLockElement. >+ https://bugs.webkit.org/show_bug.cgi?id=88799 >+ >+ 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 >+ >+ New attribute webkitPointerLockElement added. Follow up patches >+ will remove the previous isLocked attribute. Tests updated to use >+ the new attribute. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pointer-lock/lock-already-locked-expected.txt: >+ * pointer-lock/lock-already-locked.html: >+ * pointer-lock/pointer-lock-api-expected.txt: >+ * pointer-lock/pointer-lock-api.html: >+ * pointer-lock/pointerlocklost-event-expected.txt: >+ * pointer-lock/pointerlocklost-event.html: >+ > 2012-06-11 Szilard Ledan <szledan@inf.u-szeged.hu> > > [Qt] Gardening, skip new failing tests. >diff --git a/LayoutTests/pointer-lock/lock-already-locked-expected.txt b/LayoutTests/pointer-lock/lock-already-locked-expected.txt >index 282cfbda2a0255c6d5e0dd66f35db1f82c926617..913c42c0189b76b423880769501df4fdec3b5737 100644 >--- a/LayoutTests/pointer-lock/lock-already-locked-expected.txt >+++ b/LayoutTests/pointer-lock/lock-already-locked-expected.txt >@@ -7,14 +7,18 @@ PASS navigator.webkitPointer.isLocked is false > PASS Lock target1 succeeded. > PASS navigator.webkitPointer.isLocked is true > PASS document.onwebkitpointerlockchange event received. >+PASS document.webkitPointerLockElement is targetdiv1 > PASS Lock target1 succeeded again. > PASS navigator.webkitPointer.isLocked is true > PASS document.onwebkitpointerlockchange event received. >+PASS document.webkitPointerLockElement is targetdiv1 > PASS expectTarget1Unlock is true > PASS Lock target2 succeeded. > PASS navigator.webkitPointer.isLocked is true > PASS document.onwebkitpointerlockchange event received. >+PASS document.webkitPointerLockElement is targetdiv2 > PASS document.onwebkitpointerlockchange event received. >+PASS document.webkitPointerLockElement is targetdiv2 > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/pointer-lock/lock-already-locked.html b/LayoutTests/pointer-lock/lock-already-locked.html >index 281d53b904969453c2f900ef8fe74c02851ae075..697534661526b2d0e5842548f56857316c31ec2b 100644 >--- a/LayoutTests/pointer-lock/lock-already-locked.html >+++ b/LayoutTests/pointer-lock/lock-already-locked.html >@@ -16,8 +16,12 @@ > targetdiv2 = document.getElementById("target2"); > > // Expect change event only for all transitions below. >- document.onwebkitpointerlockchange = >- function () { testPassed("document.onwebkitpointerlockchange event received."); }; >+ expectedTargetToBeLockedString = ""; >+ document.onwebkitpointerlockchange = function () >+ { >+ testPassed("document.onwebkitpointerlockchange event received."); >+ shouldBe("document.webkitPointerLockElement", expectedTargetToBeLockedString); >+ }; > document.onwebkitpointerlockerror = > function () { testFailed("document.onwebkitpointerlockerror event received."); finishJSTest(); }; > >@@ -45,6 +49,7 @@ > testFailed("Lock failed."); > finishJSTest(); > }); >+ expectedTargetToBeLockedString = "targetdiv1"; > }, > function () { > navigator.webkitPointer.lock(targetdiv1, >@@ -57,7 +62,7 @@ > testFailed("Lock failed."); > finishJSTest(); > }); >- >+ expectedTargetToBeLockedString = "targetdiv1"; > }, > function () { > expectTarget1Unlock = true; >@@ -71,7 +76,7 @@ > testFailed("Lock failed."); > finishJSTest(); > }); >- >+ expectedTargetToBeLockedString = "targetdiv2"; > }, > finishJSTest > ]; >diff --git a/LayoutTests/pointer-lock/pointer-lock-api-expected.txt b/LayoutTests/pointer-lock/pointer-lock-api-expected.txt >index 42c11fd5004e11d7dba12d625eacb4c6f3626630..b1d1c8865c08e7442eae4e8bfcaf6ac3da5e61ef 100644 >--- a/LayoutTests/pointer-lock/pointer-lock-api-expected.txt >+++ b/LayoutTests/pointer-lock/pointer-lock-api-expected.txt >@@ -1,12 +1,18 @@ >+Basic API existence test for Pointer Lock. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ > PASS navigator.webkitPointer is defined. > PASS typeof navigator.webkitPointer.isLocked is 'boolean' > PASS navigator.webkitPointer.isLocked is false > PASS navigator.webkitPointer.lock() threw exception TypeError: Not enough arguments. >-PASS navigator.webkitPointer.lock(document) is undefined >+PASS navigator.webkitPointer.lock(document.body) is undefined > PASS navigator.webkitPointer.unlock() is undefined > PASS document.onwebkitpointerlockchange is defined. > PASS document.onwebkitpointerlockerror is defined. >+PASS document.webkitPointerLockElement is null > PASS successfullyParsed is true > > TEST COMPLETE >- >+doNextStep for manual testing >diff --git a/LayoutTests/pointer-lock/pointer-lock-api.html b/LayoutTests/pointer-lock/pointer-lock-api.html >index 97ed7455d336209503faf90ba86e84042ad99a6b..b27da2e4f417b39832e78be756f6b80d0a8179b9 100644 >--- a/LayoutTests/pointer-lock/pointer-lock-api.html >+++ b/LayoutTests/pointer-lock/pointer-lock-api.html >@@ -4,14 +4,43 @@ > <script src="../fast/js/resources/js-test-pre.js"></script> > </head> > <body> >+<button onclick="doNextStep('manual');">doNextStep for manual testing</button> > <script> >- shouldBeDefined("navigator.webkitPointer"); >- shouldEvaluateTo("navigator.webkitPointer.isLocked", false); >- shouldThrow("navigator.webkitPointer.lock()", "'TypeError: Not enough arguments'"); >- shouldEvaluateTo("navigator.webkitPointer.lock(document)", "undefined"); >- shouldEvaluateTo("navigator.webkitPointer.unlock()", "undefined"); >- shouldBeDefined("document.onwebkitpointerlockchange"); >- shouldBeDefined("document.onwebkitpointerlockerror"); >+ description("Basic API existence test for Pointer Lock.") >+ window.jsTestIsAsync = true; >+ >+ currentStep = 0; >+ function doNextStep(manual) >+ { >+ if (!window.layoutTestController && !manual) >+ return; >+ if (currentStep < todo.length) >+ setTimeout(function () { todo[currentStep++](); }, 0); >+ else if (currentStep++ == todo.length) >+ setTimeout(function () { finishJSTest(); }, 0); >+ } >+ todo = [ >+ function () { >+ shouldBeDefined("navigator.webkitPointer"); >+ shouldEvaluateTo("navigator.webkitPointer.isLocked", false); >+ shouldThrow("navigator.webkitPointer.lock()", "'TypeError: Not enough arguments'"); >+ shouldEvaluateTo("navigator.webkitPointer.lock(document.body)", "undefined"); >+ // Exit call stack to allow lock to take effect. >+ doNextStep(); >+ }, >+ function () { >+ shouldEvaluateTo("navigator.webkitPointer.unlock()", "undefined"); >+ // Exit call stack to allow unlock to take effect. >+ doNextStep(); >+ }, >+ function () { >+ shouldBeDefined("document.onwebkitpointerlockchange"); >+ shouldBeDefined("document.onwebkitpointerlockerror"); >+ shouldEvaluateTo("document.webkitPointerLockElement", null); >+ doNextStep(); >+ }, >+ ]; >+ doNextStep(); > </script> > <script src="../fast/js/resources/js-test-post.js"></script> > </body> >diff --git a/LayoutTests/pointer-lock/pointerlocklost-event-expected.txt b/LayoutTests/pointer-lock/pointerlocklost-event-expected.txt >index 60bfadef9c0c3d55ca5e9abbc07740f6298be575..38e383e9806fbb77b04b9cd2cf1f26210276652b 100644 >--- a/LayoutTests/pointer-lock/pointerlocklost-event-expected.txt >+++ b/LayoutTests/pointer-lock/pointerlocklost-event-expected.txt >@@ -5,14 +5,17 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > PASS window.layoutTestController is defined. > PASS navigator.webkitPointer.isLocked is true >+PASS document.webkitPointerLockElement is targetdiv > JavaScript initiated unlock. > PASS webkitpointerlocklost handler call 0 > PASS webkitpointerlocklost handler call 1 > PASS All expected webkitpointerlocklost events received. > PASS onwebkitpointerlockchange received. > PASS All expected onwebkitpointerlockchange events received. >+PASS document.webkitPointerLockElement is null > PASS navigator.webkitPointer.isLocked is false > PASS navigator.webkitPointer.isLocked is true >+PASS document.webkitPointerLockElement is targetdiv > Host initiated unlock. > PASS webkitpointerlocklost handler call 0 > PASS webkitpointerlocklost handler call 1 >@@ -20,6 +23,7 @@ PASS All expected webkitpointerlocklost events received. > PASS onwebkitpointerlockchange received. > PASS All expected onwebkitpointerlockchange events received. > PASS navigator.webkitPointer.isLocked is false >+PASS document.webkitPointerLockElement is null > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/pointer-lock/pointerlocklost-event.html b/LayoutTests/pointer-lock/pointerlocklost-event.html >index 548ff1b72010f983603c944e75918613802fde1e..6daf049542f456c11efac54fcd767c26ba1d5b93 100644 >--- a/LayoutTests/pointer-lock/pointerlocklost-event.html >+++ b/LayoutTests/pointer-lock/pointerlocklost-event.html >@@ -65,12 +65,14 @@ > }); > }, > function () { >+ shouldBe("document.webkitPointerLockElement", "targetdiv"); > debug("JavaScript initiated unlock.") > locklostreceipts = 0; > navigator.webkitPointer.unlock(); > }, > function () { > // locklostHandler will catch unlocks and call doNextStep to bring us here. >+ shouldBe("document.webkitPointerLockElement", "null"); > shouldBe("navigator.webkitPointer.isLocked", "false"); > doNextStep(); > }, >@@ -86,6 +88,7 @@ > }); > }, > function () { >+ shouldBe("document.webkitPointerLockElement", "targetdiv"); > debug("Host initiated unlock.") > lockchangeToUnlockedReceipts = 0; > locklostreceipts = 0; >@@ -94,6 +97,7 @@ > function () { > // locklostHandler will catch unlocks and call doNextStep to bring us here. > shouldBe("navigator.webkitPointer.isLocked", "false"); >+ shouldBe("document.webkitPointerLockElement", "null"); > doNextStep(); > }, > finishJSTest
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 88799
:
146895
|
146915
|
146947