Title: [220167] branches/safari-604-branch
- Revision
- 220167
- Author
- [email protected]
- Date
- 2017-08-02 18:32:57 -0700 (Wed, 02 Aug 2017)
Log Message
Cherry-pick r220035. rdar://problem/33687398
Modified Paths
Added Paths
Diff
Modified: branches/safari-604-branch/LayoutTests/ChangeLog (220166 => 220167)
--- branches/safari-604-branch/LayoutTests/ChangeLog 2017-08-03 01:32:27 UTC (rev 220166)
+++ branches/safari-604-branch/LayoutTests/ChangeLog 2017-08-03 01:32:57 UTC (rev 220167)
@@ -1,3 +1,24 @@
+2017-08-02 Jason Marcell <[email protected]>
+
+ Cherry-pick r220035. rdar://problem/33687398
+
+ 2017-07-28 Matt Rajca <[email protected]>
+
+ Don't add autoplay restrictions to media elements created in response to user gestures.
+ https://bugs.webkit.org/show_bug.cgi?id=174947
+
+ Reviewed by Eric Carlson.
+
+ Skip the test on iOS because "runWithKeyDown" does not work there.
+
+ Jer: "Turns out the problem with iOS is that the WKTR EventSender is basically unwritten. It
+ doesn't support sending mouse, key, or touch events, so our "do this during a user gesture"
+ helper in video-test.js doesn't work."
+
+ * media/video-create-with-user-gesture-expected.txt: Added.
+ * media/video-create-with-user-gesture.html: Added.
+ * platform/ios/TestExpectations:
+
2017-07-31 Jason Marcell <[email protected]>
Cherry-pick r220048. rdar://problem/33619591
Added: branches/safari-604-branch/LayoutTests/media/video-create-with-user-gesture-expected.txt (0 => 220167)
--- branches/safari-604-branch/LayoutTests/media/video-create-with-user-gesture-expected.txt (rev 0)
+++ branches/safari-604-branch/LayoutTests/media/video-create-with-user-gesture-expected.txt 2017-08-03 01:32:57 UTC (rev 220167)
@@ -0,0 +1,8 @@
+RUN(window.internals.settings.setVideoPlaybackRequiresUserGesture(true);)
+RUN(video = document.createElement("video"))
+RUN(video.src = "" "content/test"))
+RUN(video.setAttribute("autoplay", ""))
+RUN(document.body.appendChild(video))
+EVENT(playing)
+END OF TEST
+
Added: branches/safari-604-branch/LayoutTests/media/video-create-with-user-gesture.html (0 => 220167)
--- branches/safari-604-branch/LayoutTests/media/video-create-with-user-gesture.html (rev 0)
+++ branches/safari-604-branch/LayoutTests/media/video-create-with-user-gesture.html 2017-08-03 01:32:57 UTC (rev 220167)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>video-create-with-user-gesture</title>
+ <script src=""
+ <script src=""
+ <script>
+ function runTest() {
+ run('window.internals.settings.setVideoPlaybackRequiresUserGesture(true);');
+ runWithKeyDown(() => {
+ run('video = document.createElement("video")');
+ });
+ run('video.src = "" "content/test")');
+ run('video.setAttribute("autoplay", "")');
+ run('document.body.appendChild(video)');
+ waitForEventAndEnd('playing');
+ failTestIn(10000);
+ }
+ </script>
+</head>
+<body _onload_="runTest()">
+</body>
+</html>
Modified: branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations (220166 => 220167)
--- branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations 2017-08-03 01:32:27 UTC (rev 220166)
+++ branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations 2017-08-03 01:32:57 UTC (rev 220167)
@@ -2568,6 +2568,7 @@
media/video-controls-fullscreen-volume.html
media/video-controls-no-display-with-text-track.html
media/video-controls-show-on-kb-or-ax-event.html
+media/video-create-with-user-gesture.html
media/video-fullscreen-restriction-removed.html
media/video-playsinline.html
media/video-remote-control-playpause.html
Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (220166 => 220167)
--- branches/safari-604-branch/Source/WebCore/ChangeLog 2017-08-03 01:32:27 UTC (rev 220166)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog 2017-08-03 01:32:57 UTC (rev 220167)
@@ -1,3 +1,19 @@
+2017-08-02 Jason Marcell <[email protected]>
+
+ Cherry-pick r220035. rdar://problem/33687398
+
+ 2017-07-28 Matt Rajca <[email protected]>
+
+ Don't add autoplay restrictions to media elements created in response to user gestures.
+ https://bugs.webkit.org/show_bug.cgi?id=174947
+
+ Reviewed by Eric Carlson.
+
+ Test: media/video-create-with-user-gesture.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::HTMLMediaElement):
+
2017-08-02 Matthew Hanson <[email protected]>
Cherry-pick r219602. rdar://problem/33537767
Modified: branches/safari-604-branch/Source/WebCore/html/HTMLMediaElement.cpp (220166 => 220167)
--- branches/safari-604-branch/Source/WebCore/html/HTMLMediaElement.cpp 2017-08-03 01:32:27 UTC (rev 220166)
+++ branches/safari-604-branch/Source/WebCore/html/HTMLMediaElement.cpp 2017-08-03 01:32:57 UTC (rev 220167)
@@ -463,8 +463,9 @@
if (document.ownerElement() || !document.isMediaDocument()) {
const auto& topDocument = document.topDocument();
- bool shouldAudioPlaybackRequireUserGesture = topDocument.audioPlaybackRequiresUserGesture();
- bool shouldVideoPlaybackRequireUserGesture = topDocument.videoPlaybackRequiresUserGesture();
+ const bool isProcessingUserGesture = processingUserGestureForMedia();
+ const bool shouldAudioPlaybackRequireUserGesture = topDocument.audioPlaybackRequiresUserGesture() && !isProcessingUserGesture;
+ const bool shouldVideoPlaybackRequireUserGesture = topDocument.videoPlaybackRequiresUserGesture() && !isProcessingUserGesture;
if (shouldVideoPlaybackRequireUserGesture) {
m_mediaSession->addBehaviorRestriction(MediaElementSession::RequireUserGestureForVideoRateChange);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes