<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[279550] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/279550">279550</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2021-07-04 09:53:08 -0700 (Sun, 04 Jul 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebAudio auto-play policy should come from top document
https://bugs.webkit.org/show_bug.cgi?id=227593
rdar://76920375

Reviewed by Chris Dumez.

Source/WebCore:

Tests: media/auto-play-video-in-about-blank-iframe.html
       media/auto-play-web-audio-in-about-blank-iframe.html

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon): Get auto-play policy from document()->topDocument().

* testing/Internals.cpp:
(WebCore::Internals::setDocumentAutoplayPolicy): New method to test auto-play policy.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/auto-play-video-in-about-blank-iframe-expected.txt: Added.
* media/auto-play-video-in-about-blank-iframe.html: Added.
* media/auto-play-web-audio-in-about-blank-iframe-expected.txt: Added.
* media/auto-play-web-audio-in-about-blank-iframe.html: Added.

* media/video-test.js:
(waitForEventWithTimeout): Return event.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediavideotestjs">trunk/LayoutTests/media/video-test.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContextcpp">trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediaautoplayvideoinaboutblankiframeexpectedtxt">trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediaautoplayvideoinaboutblankiframehtml">trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe.html</a></li>
<li><a href="#trunkLayoutTestsmediaautoplaywebaudioinaboutblankiframeexpectedtxt">trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediaautoplaywebaudioinaboutblankiframehtml">trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (279549 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-07-04 15:47:12 UTC (rev 279549)
+++ trunk/LayoutTests/ChangeLog 2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2021-07-04  Eric Carlson  <eric.carlson@apple.com>
+
+        WebAudio auto-play policy should come from top document
+        https://bugs.webkit.org/show_bug.cgi?id=227593
+        rdar://76920375
+
+        Reviewed by Chris Dumez.
+
+        * media/auto-play-video-in-about-blank-iframe-expected.txt: Added.
+        * media/auto-play-video-in-about-blank-iframe.html: Added.
+        * media/auto-play-web-audio-in-about-blank-iframe-expected.txt: Added.
+        * media/auto-play-web-audio-in-about-blank-iframe.html: Added.
+
+        * media/video-test.js:
+        (waitForEventWithTimeout): Return event.
+
</ins><span class="cx"> 2021-07-04  Alan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [LFC][TFC] 100% percent width column(s) make the table stretch
</span></span></pre></div>
<a id="trunkLayoutTestsmediaautoplayvideoinaboutblankiframeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe-expected.txt (0 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe-expected.txt                               (rev 0)
+++ trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe-expected.txt  2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+
+
+*** Test with auto-play policy set to 'Allow'
+EVENT(load)
+EVENT(message)
+PASS: Video auto-played
+
+*** Test with auto-play policy set to 'AllowWithoutSound'
+EVENT(load)
+EVENT(message)
+PASS: Video did not auto-play
+
+*** Test with auto-play policy set to 'Deny'
+EVENT(load)
+EVENT(message)
+PASS: Video did not auto-play
+
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediaautoplayvideoinaboutblankiframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe.html (0 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe.html                               (rev 0)
+++ trunk/LayoutTests/media/auto-play-video-in-about-blank-iframe.html  2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+<head>
+    <style>
+        iframe {
+            width: 320px;
+            height: 240px;
+        }
+    </style>
+    <script src="media-file.js"></script>
+    <script src="video-test.js"></script>
+    <script>
+    if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+    }
+
+    async function checkAutoPlay(allowed)
+    {
+        let message = allowed ? "Video auto-played" : "Video did not auto-play";
+        let video = iframe.contentDocument.querySelector("video");
+
+        let played;
+        let counter = 0;
+        while (++counter < 20) {
+            played = video.ended || video.currentTime != 0;
+            if (allowed === played)
+                break;
+            await new Promise(resolve => setTimeout(resolve, 50));
+        }
+
+        if (allowed == played)
+            consoleWrite(`PASS: ${allowed ? "Video auto-played" : "Video did not auto-play"}`);
+        else
+            consoleWrite(`FAIL: ${allowed ? "Video did not auto-play" : "Video auto-played"}`);
+    }
+
+    async function loadVideo(policy, allow)
+    {
+        consoleWrite(`<br>*** Test with auto-play policy set to '${policy}'`);
+        
+        if (window.internals)
+            internals.setDocumentAutoplayPolicy(document, policy)
+
+        iframe.src = 'about:blank';
+        await waitForEventWithTimeout(iframe, 'load', 4000, '"about:blank" iframe failed to load!');
+
+        let script = iframe.contentDocument.head.appendChild(iframe.contentDocument.createElement('script'));
+        let code = `
+            let video=document.createElement('video');
+            document.body.appendChild(video);
+            video.controls = 1;
+            video.playsinline = 1;
+            video.autoplay = 1;
+            video.src = 'content/test.wav';
+            let postedMessage = false;
+            let postMessage = () => {
+               if (!postedMessage)
+                       window.parent.postMessage('loaded', '*');
+                   postedMessage = true;
+            };
+            setTimeout(postMessage, 1000);
+            video.oncanplaythrough = postMessage;
+        `;
+        script.appendChild(iframe.contentDocument.createTextNode(code));
+
+        await waitForEventWithTimeout(window, 'message', 4000, 'iframe failed to send message!');
+        await new Promise(resolve => setTimeout(resolve, 250));
+        await checkAutoPlay(allow);
+    }
+    
+    window.addEventListener('load', async () => {
+        iframe = document.querySelector('iframe');
+
+        await loadVideo('Allow', true);
+
+        await loadVideo('AllowWithoutSound', false);
+
+        await loadVideo('Deny', false);
+
+        consoleWrite('');
+        endTest();
+    }, false);
+
+    </script>
+</head>
+<body>
+    <iframe ></iframe>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsmediaautoplaywebaudioinaboutblankiframeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe-expected.txt (0 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe-expected.txt                           (rev 0)
+++ trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe-expected.txt      2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+
+
+*** Test with auto-play policy set to 'Allow'
+EVENT(load)
+EVENT(message)
+PASS: Video auto-played
+
+*** Test with auto-play policy set to 'AllowWithoutSound'
+EVENT(load)
+EVENT(message)
+PASS: Video did not auto-play
+
+*** Test with auto-play policy set to 'Deny'
+EVENT(load)
+EVENT(message)
+PASS: Video did not auto-play
+
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediaautoplaywebaudioinaboutblankiframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe.html (0 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe.html                           (rev 0)
+++ trunk/LayoutTests/media/auto-play-web-audio-in-about-blank-iframe.html      2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+<head>
+    <style>
+        iframe {
+            width: 320px;
+            height: 240px;
+        }
+    </style>
+    <script src="media-file.js"></script>
+    <script src="video-test.js"></script>
+    <script>
+    if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+    }
+
+    async function checkAutoPlay(state, allowed)
+    {
+        let message = allowed ? "AudioContext auto-played" : "AudioContext did not auto-play";
+        if (allowed === (event.data === "running"))
+            consoleWrite(`PASS: ${allowed ? "Video auto-played" : "Video did not auto-play"}`);
+        else
+            consoleWrite(`FAIL: ${allowed ? "Video did not auto-play" : "Video auto-played"}`);
+    }
+
+    async function loadVideo(policy, allow)
+    {
+        consoleWrite(`<br>*** Test with auto-play policy set to '${policy}'`);
+        
+        if (window.internals)
+            internals.setDocumentAutoplayPolicy(document, policy)
+
+        iframe.src = 'about:blank';
+        await waitForEventWithTimeout(iframe, 'load', 4000, '"about:blank" iframe failed to load!');
+
+        let script = iframe.contentDocument.head.appendChild(iframe.contentDocument.createElement('script'));
+        let code = `
+            let context = new AudioContext();
+            let node = context.createBufferSource();
+            node.connect(context.destination);
+            node.start();
+            setTimeout(() => {
+                window.parent.postMessage(context.state, '*');
+            }, 250)`;
+        script.appendChild(iframe.contentDocument.createTextNode(code));
+
+        let event = await waitForEventWithTimeout(window, 'message', 4000, 'iframe failed to send message!');
+        await checkAutoPlay(event.data, allow);
+    }
+    
+    window.addEventListener('load', async () => {
+        iframe = document.querySelector('iframe');
+
+        await loadVideo('Allow', true);
+
+        await loadVideo('AllowWithoutSound', false);
+
+        await loadVideo('Deny', false);
+
+        consoleWrite('');
+        endTest();
+    }, false);
+
+    </script>
+</head>
+<body>
+    <iframe ></iframe>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsmediavideotestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/video-test.js (279549 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/video-test.js    2021-07-04 15:47:12 UTC (rev 279549)
+++ trunk/LayoutTests/media/video-test.js       2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -213,7 +213,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         consoleWrite(`EVENT(${result.type})`);
</span><del>-        Promise.resolve(result);
</del><ins>+        return Promise.resolve(result);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (279549 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-07-04 15:47:12 UTC (rev 279549)
+++ trunk/Source/WebCore/ChangeLog      2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2021-07-04  Eric Carlson  <eric.carlson@apple.com>
+
+        WebAudio auto-play policy should come from top document
+        https://bugs.webkit.org/show_bug.cgi?id=227593
+        rdar://76920375
+
+        Reviewed by Chris Dumez.
+
+        Tests: media/auto-play-video-in-about-blank-iframe.html
+               media/auto-play-web-audio-in-about-blank-iframe.html
+
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::constructCommon): Get auto-play policy from document()->topDocument().
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::setDocumentAutoplayPolicy): New method to test auto-play policy.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2021-07-04  Zalan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [LFC][TFC] Cleanup computedPreferredWidthForColumns and distributeAvailableSpace functions
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (279549 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp   2021-07-04 15:47:12 UTC (rev 279549)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp      2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> void AudioContext::constructCommon()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(document());
</span><del>-    if (document()->audioPlaybackRequiresUserGesture())
</del><ins>+    if (document()->topDocument().audioPlaybackRequiresUserGesture())
</ins><span class="cx">         addBehaviorRestriction(RequireUserGestureForAudioStartRestriction);
</span><span class="cx">     else
</span><span class="cx">         m_restrictions = NoRestrictions;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (279549 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp       2021-07-04 15:47:12 UTC (rev 279549)
+++ trunk/Source/WebCore/testing/Internals.cpp  2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2012 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -6418,5 +6418,20 @@
</span><span class="cx">     return result.toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ExceptionOr<void> Internals::setDocumentAutoplayPolicy(Document& document, Internals::AutoplayPolicy policy)
+{
+    static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::Default) == static_cast<uint8_t>(Internals::AutoplayPolicy::Default), "Internals::Default != WebCore::Default");
+    static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::Allow) == static_cast<uint8_t>(Internals::AutoplayPolicy::Allow), "Internals::Allow != WebCore::Allow");
+    static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::AllowWithoutSound) == static_cast<uint8_t>(Internals::AutoplayPolicy::AllowWithoutSound), "Internals::AllowWithoutSound != WebCore::AllowWithoutSound");
+    static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::Deny) == static_cast<uint8_t>(Internals::AutoplayPolicy::Deny), "Internals::Deny != WebCore::Deny");
</ins><span class="cx"> 
</span><ins>+    auto* loader = document.loader();
+    if (!loader)
+        return Exception { InvalidStateError };
+
+    loader->setAutoplayPolicy(static_cast<WebCore::AutoplayPolicy>(policy));
+
+    return { };
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (279549 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h 2021-07-04 15:47:12 UTC (rev 279549)
+++ trunk/Source/WebCore/testing/Internals.h    2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2012 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -1169,6 +1169,14 @@
</span><span class="cx"> 
</span><span class="cx">     String dumpStyleResolvers();
</span><span class="cx"> 
</span><ins>+    enum class AutoplayPolicy : uint8_t {
+        Default,
+        Allow,
+        AllowWithoutSound,
+        Deny,
+    };
+    ExceptionOr<void> setDocumentAutoplayPolicy(Document&, AutoplayPolicy);
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit Internals(Document&);
</span><span class="cx">     Document* contextDocument() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (279549 => 279550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl       2021-07-04 15:47:12 UTC (rev 279549)
+++ trunk/Source/WebCore/testing/Internals.idl  2021-07-04 16:53:08 UTC (rev 279550)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2012 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -105,6 +105,13 @@
</span><span class="cx">     "Timeout"
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum AutoplayPolicy {
+    "Default",
+    "Allow",
+    "AllowWithoutSound",
+    "Deny"
+};
+
</ins><span class="cx"> [
</span><span class="cx">     ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
</span><span class="cx">     Conditional=VIDEO,
</span><span class="lines">@@ -1038,4 +1045,6 @@
</span><span class="cx">     undefined systemBeep();
</span><span class="cx"> 
</span><span class="cx">     DOMString dumpStyleResolvers();
</span><ins>+
+    undefined setDocumentAutoplayPolicy(Document document, AutoplayPolicy policy);
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>