Cursor is not visible after exiting full screen video
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Dec 2017 22:47:04 +0000 (22:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Dec 2017 22:47:04 +0000 (22:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180247
<rdar://problem/33885922>

Patch by Antoine Quint <graouts@apple.com> on 2017-12-04
Reviewed by Dean Jackson.

Source/WebCore:

There is a dedicated NSCursor method to temporarily hide the mouse cursor while the mouse is idle,
so we use this platform functionality, already exposed through the page chrome, instead which
implements the expected behavior. Now, the mouse cursor is hidden while the mouse is stationary
when a <video> is fullscreen, as before, but as soon as the user exits fullscreen, the mouse cursor
reappears.

No test provided as I don't believe this platform behavior can be tested, there is no API to query
whether the cursor is visible.

* page/EventHandler.cpp:
(WebCore::EventHandler::cancelAutoHideCursorTimer):
(WebCore::EventHandler::autoHideCursorTimerFired):

LayoutTests:

Remove the existing test which would query a cursor state that is no longer relevant.

* fullscreen/video-cursor-auto-hide-expected.txt: Removed.
* fullscreen/video-cursor-auto-hide.html: Removed.
* platform/gtk/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/fullscreen/video-cursor-auto-hide-expected.txt [deleted file]
LayoutTests/fullscreen/video-cursor-auto-hide.html [deleted file]
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp

index 042278e..a381a0a 100644 (file)
@@ -1,3 +1,17 @@
+2017-12-04  Antoine Quint  <graouts@apple.com>
+
+        Cursor is not visible after exiting full screen video
+        https://bugs.webkit.org/show_bug.cgi?id=180247
+        <rdar://problem/33885922>
+
+        Reviewed by Dean Jackson.
+
+        Remove the existing test which would query a cursor state that is no longer relevant.
+
+        * fullscreen/video-cursor-auto-hide-expected.txt: Removed.
+        * fullscreen/video-cursor-auto-hide.html: Removed.
+        * platform/gtk/TestExpectations:
+
 2017-12-04  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [GTK] Unreviewed layout test gardening
diff --git a/LayoutTests/fullscreen/video-cursor-auto-hide-expected.txt b/LayoutTests/fullscreen/video-cursor-auto-hide-expected.txt
deleted file mode 100644 (file)
index a6b2b12..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-This tests that the cursor hides after hovering over a video element in full screen mode.
-
-
-EVENT(webkitfullscreenchange)
-EXPECTED (window.internals.getCurrentCursorInfo() == 'type=Pointer hotSpot=0,0') OK
-EXPECTED (window.internals.getCurrentCursorInfo() == 'type=None hotSpot=0,0') OK
-END OF TEST
-
diff --git a/LayoutTests/fullscreen/video-cursor-auto-hide.html b/LayoutTests/fullscreen/video-cursor-auto-hide.html
deleted file mode 100644 (file)
index f1c49a8..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<body>
-    <p>This tests that the cursor hides after hovering over a video element in full screen mode.</p>
-    <div id=wrapper>
-        <video id="video" width="300"></video>
-    </div>
-    <script src="full-screen-test.js"></script>
-    <script>
-        var wrapper = document.getElementById('wrapper');
-
-        function checkForHiddenMouse()
-        {
-            testExpected('window.internals.getCurrentCursorInfo()', 'type=None hotSpot=0,0');
-            endTest();
-        }
-
-        function fullscreenChanged(event)
-        {
-            if (window.internals) {
-                internals.settings.setTimeWithoutMouseMovementBeforeHidingControls(0);
-                wrapperBox = internals.boundingBox(wrapper);
-                eventSender.mouseMoveTo(wrapperBox.left + wrapperBox.width / 2, wrapperBox.top + wrapperBox.height / 2);
-                testExpected('window.internals.getCurrentCursorInfo()', 'type=Pointer hotSpot=0,0');
-                setTimeout(checkForHiddenMouse, 0);
-            }
-            else
-                logResult(false, "window.internals == undefined");
-        }
-        waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
-        runWithKeyDown(function(){wrapper.webkitRequestFullScreen()});
-    </script>
-</body>
index 315ae9a..a091616 100644 (file)
@@ -903,9 +903,6 @@ Bug(GTK) editing/spelling/markers.html [ Skip ]
 # Requires ENABLE(MEDIA_CAPTURE)
 webkit.org/b/85958 fast/forms/file/file-input-capture.html [ Failure ]
 
-# CURSOR_VISIBILITY is not enabled in gtk
-webkit.org/b/107601 fullscreen/video-cursor-auto-hide.html [ Failure ]
-
 webkit.org/b/146718 accessibility/aria-hidden-false-works-in-subtrees.html [ Failure ]
 
 webkit.org/b/146720 media/accessiblity-describes-video.html [ Failure ]
index 3aea2c5..a650b4b 100644 (file)
@@ -1,3 +1,24 @@
+2017-12-04  Antoine Quint  <graouts@apple.com>
+
+        Cursor is not visible after exiting full screen video
+        https://bugs.webkit.org/show_bug.cgi?id=180247
+        <rdar://problem/33885922>
+
+        Reviewed by Dean Jackson.
+
+        There is a dedicated NSCursor method to temporarily hide the mouse cursor while the mouse is idle,
+        so we use this platform functionality, already exposed through the page chrome, instead which
+        implements the expected behavior. Now, the mouse cursor is hidden while the mouse is stationary
+        when a <video> is fullscreen, as before, but as soon as the user exits fullscreen, the mouse cursor
+        reappears.
+
+        No test provided as I don't believe this platform behavior can be tested, there is no API to query
+        whether the cursor is visible.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::cancelAutoHideCursorTimer):
+        (WebCore::EventHandler::autoHideCursorTimerFired):
+
 2017-12-04  Chris Dumez  <cdumez@apple.com>
 
         ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) is unsafe
index d82a96c..341556b 100644 (file)
@@ -1589,14 +1589,19 @@ void EventHandler::cancelAutoHideCursorTimer()
 {
     if (m_autoHideCursorTimer.isActive())
         m_autoHideCursorTimer.stop();
+
+    if (auto page = m_frame.page())
+        page->chrome().setCursorHiddenUntilMouseMoves(false);
 }
 
 void EventHandler::autoHideCursorTimerFired()
 {
-    m_currentMouseCursor = noneCursor();
     FrameView* view = m_frame.view();
-    if (view && view->isActive())
-        view->setCursor(m_currentMouseCursor);
+    if (!view || !view->isActive())
+        return;
+
+    if (auto page = m_frame.page())
+        page->chrome().setCursorHiddenUntilMouseMoves(true);
 }
 #endif