Title: [233950] branches/safari-606-branch
Revision
233950
Author
[email protected]
Date
2018-07-18 18:59:27 -0700 (Wed, 18 Jul 2018)

Log Message

Cherry-pick r233865. rdar://problem/42343023

    Fullscreen requires active document.
    https://bugs.webkit.org/show_bug.cgi?id=186226
    rdar://problem/36187413

    Patch by Jeremy Jones <[email protected]> on 2018-07-16
    Reviewed by Jer Noble.

    Source/WebCore:

    Test: media/no-fullscreen-when-hidden.html

    This change guarantees the document to be visible for both element fullscreen and video fullscreen.

    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.

    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.

    This change adds a sync call to the UI process to get the current UI visibility state.

    * dom/Document.cpp:
    (WebCore::Document::requestFullScreenForElement):
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::enterFullscreen):
    * page/ChromeClient.h:

    Source/WebKit:

    This change guarantees the document to be visible for both element fullscreen and video fullscreen.

    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.

    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.

    This change adds a sync call to the UI process to get the current UI visibility state.

    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::getIsViewVisible):
    * UIProcess/WebPageProxy.h:
    * UIProcess/WebPageProxy.messages.in:
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::isViewVisible):
    * WebProcess/WebCoreSupport/WebChromeClient.h:

    LayoutTests:

    This change guarantees the document to be visible for both element fullscreen and video fullscreen.

    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.

    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.

    This change adds a sync call to the UI process to get the current UI visibility state.

    * media/no-fullscreen-when-hidden.html: Added.
    * media/video-test.js:
    (eventName.string_appeared_here.thunk):
    (runWithKeyDown):
    * platform/ios-wk1/TestExpectations:
    * platform/mac-wk1/TestExpectations:

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-606-branch/LayoutTests/ChangeLog (233949 => 233950)


--- branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-19 01:59:27 UTC (rev 233950)
@@ -1,3 +1,100 @@
+2018-07-18  Babak Shafiei  <[email protected]>
+
+        Cherry-pick r233865. rdar://problem/42343023
+
+    Fullscreen requires active document.
+    https://bugs.webkit.org/show_bug.cgi?id=186226
+    rdar://problem/36187413
+    
+    Patch by Jeremy Jones <[email protected]> on 2018-07-16
+    Reviewed by Jer Noble.
+    
+    Source/WebCore:
+    
+    Test: media/no-fullscreen-when-hidden.html
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * dom/Document.cpp:
+    (WebCore::Document::requestFullScreenForElement):
+    * html/HTMLMediaElement.cpp:
+    (WebCore::HTMLMediaElement::enterFullscreen):
+    * page/ChromeClient.h:
+    
+    Source/WebKit:
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::getIsViewVisible):
+    * UIProcess/WebPageProxy.h:
+    * UIProcess/WebPageProxy.messages.in:
+    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+    (WebKit::WebChromeClient::isViewVisible):
+    * WebProcess/WebCoreSupport/WebChromeClient.h:
+    
+    LayoutTests:
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * media/no-fullscreen-when-hidden.html: Added.
+    * media/video-test.js:
+    (eventName.string_appeared_here.thunk):
+    (runWithKeyDown):
+    * platform/ios-wk1/TestExpectations:
+    * platform/mac-wk1/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-16  Jeremy Jones  <[email protected]>
+
+            Fullscreen requires active document.
+            https://bugs.webkit.org/show_bug.cgi?id=186226
+            rdar://problem/36187413
+
+            Reviewed by Jer Noble.
+
+            This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+
+            User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+            because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+            be hidden.
+
+            Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+
+            This change adds a sync call to the UI process to get the current UI visibility state.
+
+            * media/no-fullscreen-when-hidden.html: Added.
+            * media/video-test.js:
+            (eventName.string_appeared_here.thunk):
+            (runWithKeyDown):
+            * platform/ios-wk1/TestExpectations:
+            * platform/mac-wk1/TestExpectations:
+
 2018-07-16  Truitt Savell  <[email protected]>
 
         [ iOS ] Layout Test fast/forms/submit-change-fragment.html is a flaky Timeout

