Remove old Pointer Lock API.
authorscheib@chromium.org <scheib@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Aug 2012 23:58:09 +0000 (23:58 +0000)
committerscheib@chromium.org <scheib@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Aug 2012 23:58:09 +0000 (23:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88892

Reviewed by Adam Barth.

Source/WebCore:

Removing the old Pointer Lock API as one of the final cleanup
changes for the Update to Fullscreen style locking Spec meta
bug https://bugs.webkit.org/show_bug.cgi?id=84402.

This change primarily removes idl, access in navigator,
one event, and supporting infrastructure in page/PointerLock.

In PointerLockController changes were already noted clearly with
TODOs differentiating old and new api sections.

Test: pointer-lock/pointerlockchange-event-on-lock-lost.html

* WebCore.gypi:
* dom/Element.cpp:
(WebCore::Element::webkitRequestPointerLock):
* dom/EventNames.h:
(WebCore):
* page/Navigator.cpp:
* page/Navigator.h:
(WebCore):
(Navigator):
* page/Navigator.idl:
* page/PointerLock.cpp: Removed.
* page/PointerLock.h: Removed.
* page/PointerLock.idl: Removed.
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::didAcquirePointerLock):
(WebCore::PointerLockController::didNotAcquirePointerLock):
(WebCore::PointerLockController::didLosePointerLock):
* page/PointerLockController.h:
(PointerLockController):

Source/WebKit/chromium:

* src/WebViewImpl.cpp:
    Removed #include to old API header.

LayoutTests:

Tests for old API removed, and most remaining tests required only small
changes.

* platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt:
* pointer-lock/lock-already-locked-expected.txt:
* pointer-lock/lock-already-locked.html:
* pointer-lock/lock-fail-responses-expected.txt: Removed.
* pointer-lock/lock-fail-responses.html: Removed.
    This test only covered the old API. The related concept is tested
    for the new api in pointerlockchange-pointerlockerror-events.html.
* pointer-lock/pointer-lock-api-expected.txt:
* pointer-lock/pointer-lock-api.html:
* pointer-lock/pointerlockchange-event-on-lock-lost-expected.txt: Added.
* pointer-lock/pointerlockchange-event-on-lock-lost.html: Added.
* pointer-lock/pointerlocklost-event-expected.txt: Removed.
* pointer-lock/pointerlocklost-event.html: Removed.
    pointerlocklost-event.html renamed to pointerlockchange-event-on-lock-lost.html.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124535 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt
LayoutTests/pointer-lock/lock-already-locked-expected.txt
LayoutTests/pointer-lock/lock-already-locked.html
LayoutTests/pointer-lock/lock-fail-responses-expected.txt [deleted file]
LayoutTests/pointer-lock/lock-fail-responses.html [deleted file]
LayoutTests/pointer-lock/pointer-lock-api-expected.txt
LayoutTests/pointer-lock/pointer-lock-api.html
LayoutTests/pointer-lock/pointerlockchange-event-on-lock-lost-expected.txt [new file with mode: 0644]
LayoutTests/pointer-lock/pointerlockchange-event-on-lock-lost.html [new file with mode: 0644]
LayoutTests/pointer-lock/pointerlocklost-event-expected.txt [deleted file]
LayoutTests/pointer-lock/pointerlocklost-event.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/EventNames.h
Source/WebCore/page/Navigator.cpp
Source/WebCore/page/Navigator.h
Source/WebCore/page/Navigator.idl
Source/WebCore/page/PointerLock.cpp [deleted file]
Source/WebCore/page/PointerLock.h [deleted file]
Source/WebCore/page/PointerLock.idl [deleted file]
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/PointerLockController.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp

index 2eb3379..f8f5063 100644 (file)
@@ -1,3 +1,28 @@
+2012-08-02  Vincent Scheib  <scheib@chromium.org>
+
+        Remove old Pointer Lock API.
+        https://bugs.webkit.org/show_bug.cgi?id=88892
+
+        Reviewed by Adam Barth.
+
+        Tests for old API removed, and most remaining tests required only small
+        changes.
+
+        * platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt:
+        * pointer-lock/lock-already-locked-expected.txt:
+        * pointer-lock/lock-already-locked.html:
+        * pointer-lock/lock-fail-responses-expected.txt: Removed.
+        * pointer-lock/lock-fail-responses.html: Removed.
+            This test only covered the old API. The related concept is tested
+            for the new api in pointerlockchange-pointerlockerror-events.html.
+        * pointer-lock/pointer-lock-api-expected.txt:
+        * pointer-lock/pointer-lock-api.html:
+        * pointer-lock/pointerlockchange-event-on-lock-lost-expected.txt: Added.
+        * pointer-lock/pointerlockchange-event-on-lock-lost.html: Added.
+        * pointer-lock/pointerlocklost-event-expected.txt: Removed.
+        * pointer-lock/pointerlocklost-event.html: Removed.
+            pointerlocklost-event.html renamed to pointerlockchange-event-on-lock-lost.html.
+
 2012-08-02  Ryosuke Niwa  <rniwa@webkit.org>
 
         scripts in formaction should be stripped upon paste
index 7f25209..4658d5e 100644 (file)
@@ -18,7 +18,6 @@ navigator.userAgent is OK
 navigator.vendor is OK
 navigator.vendorSub is OK
 navigator.webkitGetGamepads() is OK
-navigator.webkitPointer is OK
 navigator.webkitStartActivity() threw err TypeError: Not enough arguments
 navigator.appCodeName is OK
 navigator.appName is OK
@@ -38,6 +37,5 @@ navigator.userAgent is OK
 navigator.vendor is OK
 navigator.vendorSub is OK
 navigator.webkitGetGamepads() is OK
-navigator.webkitPointer is OK
 navigator.webkitStartActivity() threw err TypeError: Not enough arguments
 
index 13d74c7..477be53 100644 (file)
@@ -11,21 +11,6 @@ PASS document.webkitPointerLockElement is targetdiv1
 PASS document.onwebkitpointerlockchange event received.
 PASS document.webkitPointerLockElement is targetdiv1
      Locking targetdiv2.
-PASS expectTarget1Unlock is true
-PASS document.onwebkitpointerlockchange event received.
-PASS document.webkitPointerLockElement is targetdiv2
-PASS expectTarget2Unlock is true
-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 successfullyParsed is true
index 2a3440e..dbf113e 100644 (file)
             expectedTargetToBeLockedString = "targetdiv2";
             // doNextStep() called by onwebkitpointerlockchange handler.
         },
-        function () {
-            expectTarget1Unlock = false;
-            expectTarget2Unlock = true;
-            navigator.webkitPointer.lock(targetdiv1,
-                function () {
-                    testPassed("Lock target1 succeeded.");
-                    shouldBe("navigator.webkitPointer.isLocked", "true");
-                    // doNextStep() called by onwebkitpointerlockchange handler.
-                },
-                function () {
-                    testFailed("Lock failed.");
-                    finishJSTest();
-                });
-            expectedTargetToBeLockedString = "targetdiv1";
-        },
-        function () {
-            expectTarget2Unlock = false;
-            navigator.webkitPointer.lock(targetdiv1,
-                function () {
-                    testPassed("Lock target1 succeeded again.");
-                    shouldBe("navigator.webkitPointer.isLocked", "true");
-                    // doNextStep() called by onwebkitpointerlockchange handler.
-                },
-                function () {
-                    testFailed("Lock failed.");
-                    finishJSTest();
-                });
-            expectedTargetToBeLockedString = "targetdiv1";
-        },
-        function () {
-            expectTarget1Unlock = true;
-            navigator.webkitPointer.lock(targetdiv2,
-                function () {
-                    testPassed("Lock target2 succeeded.");
-                    shouldBe("navigator.webkitPointer.isLocked", "true");
-                    // doNextStep() called by onwebkitpointerlockchange handler.
-                },
-                function () {
-                    testFailed("Lock failed.");
-                    finishJSTest();
-                });
-            expectedTargetToBeLockedString = "targetdiv2";
-        },
     ];
     doNextStepWithUserGesture();
 </script>
diff --git a/LayoutTests/pointer-lock/lock-fail-responses-expected.txt b/LayoutTests/pointer-lock/lock-fail-responses-expected.txt
deleted file mode 100644 (file)
index 8538d69..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Test asynchronous results of calling lock.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS window.testRunner is defined.
-PASS Lock failed (after we called testRunner.setPointerLockWillFailSynchronously)
-PASS Lock failed (after we called testRunner.setPointerLockWillFailAsynchronously)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/pointer-lock/lock-fail-responses.html b/LayoutTests/pointer-lock/lock-fail-responses.html
deleted file mode 100644 (file)
index b882133..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../http/tests/resources/js-test-pre.js"></script>
-<script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"></script>
-</head>
-<body>
-<script>
-    description("Test asynchronous results of calling lock.")
-    window.jsTestIsAsync = true;
-    shouldBeDefined("window.testRunner");
-
-    todo = [
-        function () {
-            testRunner.setPointerLockWillFailSynchronously();
-            navigator.webkitPointer.lock(document.body,
-                function () {
-                    testFailed("Lock succeeded unexpectedly.");
-                    finishJSTest();
-                },
-                function () {
-                    testPassed("Lock failed (after we called testRunner.setPointerLockWillFailSynchronously)");
-                    doNextStepWithUserGesture();
-                });
-        },
-        function () {
-            testRunner.setPointerLockWillFailAsynchronously();
-            navigator.webkitPointer.lock(document.body,
-                function () {
-                    testFailed("Lock succeeded unexpectedly.");
-                    finishJSTest();
-                },
-                function () {
-                    testPassed("Lock failed (after we called testRunner.setPointerLockWillFailAsynchronously)");
-                    doNextStep();
-                });
-        },
-    ];
-    doNextStepWithUserGesture();
-</script>
-<script src="../http/tests/resources/js-test-post.js"></script>
-</body>
-</html>
index eb2dc98..93a3b25 100644 (file)
@@ -3,12 +3,6 @@ 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.body) is undefined
-PASS navigator.webkitPointer.unlock() is undefined
 PASS document.onwebkitpointerlockchange is defined.
 PASS document.onwebkitpointerlockerror is defined.
 PASS document.webkitExitPointerLock is defined.
index 7075f4e..0fc5e4e 100644 (file)
@@ -2,38 +2,17 @@
 <html>
 <head>
 <script src="../http/tests/resources/js-test-pre.js"></script>
-<script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"></script>
 </head>
 <body>
 <script>
     description("Basic API existence test for Pointer Lock.")
-    window.jsTestIsAsync = true;
 
-    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");
-            shouldBeDefined("document.webkitExitPointerLock");
-            shouldEvaluateTo("document.webkitPointerLockElement", null);
-            element = document.createElement();
-            shouldBeDefined("element.webkitRequestPointerLock");
-            doNextStep();
-        },
-    ];
-    doNextStepWithUserGesture();
+    shouldBeDefined("document.onwebkitpointerlockchange");
+    shouldBeDefined("document.onwebkitpointerlockerror");
+    shouldBeDefined("document.webkitExitPointerLock");
+    shouldEvaluateTo("document.webkitPointerLockElement", null);
+    element = document.createElement();
+    shouldBeDefined("element.webkitRequestPointerLock");
 </script>
 <script src="../http/tests/resources/js-test-post.js"></script>
 </body>
