Consider the current document when allowing autoplay quirks.
authormrajca@apple.com <mrajca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 20:39:51 +0000 (20:39 +0000)
committermrajca@apple.com <mrajca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 20:39:51 +0000 (20:39 +0000)
commit7901ef914226f208fe83a4cadc6fe28dec008e5c
treef03ca897841cd83832011763658092cd2192571d
parent24476092731474031ed5c491e6d2353c041c0358
Consider the current document when allowing autoplay quirks.
https://bugs.webkit.org/show_bug.cgi?id=170744

Reviewed by Eric Carlson.

Added API test.

In addition to checking if the top-level document supports autoplay quirks, we should check
if the current document supports quirks. This allows all embedded YouTube videos (which use
iframes) to play correctly if the client allows autoplay quirks on youtube.com.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Tools/TestWebKitAPI/Tests/WebKit2/autoplay-check-frame.html
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm