Title: [225494] trunk
Revision
225494
Author
commit-qu...@webkit.org
Date
2017-12-04 14:47:04 -0800 (Mon, 04 Dec 2017)

Log Message

Cursor is not visible after exiting full screen video
https://bugs.webkit.org/show_bug.cgi?id=180247
<rdar://problem/33885922>

Patch by Antoine Quint <grao...@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:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (225493 => 225494)


--- trunk/LayoutTests/ChangeLog	2017-12-04 22:06:50 UTC (rev 225493)
+++ trunk/LayoutTests/ChangeLog	2017-12-04 22:47:04 UTC (rev 225494)
@@ -1,3 +1,17 @@
+2017-12-04  Antoine Quint  <grao...@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  <mcatanz...@igalia.com>
 
         [GTK] Unreviewed layout test gardening

Deleted: trunk/LayoutTests/fullscreen/video-cursor-auto-hide-expected.txt (225493 => 225494)


--- trunk/LayoutTests/fullscreen/video-cursor-auto-hide-expected.txt	2017-12-04 22:06:50 UTC (rev 225493)
+++ trunk/LayoutTests/fullscreen/video-cursor-auto-hide-expected.txt	2017-12-04 22:47:04 UTC (rev 225494)
@@ -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
-

Deleted: trunk/LayoutTests/fullscreen/video-cursor-auto-hide.html (225493 => 225494)


--- trunk/LayoutTests/fullscreen/video-cursor-auto-hide.html	2017-12-04 22:06:50 UTC (rev 225493)
+++ trunk/LayoutTests/fullscreen/video-cursor-auto-hide.html	2017-12-04 22:47:04 UTC (rev 225494)
@@ -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=""
-    <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>

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (225493 => 225494)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2017-12-04 22:06:50 UTC (rev 225493)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2017-12-04 22:47:04 UTC (rev 225494)
@@ -903,9 +903,6 @@
 # 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 ]

Modified: trunk/Source/WebCore/ChangeLog (225493 => 225494)


--- trunk/Source/WebCore/ChangeLog	2017-12-04 22:06:50 UTC (rev 225493)
+++ trunk/Source/WebCore/ChangeLog	2017-12-04 22:47:04 UTC (rev 225494)
@@ -1,3 +1,24 @@
+2017-12-04  Antoine Quint  <grao...@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  <cdu...@apple.com>
 
         ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) is unsafe

Modified: trunk/Source/WebCore/page/EventHandler.cpp (225493 => 225494)


--- trunk/Source/WebCore/page/EventHandler.cpp	2017-12-04 22:06:50 UTC (rev 225493)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2017-12-04 22:47:04 UTC (rev 225494)
@@ -1589,14 +1589,19 @@
 {
     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
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to