diff --git a/LayoutTests/pointer-lock/pointerlockchange-event-on-lock-lost-expected.txt b/LayoutTests/pointer-lock/pointerlockchange-event-on-lock-lost-expected.txt
new file mode 100644 (file)
index 0000000..2b9ed47
--- /dev/null
@@ -0,0 +1,16 @@
+Test that webkitpointerlockchange event is dispatched when lock is lost.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.testRunner is defined.
+     Lock targetDiv1.
+PASS onwebkitpointerlockchange received after: Lock targetDiv1.
+PASS document.webkitPointerLockElement is targetDiv1
+     Host initiated unlock.
+PASS onwebkitpointerlockchange received after: Host initiated unlock.
+PASS document.webkitPointerLockElement is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/pointer-lock/pointerlockchange-event-on-lock-lost.html b/LayoutTests/pointer-lock/pointerlockchange-event-on-lock-lost.html
new file mode 100644 (file)
index 0000000..01df010
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../http/tests/resources/js-test-pre.js"></script>
+<script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"></script>
+</head>
+<body>
+<div>
+  <div id="target1"></div>
+</div>
+<script>
+    description("Test that webkitpointerlockchange event is dispatched when lock is lost.")
+    window.jsTestIsAsync = true;
+    shouldBeDefined("window.testRunner");
+
+    targetDiv1 = document.getElementById("target1");
+
+    todo = [
+        function () {
+            expectOnlyChangeEvent("Lock targetDiv1.");
+            targetDiv1.webkitRequestPointerLock();
+            // doNextStep called by event handler.
+        },
+        function () {
+            shouldBe("document.webkitPointerLockElement", "targetDiv1");
+            expectOnlyChangeEvent("Host initiated unlock.");
+            testRunner.didLosePointerLock();
+            // doNextStep called by event handler.
+        },
+        function () {
+            shouldBe("document.webkitPointerLockElement", "null");
+            doNextStep();
+        },
+    ];
+    doNextStepWithUserGesture();
+</script>
+<script src="../http/tests/resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/pointer-lock/pointerlocklost-event-expected.txt b/LayoutTests/pointer-lock/pointerlocklost-event-expected.txt
deleted file mode 100644 (file)
index aef0adc..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-Test that pointerlocklost event is dispatched.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS window.testRunner 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
-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
deleted file mode 100644 (file)
index f047088..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../http/tests/resources/js-test-pre.js"></script>
-<script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"></script>
-</head>
-<body>
-<div>
-  <div id="target"></div>
-</div>
-<script>
-    // FIXME: Rename this test to pointerlockchange-event-on-lock-lost. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-
-    description("Test that pointerlocklost event is dispatched.")
-    window.jsTestIsAsync = true;
-    shouldBeDefined("window.testRunner");
-
-    targetdiv = document.getElementById("target");
-
-    // FIXME: Keep pointerlockchange and pointerlockerror event usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-    document.onwebkitpointerlockchange = lockchangeToUnlockedHandler;
-    document.onwebkitpointerlockerror =
-        function () { testFailed("document.onwebkitpointerlockerror dispatched"); finishJSTest(); };
-    lockchangeToUnlockedHandlers = 1;
-
-    lockchangeToUnlockedReceipts = 0;
-    function lockchangeToUnlockedHandler() {
-        if (navigator.webkitPointer.isLocked == false) {
-            testPassed("onwebkitpointerlockchange received.");
-            lockchangeToUnlockedReceipts++;
-            if (lockchangeToUnlockedReceipts == lockchangeToUnlockedHandlers) {
-                testPassed("All expected onwebkitpointerlockchange events received.");
-            }
-        }
-    }
-
-    // FIXME: Remove pointerlocklost usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-    document.addEventListener("webkitpointerlocklost", locklostHandler);
-    targetdiv.addEventListener("webkitpointerlocklost", locklostHandler);
-    locklosthandlers = 2;
-
-    locklostreceipts = 0;
-    function locklostHandler() {
-        testPassed("webkitpointerlocklost handler call " + locklostreceipts);
-        locklostreceipts++;
-        if (locklostreceipts == locklosthandlers) {
-            testPassed("All expected webkitpointerlocklost events received.");
-            doNextStep();
-        }
-    }
-
-    todo = [
-        function () {
-            navigator.webkitPointer.lock(targetdiv,
-                function () {
-                    shouldBe("navigator.webkitPointer.isLocked", "true");
-                    doNextStep();
-                },
-                function () {
-                    testFailed("Lock failed.");
-                    finishJSTest();
-                });
-        },
-        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");
-            doNextStepWithUserGesture();
-        },
-        function () {
-            navigator.webkitPointer.lock(targetdiv,
-                function () {
-                    shouldBe("navigator.webkitPointer.isLocked", "true");
-                    doNextStep();
-                },
-                function () {
-                    testFailed("Lock failed.");
-                    finishJSTest();
-                });
-        },
-        function () {
-            shouldBe("document.webkitPointerLockElement", "targetdiv");
-            debug("Host initiated unlock.")
-            lockchangeToUnlockedReceipts = 0;
-            locklostreceipts = 0;
-            testRunner.didLosePointerLock();
-        },
-        function () {
-            // locklostHandler will catch unlocks and call doNextStep to bring us here.
-            shouldBe("navigator.webkitPointer.isLocked", "false");
-            shouldBe("document.webkitPointerLockElement", "null");
-            doNextStep();
-        },
-    ];
-    doNextStepWithUserGesture();
-</script>
-<script src="../http/tests/resources/js-test-post.js"></script>
-</body>
-</html>
-
index cf715e5..fad22fd 100644 (file)
@@ -1,3 +1,43 @@
+2012-08-02  Vincent Scheib  <scheib@chromium.org>
+
+        Remove old Pointer Lock API.
+        https://bugs.webkit.org/show_bug.cgi?id=88892
+
+        Reviewed by Adam Barth.
+
+        Removing the old Pointer Lock API as one of the final cleanup
+        changes for the Update to Fullscreen style locking Spec meta
+        bug https://bugs.webkit.org/show_bug.cgi?id=84402.
+
+        This change primarily removes idl, access in navigator,
+        one event, and supporting infrastructure in page/PointerLock.
+
+        In PointerLockController changes were already noted clearly with
+        TODOs differentiating old and new api sections.
+
+        Test: pointer-lock/pointerlockchange-event-on-lock-lost.html
+
+        * WebCore.gypi:
+        * dom/Element.cpp:
+        (WebCore::Element::webkitRequestPointerLock):
+        * dom/EventNames.h:
+        (WebCore):
+        * page/Navigator.cpp:
+        * page/Navigator.h:
+        (WebCore):
+        (Navigator):
+        * page/Navigator.idl:
+        * page/PointerLock.cpp: Removed.
+        * page/PointerLock.h: Removed.
+        * page/PointerLock.idl: Removed.
+        * page/PointerLockController.cpp:
+        (WebCore::PointerLockController::requestPointerLock):
+        (WebCore::PointerLockController::didAcquirePointerLock):
+        (WebCore::PointerLockController::didNotAcquirePointerLock):
+        (WebCore::PointerLockController::didLosePointerLock):
+        * page/PointerLockController.h:
+        (PointerLockController):
+
 2012-08-02  Ryosuke Niwa  <rniwa@webkit.org>
 
         scripts in formaction should be stripped upon paste
index cfddfc7..319b2ad 100644 (file)
             'page/PerformanceNavigation.idl',
             'page/PerformanceResourceTiming.idl',
             'page/PerformanceTiming.idl',
-            'page/PointerLock.idl',
             'page/Screen.idl',
             'page/SpeechInputEvent.idl',
             'page/SpeechInputResult.idl',
             'page/PerformanceResourceTiming.h',
             'page/PerformanceTiming.cpp',
             'page/PerformanceTiming.h',
-            'page/PointerLock.cpp',
-            'page/PointerLock.h',
             'page/PointerLockController.cpp',
             'page/PointerLockController.h',
             'page/PrintContext.cpp',
index 581fcf7..ba4033a 100644 (file)
@@ -1934,7 +1934,7 @@ void Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(boo
 void Element::webkitRequestPointerLock()
 {
     if (document()->page())
-        document()->page()->pointerLockController()->requestPointerLock(this, 0, 0);
+        document()->page()->pointerLockController()->requestPointerLock(this);
 }
 #endif
 
index 898da96..05ac9f4 100644 (file)
@@ -229,7 +229,6 @@ namespace WebCore {
     \
     macro(show) \
     \
-    macro(webkitpointerlocklost) \
     macro(webkitpointerlockchange) \
     macro(webkitpointerlockerror) \
     \
index 1af15be..7bf2b5b 100644 (file)
@@ -34,7 +34,6 @@
 #include "Language.h"
 #include "Page.h"
 #include "PluginData.h"
-#include "PointerLock.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
 #include "StorageNamespace.h"
@@ -135,15 +134,6 @@ bool Navigator::javaEnabled() const
     return true;
 }
 
-#if ENABLE(POINTER_LOCK)
-PointerLock* Navigator::webkitPointer() const
-{
-    if (!m_pointer && m_frame && m_frame->page())
-        m_pointer = PointerLock::create(m_frame);
-    return m_pointer.get();
-}
-#endif
-
 void Navigator::getStorageUpdates()
 {
     // FIXME: Remove this method or rename to yieldForStorageUpdates.
index b362b16..81e458a 100644 (file)
@@ -34,7 +34,6 @@ namespace WebCore {
 class DOMMimeTypeArray;
 class DOMPluginArray;
 class Frame;
-class PointerLock;
 class PluginData;
 
 typedef int ExceptionCode;
@@ -53,10 +52,6 @@ public:
 
     virtual String userAgent() const;
 
-#if ENABLE(POINTER_LOCK)
-    PointerLock* webkitPointer() const;
-#endif
-
     // Relinquishes the storage lock, if one exists.
     void getStorageUpdates();
 
@@ -65,9 +60,6 @@ private:
 
     mutable RefPtr<DOMPluginArray> m_plugins;
     mutable RefPtr<DOMMimeTypeArray> m_mimeTypes;
-#if ENABLE(POINTER_LOCK)
-    mutable RefPtr<PointerLock> m_pointer;
-#endif
 };
 
 }
index 8f380a1..3c2af01 100644 (file)
@@ -40,10 +40,6 @@ module window {
 
         readonly attribute boolean onLine;
 
-#if defined(ENABLE_POINTER_LOCK) && ENABLE_POINTER_LOCK // FIXME: Remove reliance on PointerLock.idl when removing old Pointer Lock API. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-        readonly attribute [Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] PointerLock webkitPointer;
-#endif
-
         void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates.
     };
 
diff --git a/Source/WebCore/page/PointerLock.cpp b/Source/WebCore/page/PointerLock.cpp
deleted file mode 100644 (file)
index 9cff8ed..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "PointerLock.h"
-
-#include "Frame.h"
-#include "Page.h"
-#include "PointerLockController.h"
-
-#if ENABLE(POINTER_LOCK)
-
-namespace WebCore {
-
-PointerLock::PointerLock(Frame* frame)
-    : DOMWindowProperty(frame)
-    , m_controller(0)
-{
-    ASSERT(m_frame);
-    m_controller = frame->page()->pointerLockController();
-}
-
-PointerLock::~PointerLock()
-{
-    ASSERT(!m_controller);
-}
-
-void PointerLock::disconnectFrameForPageCache()
-{
-    DOMWindowProperty::disconnectFrameForPageCache();
-    m_controller = 0;
-}
-
-void PointerLock::willDestroyGlobalObjectInFrame()
-{
-    DOMWindowProperty::willDestroyGlobalObjectInFrame();
-    m_controller = 0;
-}
-
-void PointerLock::lock(Element* target, PassRefPtr<VoidCallback> successCallback, PassRefPtr<VoidCallback> failureCallback)
-{
-    if (m_controller)
-        m_controller->requestPointerLock(target, successCallback, failureCallback);
-}
-
-void PointerLock::unlock()
-{
-    if (m_controller)
-        m_controller->requestPointerUnlock();
-}
-
-bool PointerLock::isLocked()
-{
-    return m_controller && m_controller->isLocked();
-}
-
-}
-
-#endif // ENABLE(POINTER_LOCK)
diff --git a/Source/WebCore/page/PointerLock.h b/Source/WebCore/page/PointerLock.h
deleted file mode 100644 (file)
index d1e25fb..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PointerLock_h
-#define PointerLock_h
-
-#if ENABLE(POINTER_LOCK)
-
-#include "DOMWindowProperty.h"
-#include "VoidCallback.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class Element;
-class Frame;
-class PointerLockController;
-
-class PointerLock : public RefCounted<PointerLock>, public DOMWindowProperty {
-public:
-    static PassRefPtr<PointerLock> create(Frame* frame) { return adoptRef(new PointerLock(frame)); }
-
-    ~PointerLock();
-
-    // DOMWindowProperty Interface
-    virtual void disconnectFrameForPageCache() OVERRIDE;
-    virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
-
-    void lock(Element* target, PassRefPtr<VoidCallback> successCallback, PassRefPtr<VoidCallback> failureCallback);
-    void unlock();
-    bool isLocked();
-
-private:
-    explicit PointerLock(Frame*);
-
-    PointerLockController* m_controller;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(POINTER_LOCK)
-
-#endif // PointerLock_h
-
diff --git a/Source/WebCore/page/PointerLock.idl b/Source/WebCore/page/PointerLock.idl
deleted file mode 100644 (file)
index 3054bcf..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-module core {
-
-    interface [
-        Conditional=POINTER_LOCK,
-        OmitConstructor
-    ] PointerLock {
-        void lock(in Element target, in [Callback, Optional] VoidCallback successCallback, in [Callback, Optional] VoidCallback failureCallback);
-        void unlock();
-        readonly attribute boolean isLocked;
-    };
-
-}
index afa8fc4..ad79609 100644 (file)
@@ -46,7 +46,7 @@ PassOwnPtr<PointerLockController> PointerLockController::create(Page* page)
     return adoptPtr(new PointerLockController(page));
 }
 
-void PointerLockController::requestPointerLock(Element* target, PassRefPtr<VoidCallback> successCallback, PassRefPtr<VoidCallback> failureCallback)
+void PointerLockController::requestPointerLock(Element* target)
 {
     if (!target || !target->inDocument() || m_documentOfRemovedElementWhileWaitingForUnlock
         || target->document()->isSandboxed(SandboxPointerLock)) {
@@ -59,33 +59,12 @@ void PointerLockController::requestPointerLock(Element* target, PassRefPtr<VoidC
             enqueueEvent(eventNames().webkitpointerlockerrorEvent, target);
             return;
         }
-
-        // FIXME: Keep enqueueEvent usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
         enqueueEvent(eventNames().webkitpointerlockchangeEvent, target);
-        if (m_element->document() != target->document())
-            enqueueEvent(eventNames().webkitpointerlockchangeEvent, m_element.get());
-
-        // FIXME: Remove callback usage, keep assignment of m_element = target. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-        if (m_element == target) {
-            if (successCallback)
-                successCallback->handleEvent();
-        } else {
-            didLosePointerLock(false);
-            m_element = target;
-            if (successCallback)
-                successCallback->handleEvent();
-        }
+        m_element = target;
     } else if (m_page->chrome()->client()->requestPointerLock()) {
         m_element = target;
-        m_successCallback = successCallback;
-        m_failureCallback = failureCallback;
     } else {
-        // FIXME: Keep enqueueEvent usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
         enqueueEvent(eventNames().webkitpointerlockerrorEvent, target);
-
-        // FIXME: Remove callback usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-        if (failureCallback)
-            failureCallback->handleEvent();
     }
 }
 
