WebKit Bugzilla
Attachment 341832 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]
wip
bug-186226-20180601232412.patch (text/plain), 4.66 KB, created by
Jeremy Jones
on 2018-06-01 23:24:12 PDT
(
hide
)
Description:
wip
Filename:
MIME Type:
Creator:
Jeremy Jones
Created:
2018-06-01 23:24:12 PDT
Size:
4.66 KB
patch
obsolete
>Subversion Revision: 231991 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ef77cb83859a3bc9b332867e0a88dea75276f71a..99f40cd1cb6816203bb5a845eebfb6997ad4600e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-06-01 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!). >+ >+ Test: media/no-fullscreen-from-background.html >+ >+ * dom/Document.cpp: >+ (WebCore::Document::requestFullScreenForElement): >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::enterFullscreen): >+ > 2018-05-18 Jer Noble <jer.noble@apple.com> > > Complete fix for enabling modern EME by default >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index fd232df2e77acb7848a63128d78dbcfa6166e1a7..013383a0e2018d75373ae236b6eb5e05cf8161a2 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -5996,7 +5996,11 @@ void Document::requestFullScreenForElement(Element* element, FullScreenCheckType > do { > if (!element) > element = documentElement(); >- >+ >+ // Don't allow fullscreen if page is in the background. >+ if (activeDOMObjectsAreSuspended() || activeDOMObjectsAreStopped()) >+ return; >+ > // 1. If any of the following conditions are true, terminate these steps and queue a task to fire > // an event named fullscreenerror with its bubbles attribute set to true on the context object's > // node document: >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 6c6ee240fafa673021a273b4afcca8917bb9eff7..98e70385be94136420ed2f61b98d74059d4a4db5 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -5868,6 +5868,9 @@ void HTMLMediaElement::enterFullscreen(VideoFullscreenMode mode) > if (m_videoFullscreenMode == mode) > return; > >+ if (document().activeDOMObjectsAreSuspended() || document().activeDOMObjectsAreStopped()) >+ return; >+ > m_temporarilyAllowingInlinePlaybackAfterFullscreen = false; > m_waitingToEnterFullscreen = true; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d872f0675d36a689129dc0937053e678a0edaab9..c41949809fd9ff22d3d31d37b0751256938ac2a0 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-06-01 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!). >+ >+ * media/no-fullscreen-from-background.html: Added. >+ > 2018-05-18 Youenn Fablet <youenn@apple.com> > > NetworkLoadChecker should cancel its content extension retrieval task when being destroyed >diff --git a/LayoutTests/media/no-fullscreen-from-background.html b/LayoutTests/media/no-fullscreen-from-background.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3fbec1c04c044a3be12e364d482849863f59bf6b >--- /dev/null >+++ b/LayoutTests/media/no-fullscreen-from-background.html >@@ -0,0 +1,59 @@ >+<html> >+<script src=media-file.js></script> >+<script src=video-test.js></script> >+<script type="text/javascript"> >+ function init() >+ { >+ if (window.testRunner) >+ testRunner.waitUntilDone(); >+ >+ video = document.getElementsByTagName("video")[0]; >+ video.src = findMediaFile("video", "content/test"); >+ >+ setTimeout(function(){ >+ runWithKeyDown(action); >+ }, 1000); >+ } >+ >+ function getUIScript() { >+ return ` >+ (function() { >+ uiController.singleTapAtPoint(50, 50, function() { >+ uiController.uiScriptComplete("Done"); >+ }); >+ })();`; >+ } >+ >+ var mouseDownAction = null >+ >+ function doMouseDown() { >+ if (mouseDownAction) >+ mouseDownAction(); >+ mouseDownAction = null; >+ } >+ >+ function runWithUserInteraction(fn) { >+ mouseDownAction = fn; >+ if (window.testRunner && testRunner.runUIScript) >+ testRunner.runUIScript(getUIScript(), function(result) {}); >+ } >+ >+ function busyWait(ms) { >+ var startDate = new Date(); >+ var currentDate = null; >+ do { >+ currentDate = new Date(); >+ } while (currentDate - startDate < ms); >+ } >+ >+ function action() { >+ busyWait(5000); >+ document.getElementById("video").webkitEnterFullScreen(); >+ } >+</script> >+<body onload="init()"> >+<video id="video" src="test.mp4" width=320 height=240 controls></video> >+<br><br> >+<a onclick="action()">do bad action </a> >+</body> >+</html> >\ No newline at end of file
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