Title: [221905] branches/safari-604-branch/Source/WebCore
Revision
221905
Author
[email protected]
Date
2017-09-11 22:50:47 -0700 (Mon, 11 Sep 2017)

Log Message

Cherry-pick r221709. rdar://problem/34169683

Modified Paths

Diff

Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (221904 => 221905)


--- branches/safari-604-branch/Source/WebCore/ChangeLog	2017-09-12 05:50:44 UTC (rev 221904)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog	2017-09-12 05:50:47 UTC (rev 221905)
@@ -1,5 +1,24 @@
 2017-09-10  Jason Marcell  <[email protected]>
 
+        Cherry-pick r221709. rdar://problem/34169683
+
+    2017-09-05  Matt Rajca  <[email protected]>
+
+            Support new autoplay quirk for arbitrary user gestures.
+            https://bugs.webkit.org/show_bug.cgi?id=176402
+
+            Reviewed by Eric Carlson.
+
+            This quirk allows any user gesture to allow autoplay in a document.
+
+            No new tests because this specifically targets one host.
+
+            * html/MediaElementSession.cpp:
+            (WebCore::needsArbitraryUserGestureAutoplayQuirk):
+            (WebCore::MediaElementSession::playbackPermitted const):
+
+2017-09-10  Jason Marcell  <[email protected]>
+
         Cherry-pick r221386. rdar://problem/34169683
 
     2017-08-22  Matt Rajca  <[email protected]>

Modified: branches/safari-604-branch/Source/WebCore/html/MediaElementSession.cpp (221904 => 221905)


--- branches/safari-604-branch/Source/WebCore/html/MediaElementSession.cpp	2017-09-12 05:50:44 UTC (rev 221904)
+++ branches/safari-604-branch/Source/WebCore/html/MediaElementSession.cpp	2017-09-12 05:50:47 UTC (rev 221905)
@@ -148,6 +148,17 @@
     m_restrictions &= ~restriction;
 }
 
+#if PLATFORM(MAC)
+static bool needsArbitraryUserGestureAutoplayQuirk(const Document& document)
+{
+    if (!document.settings().needsSiteSpecificQuirks())
+        return false;
+
+    auto host = document.url().host();
+    return equalLettersIgnoringASCIICase(host, "washingtonpost.com") || host.endsWithIgnoringASCIICase(".washingtonpost.com");
+}
+#endif // PLATFORM(MAC)
+
 SuccessOr<MediaPlaybackDenialReason> MediaElementSession::playbackPermitted(const HTMLMediaElement& element) const
 {
     if (element.document().isMediaDocument() && !element.document().ownerElement())
@@ -178,6 +189,9 @@
     const auto& topDocument = element.document().topDocument();
     if (topDocument.mediaState() & MediaProducer::HasUserInteractedWithMediaElement && topDocument.settings().needsSiteSpecificQuirks())
         return { };
+
+    if (element.document().hasHadUserInteraction() && needsArbitraryUserGestureAutoplayQuirk(element.document()))
+        return { };
 #endif
 
     if (m_restrictions & RequireUserGestureForVideoRateChange && element.isVideo() && !element.document().processingUserGestureForMedia()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to