Added: branches/safari-606-branch/LayoutTests/media/no-fullscreen-when-hidden-expected.txt (0 => 233950)


--- branches/safari-606-branch/LayoutTests/media/no-fullscreen-when-hidden-expected.txt	                        (rev 0)
+++ branches/safari-606-branch/LayoutTests/media/no-fullscreen-when-hidden-expected.txt	2018-07-19 01:59:27 UTC (rev 233950)
@@ -0,0 +1,7 @@
+Fullscreen should be prevented when page is not visible.
+
+RUN(video.play())
+Attempting to go into Full Screen
+RUN(video.webkitEnterFullscreen())
+END OF TEST
+

Added: branches/safari-606-branch/LayoutTests/media/no-fullscreen-when-hidden.html (0 => 233950)


--- branches/safari-606-branch/LayoutTests/media/no-fullscreen-when-hidden.html	                        (rev 0)
+++ branches/safari-606-branch/LayoutTests/media/no-fullscreen-when-hidden.html	2018-07-19 01:59:27 UTC (rev 233950)
@@ -0,0 +1,60 @@
+<html>
+<head>
+    <title>Test fullscreen video going into pip should exit fullscreen</title>
+    <script src=""
+    <script src=""
+    <script>
+
+        var divElement
+
+        function init()
+        {
+            if (!window.testRunner || !testRunner.runUIScript) {
+                consoleWrite("This test requires testRunner.runUIScript()");
+                return;
+            }
+
+            findMediaElement();
+            video.src = "" 'content/test');
+            divElement = document.getElementById("divElement");
+            video.addEventListener('playing', onplaying);
+            run('video.play()');
+        }
+
+        function getUIScript()
+        {
+            return `
+            (function() {
+                uiController.removeViewFromWindow(function() {
+                    uiController.uiScriptComplete('');
+                });
+            })();`
+        }
+
+        function onplaying()
+        {
+            waitForEventAndFail('webkitpresentationmodechanged');
+            waitForEventAndFail('webkitbeginfullscreen');
+            waitForEventAndFail('webkitfullscreenchange');
+
+            testRunner.runUIScript(getUIScript(), function(result) {
+                runWithKeyDown(function(){ 
+                    consoleWrite("Attempting to go into Full Screen");
+                    if (video.webkitRequestFullscreen)
+                    	video.webkitRequestFullscreen(); 
+                    run('video.webkitEnterFullscreen()');
+                    if (divElement.webkitRequestFullscreen)
+                    	divElement.webkitRequestFullscreen();
+                    endTestLater()
+                });
+            });
+        }
+    </script>
+</head>
+<body _onload_="init()">
+    Fullscreen should be prevented when page is not visible.<br>
+    <div id="divElement"></div>
+    <video controls></video>
+</body>
+</html>
+

Modified: branches/safari-606-branch/LayoutTests/media/video-test.js (233949 => 233950)


