WebKit Bugzilla
Attachment 343873 Details for
Bug 186226
: Fullscreen requires active document.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186226-20180628171008.patch (text/plain), 8.96 KB, created by
Jeremy Jones
on 2018-06-28 17:10:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jeremy Jones
Created:
2018-06-28 17:10:49 PDT
Size:
8.96 KB
patch
obsolete
>Subversion Revision: 233214 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f049638b707a069c4acc01e0bc84d470d5043c0c..f28fce351a26f279f2b8248c17b12578d8e87077 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2018-06-28 Jeremy Jones <jeremyj@apple.com> >+ >+ Fullscreen requires active document. >+ https://bugs.webkit.org/show_bug.cgi?id=186226 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-06-26 Eric Carlson <eric.carlson@apple.com> > > [Mac] AirPlay picker uses incorrect theme in Dark mode >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 766381d2e378d311a118d0724b7016db11b8eabc..d2bece17b0eefb855282ec6d6b9b11cf427d52ea 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,29 @@ >+2018-06-28 Jeremy Jones <jeremyj@apple.com> >+ >+ Fullscreen requires active document. >+ https://bugs.webkit.org/show_bug.cgi?id=186226 >+ rdar://problem/36187413 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-06-26 Eric Carlson <eric.carlson@apple.com> > > [Mac] AirPlay picker uses incorrect theme in Dark mode >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 22d495b837f8ebb82fa157e9170f80248603efc3..18c1e6f4126cac1568975af1897267527686c24d 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -6015,6 +6015,10 @@ void Document::requestFullScreenForElement(Element* element, FullScreenCheckType > // 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; >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 628b0a0a1a760cf2e31deda3b70ae74307ad5861..d573f7d26f99b5befd72ffba317a6c51f544f012 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -5880,6 +5880,11 @@ void HTMLMediaElement::enterFullscreen(VideoFullscreenMode mode) > 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; > >@@ -5906,7 +5911,7 @@ void HTMLMediaElement::enterFullscreen(VideoFullscreenMode mode) > 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); >diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h >index bea0d8f4cb8ad34b1e996ebf318cffb0fb968be7..472b6183fc7bc2dbffbea0a59735e7cab0f50ce9 100644 >--- a/Source/WebCore/page/ChromeClient.h >+++ b/Source/WebCore/page/ChromeClient.h >@@ -487,6 +487,8 @@ public: > > virtual String signedPublicKeyAndChallengeString(unsigned, const String&, const URL&) const { return emptyString(); } > >+ virtual bool isViewVisible() { return true; } >+ > protected: > virtual ~ChromeClient() = default; > }; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 99aeede341f440959b44853de693b4eeddde6fd2..f19f93ab1900d5f9c57d14e99113ac335df9ab9f 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -7802,4 +7802,9 @@ void WebPageProxy::setDefersLoadingForTesting(bool defersLoading) > m_process->send(Messages::WebPage::SetDefersLoading(defersLoading), m_pageID); > } > >+void WebPageProxy::getIsViewVisible(bool& result) >+{ >+ result = isViewVisible(); >+} >+ > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 2b820f2d5af58134b1b547fd1d859c032e0b5b69..b86a2ba3e005383dd711114612c57139958429f6 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -1439,6 +1439,7 @@ private: > 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&&); >diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in >index 4e1de5ca22ae00cc6f6f0216ddda60986345279d..c7e8756262d13a07e630629fcbd4477092b1e224 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in >@@ -61,6 +61,7 @@ messages -> WebPageProxy { > 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) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index 0c955f6771beccbe568f0242479f16301f5d1f4c..c0652f16dcd87f91641d56a47cf92fee3d53a6f5 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -1311,4 +1311,11 @@ void WebChromeClient::requestStorageAccess(String&& subFrameHost, String&& topFr > } > #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 >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >index 811a822c94534366a75031115e9a0faa93f427d8..e5d8e433e4107032466963eaa8ea45a34987776f 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >@@ -367,6 +367,8 @@ private: > 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 };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186226
:
341832
|
341834
|
341835
|
341836
|
341840
|
341868
|
343833
|
343859
|
343873
|
343945
|
343956
|
343957
|
343965
|
343972
|
343985
|
343995
|
344478
|
344494
|
344500
|
344727
|
344733
|
344735
|
344737
|
344739
|
344908
|
344910
|
344916
|
344919
|
344921
|
344923
|
344925
|
345028
|
345030
|
345031
|
345111