Changeset 267507 in webkit
- Timestamp:
- Sep 23, 2020, 4:25:31 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
- 2 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect-expected.txt (added)
-
LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html (copied) (copied from trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html ) (2 diffs)
-
LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html (modified) (1 diff)
-
LayoutTests/http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect-expected.txt (added)
-
LayoutTests/http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html (copied) (copied from trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html ) (3 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r267504 r267507 1 2020-09-23 Chris Dumez <cdumez@apple.com> 2 3 web audio api outputs silence for 302 redirected resource in safari 4 https://bugs.webkit.org/show_bug.cgi?id=214932 5 <rdar://problem/66300050> 6 7 Reviewed by Darin Adler. 8 9 Add layout test coverage. Update existing test to reflect the fact that the frequency returned by 10 the AnalyserNode is -Infinity when input is silent, not minDecibels (this has changed fairly 11 recently). 12 13 * http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect-expected.txt: Added. 14 * http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html: Copied from LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html. 15 * http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html: 16 * http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect-expected.txt: Added. 17 * http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html: Copied from LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html. 18 1 19 2020-09-23 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html
r267505 r267507 16 16 let mediaFile = findMediaFile("audio", "../../media/resources/1000Hz-sin"); 17 17 let type = mimeTypeForExtension(mediaFile.split('.').pop()); 18 audio.src = "http://localhost:8080/security/resources/ video-cross-origin-allow.php?name=" + mediaFile + "&type=" + type;18 audio.src = "http://localhost:8080/security/resources/redirect-allow-star.php?url=" + encodeURIComponent("http://127.0.0.1:8080/security/resources/video-cross-origin-allow.php?name=" + mediaFile + "&type=" + type); 19 19 20 20 context = new AudioContext(); … … 31 31 window.outputArray = new Float32Array(analyser.frequencyBinCount); 32 32 window.silentArray = new Float32Array(analyser.frequencyBinCount); 33 silentArray.fill( analyser.minDecibels);33 silentArray.fill(-Infinity); 34 34 35 35 var intervalToken = setInterval(() => { -
trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html
r267504 r267507 31 31 window.outputArray = new Float32Array(analyser.frequencyBinCount); 32 32 window.silentArray = new Float32Array(analyser.frequencyBinCount); 33 silentArray.fill( analyser.minDecibels);33 silentArray.fill(-Infinity); 34 34 35 35 var intervalToken = setInterval(() => { -
trunk/LayoutTests/http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html
r267505 r267507 8 8 <pre id="console"></pre> 9 9 <script> 10 description("Ensure that audio is rendered when tainted by a remote audio resource when CORS isenabled.");10 description("Ensure that audio is not rendered when tainted by a remote audio resource when CORS is not enabled."); 11 11 window.jsTestIsAsync = true; 12 12 13 13 function go() { 14 14 let audio = new Audio(); 15 audio.crossOrigin = "anonymous";16 15 let mediaFile = findMediaFile("audio", "../../media/resources/1000Hz-sin"); 17 16 let type = mimeTypeForExtension(mediaFile.split('.').pop()); 18 audio.src = "http://localhost:8080/security/resources/ video-cross-origin-allow.php?name=" + mediaFile + "&type=" + type;17 audio.src = "http://localhost:8080/security/resources/redirect-allow-star.php?url=" + encodeURIComponent("http://127.0.0.1:8080/security/resources/video-cross-origin-allow.php?name=" + mediaFile + "&type=" + type); 19 18 20 19 context = new AudioContext(); … … 31 30 window.outputArray = new Float32Array(analyser.frequencyBinCount); 32 31 window.silentArray = new Float32Array(analyser.frequencyBinCount); 33 silentArray.fill( analyser.minDecibels);32 silentArray.fill(-Infinity); 34 33 35 34 var intervalToken = setInterval(() => { … … 40 39 clearInterval(intervalToken); 41 40 context.suspend().then(() => { 42 should NotBe("outputArray", "silentArray");41 shouldBe("outputArray", "silentArray"); 43 42 finishJSTest(); 44 43 }); -
trunk/Source/WebCore/ChangeLog
r267505 r267507 1 2020-09-23 Chris Dumez <cdumez@apple.com> 2 3 web audio api outputs silence for 302 redirected resource in safari 4 https://bugs.webkit.org/show_bug.cgi?id=214932 5 <rdar://problem/66300050> 6 7 Reviewed by Darin Adler. 8 9 If the resource is redirected to another origin, treat it as tainted only if the crossorigin attribute 10 is not set. This is done for consistency with Blink: 11 - https://github.com/chromium/chromium/blob/master/media/blink/webmediaplayer_impl.cc (see WouldTaintOrigin()) 12 13 The new behavior also seems to match Firefox. 14 15 Tests: http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html 16 http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html 17 18 * Modules/webaudio/MediaElementAudioSourceNode.cpp: 19 (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin): 20 1 21 2020-09-23 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp
r267505 r267507 124 124 bool MediaElementAudioSourceNode::wouldTaintOrigin() 125 125 { 126 if (!m_mediaElement->hasSingleSecurityOrigin()) 126 // If the resource is redirected to another origin, treat it as tainted if the crossorigin attribute 127 // is not set. This is done for consistency with Blink. 128 if (!m_mediaElement->hasSingleSecurityOrigin() && m_mediaElement->crossOrigin().isNull()) 127 129 return true; 128 130
Note:
See TracChangeset
for help on using the changeset viewer.