--- branches/safari-606-branch/LayoutTests/media/video-test.js	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/LayoutTests/media/video-test.js	2018-07-19 01:59:27 UTC (rev 233950)
@@ -441,12 +441,9 @@
 
 function runWithKeyDown(fn, preventDefault) 
 {
-    // FIXME: WKTR does not yet support the keyDown() message.  Do a mouseDown here
-    // instead until keyDown support is added.
-    var eventName = !window.testRunner || eventSender.keyDown ? 'keypress' : 'mousedown'
-
+    var eventName = 'keypress'
     function thunk(event) {
-        if (preventDefault)
+        if (preventDefault && event !== undefined)
             event.preventDefault();
 
         document.removeEventListener(eventName, thunk, false);
@@ -457,12 +454,8 @@
     }
     document.addEventListener(eventName, thunk, false);
 
-    if (window.testRunner) {
-        if (eventSender.keyDown)
-            eventSender.keyDown("a", []);
-        else
-            eventSender.mouseDown();
-    }
+    if (window.internals)
+        internals.withUserGesture(thunk);
 }
 
 function shouldResolve(promise) {

Modified: branches/safari-606-branch/LayoutTests/platform/ios-wk1/TestExpectations (233949 => 233950)


--- branches/safari-606-branch/LayoutTests/platform/ios-wk1/TestExpectations	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/LayoutTests/platform/ios-wk1/TestExpectations	2018-07-19 01:59:27 UTC (rev 233950)
@@ -21,6 +21,9 @@
 webrtc [ Skip ]
 fast/events/constructors/media-stream-event-constructor.html
 
+# Not supported on WK1
+media/no-fullscreen-when-hidden.html [ Skip ]
+
 # <rdar://problem/6501130> LayoutTests: Enable editing tests after we support editing
 editing/deleting/4922367.html
 editing/deleting/5126166.html

Modified: branches/safari-606-branch/LayoutTests/platform/mac-wk1/TestExpectations (233949 => 233950)


--- branches/safari-606-branch/LayoutTests/platform/mac-wk1/TestExpectations	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/LayoutTests/platform/mac-wk1/TestExpectations	2018-07-19 01:59:27 UTC (rev 233950)
@@ -320,6 +320,9 @@
 webkit.org/b/156069 imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click.html [ Skip ]
 webkit.org/b/156069 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-download-click.html [ Skip ]
 
+# Not supported on WK1
+media/no-fullscreen-when-hidden.html [ Skip ]
+
 webkit.org/b/169523 [ Debug ] imported/w3c/web-platform-tests/html/dom/interfaces.worker.html [ Failure ]
 
 imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_go_no_argument.html [ Pass Failure ]

Modified: branches/safari-606-branch/Source/WebCore/ChangeLog (233949 => 233950)


--- branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-19 01:59:27 UTC (rev 233950)
@@ -1,5 +1,103 @@
 2018-07-18  Babak Shafiei  <[email protected]>
 
+        Cherry-pick r233865. rdar://problem/42343023
+
+    Fullscreen requires active document.
+    https://bugs.webkit.org/show_bug.cgi?id=186226
+    rdar://problem/36187413
+    
+    Patch by Jeremy Jones <[email protected]> on 2018-07-16
+    Reviewed by Jer Noble.
+    
+    Source/WebCore:
+    
+    Test: media/no-fullscreen-when-hidden.html
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * dom/Document.cpp:
+    (WebCore::Document::requestFullScreenForElement):
+    * html/HTMLMediaElement.cpp:
+    (WebCore::HTMLMediaElement::enterFullscreen):
+    * page/ChromeClient.h:
+    
+    Source/WebKit:
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::getIsViewVisible):
+    * UIProcess/WebPageProxy.h:
+    * UIProcess/WebPageProxy.messages.in:
+    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+    (WebKit::WebChromeClient::isViewVisible):
+    * WebProcess/WebCoreSupport/WebChromeClient.h:
+    
+    LayoutTests:
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * media/no-fullscreen-when-hidden.html: Added.
+    * media/video-test.js:
+    (eventName.string_appeared_here.thunk):
+    (runWithKeyDown):
+    * platform/ios-wk1/TestExpectations:
+    * platform/mac-wk1/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-16  Jeremy Jones  <[email protected]>
+
+            Fullscreen requires active document.
+            https://bugs.webkit.org/show_bug.cgi?id=186226
+            rdar://problem/36187413
+
+            Reviewed by Jer Noble.
+
+            Test: media/no-fullscreen-when-hidden.html
+
+            This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+
+            User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+            because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+            be hidden.
+
+            Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+
+            This change adds a sync call to the UI process to get the current UI visibility state.
+
+            * dom/Document.cpp:
+            (WebCore::Document::requestFullScreenForElement):
+            * html/HTMLMediaElement.cpp:
+            (WebCore::HTMLMediaElement::enterFullscreen):
+            * page/ChromeClient.h:
+
+2018-07-18  Babak Shafiei  <[email protected]>
+
         Cherry-pick r233857. rdar://problem/42345036
 
     Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread

