Keyboard focus should exit fullscreen.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2018 23:22:57 +0000 (23:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2018 23:22:57 +0000 (23:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185617
rdar://problem/34697938

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-01
Reviewed by Ryosuke Niwa.

Source/WebCore:

No opensource test because feature is not enabled.

While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.

Improve fullscreen testability by exposing isAnimatingFullScreen.

* dom/Document.h:
* testing/Internals.cpp:
(WebCore::Internals::isAnimatingFullScreen const):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::elementDidFocus):

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

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index f646b40..cda326b 100644 (file)
@@ -1,5 +1,25 @@
 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
 
+        Keyboard focus should exit fullscreen.
+        https://bugs.webkit.org/show_bug.cgi?id=185617
+        rdar://problem/34697938
+
+        Reviewed by Ryosuke Niwa.
+
+        No opensource test because feature is not enabled.
+
+        While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
+
+        Improve fullscreen testability by exposing isAnimatingFullScreen.
+
+        * dom/Document.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::isAnimatingFullScreen const):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
+2018-06-01  Jeremy Jones  <jeremyj@apple.com>
+
         Don't continue playing in background when auto-picture-in-picture is disabled.
         https://bugs.webkit.org/show_bug.cgi?id=186089
         rdar://problem/40314314
index b236fd3..499bacb 100644 (file)
@@ -1149,7 +1149,7 @@ public:
     bool fullScreenIsAllowedForElement(Element*) const;
     void fullScreenElementRemoved();
     void removeFullScreenElementOfSubtree(Node&, bool amongChildrenOnly = false);
-    bool isAnimatingFullScreen() const;
+    WEBCORE_EXPORT bool isAnimatingFullScreen() const;
     WEBCORE_EXPORT void setAnimatingFullScreen(bool);
 
     WEBCORE_EXPORT bool webkitFullscreenEnabled() const;
index 9a496ad..58261ed 100644 (file)
@@ -2826,6 +2826,14 @@ void Internals::webkitDidExitFullScreenForElement(Element& element)
     document->webkitDidExitFullScreenForElement(&element);
 }
 
+bool Internals::isAnimatingFullScreen() const
+{
+    Document* document = contextDocument();
+    if (!document)
+        return false;
+    return document->isAnimatingFullScreen();
+}
+
 #endif
 
 void Internals::setFullscreenInsetTop(double inset)
index 3880420..d059108 100644 (file)
@@ -390,6 +390,7 @@ public:
     void webkitDidEnterFullScreenForElement(Element&);
     void webkitWillExitFullScreenForElement(Element&);
     void webkitDidExitFullScreenForElement(Element&);
+    bool isAnimatingFullScreen() const;
 #endif
 
     void setFullscreenInsetTop(double);
index e908f74..54091ad 100644 (file)
@@ -368,6 +368,7 @@ enum EventThrottlingBehavior {
     [Conditional=FULLSCREEN_API] void webkitDidEnterFullScreenForElement(Element element);
     [Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
     [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
+    [Conditional=FULLSCREEN_API] readonly attribute boolean isAnimatingFullScreen;
 
     void setFullscreenInsetTop(double inset);
     void setFullscreenAutoHideDelay(double delay);
index 77ed1bb..dc54d31 100644 (file)
@@ -1,3 +1,16 @@
+2018-06-01  Jeremy Jones  <jeremyj@apple.com>
+
+        Keyboard focus should exit fullscreen.
+        https://bugs.webkit.org/show_bug.cgi?id=185617
+        rdar://problem/34697938
+
+        Reviewed by Ryosuke Niwa.
+
+        While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::elementDidFocus):
+
 2018-06-01  Chris Dumez  <cdumez@apple.com>
 
         Regression(r230567): Unable to log into twitter.com in private sessions
index 29ef661..e3bfe5d 100644 (file)
@@ -4962,6 +4962,12 @@ void WebPage::elementDidFocus(WebCore::Node* node)
         m_isAssistingNodeDueToUserInteraction |= m_userIsInteracting;
 
 #if PLATFORM(IOS)
+
+#if ENABLE(FULLSCREEN_API)
+        if (node->document().webkitIsFullScreen())
+            node->document().webkitCancelFullScreen();
+#endif
+
         ++m_currentAssistedNodeIdentifier;
         AssistedNodeInformation information;
         getAssistedNodeInformation(information);