haikuwebkit/LayoutTests/media/no-fullscreen-when-hidden-e...

8 lines
158 B
Plaintext
Raw Permalink Normal View History

Fullscreen requires active document. https://bugs.webkit.org/show_bug.cgi?id=186226 rdar://problem/36187413 Patch by Jeremy Jones <jeremyj@apple.com> 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: Canonical link: https://commits.webkit.org/202913@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-07-16 20:39:37 +00:00
Fullscreen should be prevented when page is not visible.
RUN(video.play())
Attempting to go into Full Screen
RUN(video.webkitEnterFullscreen())
END OF TEST