Changeset 279487 in webkit
- Timestamp:
- Jul 1, 2021, 5:08:31 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/media/auto-play-video-in-about-blank-iframe-expected.txt (added)
-
LayoutTests/media/auto-play-video-in-about-blank-iframe.html (added)
-
LayoutTests/media/auto-play-web-audio-in-about-blank-iframe-expected.txt (added)
-
LayoutTests/media/auto-play-web-audio-in-about-blank-iframe.html (added)
-
LayoutTests/media/video-test.js (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioContext.cpp (modified) (1 diff)
-
Source/WebCore/testing/Internals.cpp (modified) (2 diffs)
-
Source/WebCore/testing/Internals.h (modified) (2 diffs)
-
Source/WebCore/testing/Internals.idl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r279485 r279487 1 2021-07-01 Eric Carlson <eric.carlson@apple.com> 2 3 WebAudio auto-play policy should come from top document 4 https://bugs.webkit.org/show_bug.cgi?id=227593 5 rdar://76920375 6 7 Reviewed by Chris Dumez. 8 9 * media/auto-play-video-in-about-blank-iframe-expected.txt: Added. 10 * media/auto-play-video-in-about-blank-iframe.html: Added. 11 * media/auto-play-web-audio-in-about-blank-iframe-expected.txt: Added. 12 * media/auto-play-web-audio-in-about-blank-iframe.html: Added. 13 14 * media/video-test.js: 15 (waitForEventWithTimeout): Return event. 16 1 17 2021-07-01 Cameron McCormack <heycam@apple.com> 2 18 -
trunk/LayoutTests/media/video-test.js
r263835 r279487 214 214 215 215 consoleWrite(`EVENT(${result.type})`); 216 Promise.resolve(result);216 return Promise.resolve(result); 217 217 }); 218 218 } -
trunk/Source/WebCore/ChangeLog
r279483 r279487 1 2021-07-01 Eric Carlson <eric.carlson@apple.com> 2 3 WebAudio auto-play policy should come from top document 4 https://bugs.webkit.org/show_bug.cgi?id=227593 5 rdar://76920375 6 7 Reviewed by Chris Dumez. 8 9 Tests: media/auto-play-video-in-about-blank-iframe.html 10 media/auto-play-web-audio-in-about-blank-iframe.html 11 12 * Modules/webaudio/AudioContext.cpp: 13 (WebCore::AudioContext::constructCommon): Get auto-play policy from document()->topDocument(). 14 15 * testing/Internals.cpp: 16 (WebCore::Internals::setDocumentAutoplayPolicy): New method to test auto-play policy. 17 * testing/Internals.h: 18 * testing/Internals.idl: 19 1 20 2021-07-01 Youenn Fablet <youenn@apple.com> 2 21 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r278788 r279487 136 136 { 137 137 ASSERT(document()); 138 if (document()-> audioPlaybackRequiresUserGesture())138 if (document()->topDocument().audioPlaybackRequiresUserGesture()) 139 139 addBehaviorRestriction(RequireUserGestureForAudioStartRestriction); 140 140 else -
trunk/Source/WebCore/testing/Internals.cpp
r279463 r279487 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2013-202 0Apple Inc. All rights reserved.3 * Copyright (C) 2013-2021 Apple Inc. All rights reserved. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 6419 6419 } 6420 6420 6421 ExceptionOr<void> Internals::setDocumentAutoplayPolicy(Document& document, Internals::AutoplayPolicy policy) 6422 { 6423 static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::Default) == static_cast<uint8_t>(Internals::AutoplayPolicy::Default), "Internals::Default != WebCore::Default"); 6424 static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::Allow) == static_cast<uint8_t>(Internals::AutoplayPolicy::Allow), "Internals::Allow != WebCore::Allow"); 6425 static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::AllowWithoutSound) == static_cast<uint8_t>(Internals::AutoplayPolicy::AllowWithoutSound), "Internals::AllowWithoutSound != WebCore::AllowWithoutSound"); 6426 static_assert(static_cast<uint8_t>(WebCore::AutoplayPolicy::Deny) == static_cast<uint8_t>(Internals::AutoplayPolicy::Deny), "Internals::Deny != WebCore::Deny"); 6427 6428 auto* loader = document.loader(); 6429 if (!loader) 6430 return Exception { InvalidStateError }; 6431 6432 loader->setAutoplayPolicy(static_cast<WebCore::AutoplayPolicy>(policy)); 6433 6434 return { }; 6435 } 6421 6436 6422 6437 } // namespace WebCore -
trunk/Source/WebCore/testing/Internals.h
r279463 r279487 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2013-202 0Apple Inc. All rights reserved.3 * Copyright (C) 2013-2021 Apple Inc. All rights reserved. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 1170 1170 String dumpStyleResolvers(); 1171 1171 1172 enum class AutoplayPolicy : uint8_t { 1173 Default, 1174 Allow, 1175 AllowWithoutSound, 1176 Deny, 1177 }; 1178 ExceptionOr<void> setDocumentAutoplayPolicy(Document&, AutoplayPolicy); 1179 1172 1180 private: 1173 1181 explicit Internals(Document&); -
trunk/Source/WebCore/testing/Internals.idl
r279463 r279487 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2013-20 19Apple Inc. All rights reserved.3 * Copyright (C) 2013-2021 Apple Inc. All rights reserved. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 104 104 "GPUStatusFailure", 105 105 "Timeout" 106 }; 107 108 enum AutoplayPolicy { 109 "Default", 110 "Allow", 111 "AllowWithoutSound", 112 "Deny" 106 113 }; 107 114 … … 1039 1046 1040 1047 DOMString dumpStyleResolvers(); 1041 }; 1048 1049 undefined setDocumentAutoplayPolicy(Document document, AutoplayPolicy policy); 1050 };
Note:
See TracChangeset
for help on using the changeset viewer.