Modified: branches/safari-606-branch/Source/WebCore/dom/Document.cpp (233949 => 233950)


--- branches/safari-606-branch/Source/WebCore/dom/Document.cpp	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebCore/dom/Document.cpp	2018-07-19 01:59:27 UTC (rev 233950)
@@ -6019,6 +6019,10 @@
         // an event named fullscreenerror with its bubbles attribute set to true on the context object's 
         // node document:
 
+        // Don't allow fullscreen if document is hidden.
+        if (!page() || !page()->chrome().client().isViewVisible())
+            break;
+
         // The context object is not in a document.
         if (!element->isConnected())
             break;

Modified: branches/safari-606-branch/Source/WebCore/html/HTMLMediaElement.cpp (233949 => 233950)


--- branches/safari-606-branch/Source/WebCore/html/HTMLMediaElement.cpp	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebCore/html/HTMLMediaElement.cpp	2018-07-19 01:59:27 UTC (rev 233950)
@@ -5910,6 +5910,11 @@
     if (m_videoFullscreenMode == mode)
         return;
 
+    if (!document().page() || !document().page()->chrome().client().isViewVisible()) {
+        ALWAYS_LOG(LOGIDENTIFIER, "  returning because document is hidden");
+        return;
+    }
+
     m_temporarilyAllowingInlinePlaybackAfterFullscreen = false;
     m_waitingToEnterFullscreen = true;
 
@@ -5936,7 +5941,7 @@
     configureMediaControls();
     if (hasMediaControls())
         mediaControls()->enteredFullscreen();
-    if (document().page() && is<HTMLVideoElement>(*this)) {
+    if (is<HTMLVideoElement>(*this)) {
         HTMLVideoElement& asVideo = downcast<HTMLVideoElement>(*this);
         if (document().page()->chrome().client().supportsVideoFullscreen(m_videoFullscreenMode)) {
             document().page()->chrome().client().enterVideoFullscreenForVideoElement(asVideo, m_videoFullscreenMode, m_videoFullscreenStandby);

Modified: branches/safari-606-branch/Source/WebCore/page/ChromeClient.h (233949 => 233950)


--- branches/safari-606-branch/Source/WebCore/page/ChromeClient.h	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebCore/page/ChromeClient.h	2018-07-19 01:59:27 UTC (rev 233950)
@@ -487,6 +487,8 @@
 
     virtual String signedPublicKeyAndChallengeString(unsigned, const String&, const URL&) const { return emptyString(); }
 
+    virtual bool isViewVisible() { return true; }
+
 protected:
     virtual ~ChromeClient() = default;
 };

Modified: branches/safari-606-branch/Source/WebKit/ChangeLog (233949 => 233950)


--- branches/safari-606-branch/Source/WebKit/ChangeLog	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebKit/ChangeLog	2018-07-19 01:59:27 UTC (rev 233950)
@@ -1,5 +1,103 @@
 2018-07-18  Babak Shafiei  <[email protected]>
 
+        Cherry-pick r233865. rdar://problem/42343023
+
+    Fullscreen requires active document.
+    https://bugs.webkit.org/show_bug.cgi?id=186226
+    rdar://problem/36187413
+    
+    Patch by Jeremy Jones <[email protected]> on 2018-07-16
+    Reviewed by Jer Noble.
+    
+    Source/WebCore:
+    
+    Test: media/no-fullscreen-when-hidden.html
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * dom/Document.cpp:
+    (WebCore::Document::requestFullScreenForElement):
+    * html/HTMLMediaElement.cpp:
+    (WebCore::HTMLMediaElement::enterFullscreen):
+    * page/ChromeClient.h:
+    
+    Source/WebKit:
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::getIsViewVisible):
+    * UIProcess/WebPageProxy.h:
+    * UIProcess/WebPageProxy.messages.in:
+    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+    (WebKit::WebChromeClient::isViewVisible):
+    * WebProcess/WebCoreSupport/WebChromeClient.h:
+    
+    LayoutTests:
+    
+    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+    
+    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+    because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+    be hidden.
+    
+    Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+    
+    This change adds a sync call to the UI process to get the current UI visibility state.
+    
+    * media/no-fullscreen-when-hidden.html: Added.
+    * media/video-test.js:
+    (eventName.string_appeared_here.thunk):
+    (runWithKeyDown):
+    * platform/ios-wk1/TestExpectations:
+    * platform/mac-wk1/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-16  Jeremy Jones  <[email protected]>
+
+            Fullscreen requires active document.
+            https://bugs.webkit.org/show_bug.cgi?id=186226
+            rdar://problem/36187413
+
+            Reviewed by Jer Noble.
+
+            This change guarantees the document to be visible for both element fullscreen and video fullscreen.
+
+            User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
+            because _javascript_ can spin wait before initiating fullscreen. During that spin the page or window might
+            be hidden.
+
+            Document::hidden() can't be relied upon because it won't update while _javascript_ spins.
+
+            This change adds a sync call to the UI process to get the current UI visibility state.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::getIsViewVisible):
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/WebPageProxy.messages.in:
+            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+            (WebKit::WebChromeClient::isViewVisible):
+            * WebProcess/WebCoreSupport/WebChromeClient.h:
+
+2018-07-18  Babak Shafiei  <[email protected]>
+
         Cherry-pick r233864. rdar://problem/42344962
 
     REGRESSION (r233502): Camera in <input type=file> becomes unresponsive after attempting to dismiss it