@@ -113,11 +92,6 @@ void PointerLockController::documentDetached(Document* document)
     }
 }
 
-bool PointerLockController::isLocked()
-{
-    return m_page->chrome()->client()->isPointerLocked();
-}
-
 Element* PointerLockController::element() const
 {
     return m_element.get();
@@ -125,49 +99,20 @@ Element* PointerLockController::element() const
 
 void PointerLockController::didAcquirePointerLock()
 {
-    // FIXME: Keep enqueueEvent usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
     enqueueEvent(eventNames().webkitpointerlockchangeEvent, m_element.get());
-
-    // FIXME: Remove callback usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-    RefPtr<Element> elementToNotify(m_element);
-    RefPtr<VoidCallback> callbackToIssue(m_successCallback);
-    m_successCallback = 0;
-    m_failureCallback = 0;
-
-    if (callbackToIssue && elementToNotify && elementToNotify->document()->frame())
-        callbackToIssue->handleEvent();
 }
 
 void PointerLockController::didNotAcquirePointerLock()
 {
-    // FIXME: Keep enqueueEvent usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
     enqueueEvent(eventNames().webkitpointerlockerrorEvent, m_element.get());
-
-    // FIXME: Remove callback usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-    RefPtr<Element> elementToNotify(m_element);
-    RefPtr<VoidCallback> callbackToIssue(m_failureCallback);
     m_element = 0;
-    m_successCallback = 0;
-    m_failureCallback = 0;
-
-    if (callbackToIssue && elementToNotify && elementToNotify->document()->frame())
-        callbackToIssue->handleEvent();
 }
 
-void PointerLockController::didLosePointerLock(bool sendChangeEvent)
+void PointerLockController::didLosePointerLock()
 {
-    // FIXME: Keep enqueueEvent usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-    if (sendChangeEvent)
-        enqueueEvent(eventNames().webkitpointerlockchangeEvent, m_element ? m_element->document() : m_documentOfRemovedElementWhileWaitingForUnlock.get());
-
-    // FIXME: Remove callback usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-    RefPtr<Element> elementToNotify(m_element);
+    enqueueEvent(eventNames().webkitpointerlockchangeEvent, m_element ? m_element->document() : m_documentOfRemovedElementWhileWaitingForUnlock.get());
     m_element = 0;
     m_documentOfRemovedElementWhileWaitingForUnlock = 0;
-    m_successCallback = 0;
-    m_failureCallback = 0;
-    if (elementToNotify && elementToNotify->document()->frame())
-        elementToNotify->dispatchEvent(Event::create(eventNames().webkitpointerlocklostEvent, true, false));
 }
 
 void PointerLockController::dispatchLockedMouseEvent(const PlatformMouseEvent& event, const AtomicString& eventType)
index 991754e..a942f93 100644 (file)
@@ -44,16 +44,15 @@ class PointerLockController {
 public:
     static PassOwnPtr<PointerLockController> create(Page*);
 
-    void requestPointerLock(Element* target, PassRefPtr<VoidCallback> successCallback, PassRefPtr<VoidCallback> failureCallback);
+    void requestPointerLock(Element* target);
     void requestPointerUnlock();
     void elementRemoved(Element*);
     void documentDetached(Document*);
-    bool isLocked(); // FIXME: Rename to isClientLocked and move to private when removing old API. (https://bugs.webkit.org/show_bug.cgi?id=84402)
     Element* element() const;
 
     void didAcquirePointerLock();
     void didNotAcquirePointerLock();
-    void didLosePointerLock(bool sendChangeEvent = true); // FIXME: Remove sendChangeEvent parameter when removing old API. (https://bugs.webkit.org/show_bug.cgi?id=84402)
+    void didLosePointerLock();
     void dispatchLockedMouseEvent(const PlatformMouseEvent&, const AtomicString& eventType);
 
 private:
@@ -63,10 +62,6 @@ private:
     Page* m_page;
     RefPtr<Element> m_element;
     RefPtr<Document> m_documentOfRemovedElementWhileWaitingForUnlock;
-
-    // FIXME: Remove callback usage. (https://bugs.webkit.org/show_bug.cgi?id=84402)
-    RefPtr<VoidCallback> m_successCallback;
-    RefPtr<VoidCallback> m_failureCallback;
 };
 
 } // namespace WebCore
index 009a320..620caba 100644 (file)
@@ -1,3 +1,13 @@
+2012-08-02  Vincent Scheib  <scheib@chromium.org>
+
+        Remove old Pointer Lock API.
+        https://bugs.webkit.org/show_bug.cgi?id=88892
+
+        Reviewed by Adam Barth.
+
+        * src/WebViewImpl.cpp:
+            Removed #include to old API header.
+
 2012-08-02  Tien-Ren Chen  <trchen@chromium.org>
 
         [chromium] Add CCScrollbarAnimationController class for compositor scrollbar animation
index 4eeda0b..d897322 100644 (file)
@@ -98,7 +98,6 @@
 #include "PlatformMouseEvent.h"
 #include "PlatformThemeChromiumLinux.h"
 #include "PlatformWheelEvent.h"
-#include "PointerLock.h"
 #include "PointerLockController.h"
 #include "PopupContainer.h"
 #include "PopupMenuClient.h"