Modified: branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.cpp (233949 => 233950)


--- branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-07-19 01:59:27 UTC (rev 233950)
@@ -7829,4 +7829,9 @@
     m_process->send(Messages::WebPage::SetDefersLoading(defersLoading), m_pageID);
 }
 
+void WebPageProxy::getIsViewVisible(bool& result)
+{
+    result = isViewVisible();
+}
+
 } // namespace WebKit

Modified: branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.h (233949 => 233950)


--- branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.h	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.h	2018-07-19 01:59:27 UTC (rev 233950)
@@ -1452,6 +1452,7 @@
     void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply&&);
     void setStatusBarIsVisible(bool statusBarIsVisible);
     void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply&&);
+    void getIsViewVisible(bool&);
     void setIsResizable(bool isResizable);
     void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&&);
     void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&&);

Modified: branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in (233949 => 233950)


--- branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in	2018-07-19 01:59:27 UTC (rev 233950)
@@ -61,6 +61,7 @@
     GetWindowFrame() -> (WebCore::FloatRect windowFrame) Delayed
     ScreenToRootView(WebCore::IntPoint screenPoint) -> (WebCore::IntPoint windowPoint) Delayed
     RootViewToScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame) Delayed
+    GetIsViewVisible() -> (bool result)
 
 #if PLATFORM(COCOA)
     ShowValidationMessage(WebCore::IntRect anchorRect, String message)

Modified: branches/safari-606-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (233949 => 233950)


--- branches/safari-606-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2018-07-19 01:59:27 UTC (rev 233950)
@@ -1311,4 +1311,11 @@
 }
 #endif
 
+bool WebChromeClient::isViewVisible()
+{
+    bool isVisible = false;
+    WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetIsViewVisible(), Messages::WebPageProxy::GetIsViewVisible::Reply(isVisible), m_page.pageID());
+    return isVisible;
+}
+
 } // namespace WebKit

Modified: branches/safari-606-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (233949 => 233950)


--- branches/safari-606-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2018-07-19 01:59:21 UTC (rev 233949)
+++ branches/safari-606-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2018-07-19 01:59:27 UTC (rev 233950)
@@ -367,6 +367,8 @@
     void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&&) final;
 #endif
 
+    bool isViewVisible() final;
+
     String m_cachedToolTip;
     mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
     mutable bool m_cachedMainFrameHasHorizontalScrollbar { false };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to