Changeset 293311 in webkit
- Timestamp:
- Apr 24, 2022, 11:02:41 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r293291 r293311 1 2022-04-24 Youenn Fablet <youenn@apple.com> 2 3 TextTrackLoader should use SameOrigin mode by default 4 https://bugs.webkit.org/show_bug.cgi?id=239381 5 6 Reviewed by Eric Carlson. 7 8 * http/tests/security/contentSecurityPolicy/resources/track.vtt.py: Added. 9 * http/tests/security/contentSecurityPolicy/track-redirect-allowed.html: 10 * http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html: 11 * http/tests/security/contentSecurityPolicy/track-redirect-blocked-expected.txt: 12 * http/tests/security/contentSecurityPolicy/track-redirect-blocked.html: 13 * http/tests/security/text-track-crossorigin-expected.txt: 14 * http/tests/security/text-track-crossorigin.html: 15 1 16 2022-04-23 Andres Gonzalez <andresg_22@apple.com> 2 17 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/track-redirect-allowed.html
r272981 r293311 7 7 </head> 8 8 <body> 9 <video >10 <track src="http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.vtt " kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')">9 <video crossOrigin="anonymous"> 10 <track src="http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.vtt.py" kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')"> 11 11 </video> 12 12 <script> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html
r272981 r293311 7 7 </head> 8 8 <body> 9 <video >10 <track src="http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.vtt " kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')">9 <video crossOrigin="anonymous"> 10 <track src="http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.vtt.py" kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')"> 11 11 </video> 12 12 <script> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/track-redirect-blocked-expected.txt
r290443 r293311 1 CONSOLE MESSAGE: Refused to load http://localhost:8000/security/contentSecurityPolicy/resources/track.vtt because it does not appear in the media-src directive of the Content Security Policy.2 blockedURI = http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A//127.0.0.1%3A8000/resources/redirect.py%3Furl=http%3A//localhost%3A8000/security/contentSecurityPolicy/resources/track.vtt 1 CONSOLE MESSAGE: Refused to load http://localhost:8000/security/contentSecurityPolicy/resources/track.vtt.py because it does not appear in the media-src directive of the Content Security Policy. 2 blockedURI = http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A//127.0.0.1%3A8000/resources/redirect.py%3Furl=http%3A//localhost%3A8000/security/contentSecurityPolicy/resources/track.vtt.py 3 3 4 4 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/track-redirect-blocked.html
r290443 r293311 14 14 }); 15 15 </script> 16 <video >17 <track src="http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A//127.0.0.1%3A8000/resources/redirect.py%3Furl=http%3A//localhost%3A8000/security/contentSecurityPolicy/resources/track.vtt " kind="captions">16 <video crossOrigin="anonymous"> 17 <track src="http://127.0.0.1:8000/resources/redirect.py?code=307&url=http%3A//127.0.0.1%3A8000/resources/redirect.py%3Furl=http%3A//localhost%3A8000/security/contentSecurityPolicy/resources/track.vtt.py" kind="captions"> 18 18 </video> 19 19 <script> -
trunk/LayoutTests/http/tests/security/text-track-crossorigin-expected.txt
r285145 r293311 1 CONSOLE MESSAGE: Unsafe attempt to load URL http://localhost:8000/security/resources/captions-with-access-control-headers.py from origin http://127.0.0.1:8000. Domains, protocols and ports must match. 2 1 3 CONSOLE MESSAGE: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin. Status code: 200 2 4 CONSOLE MESSAGE: Cross-origin text track load denied by Cross-Origin Resource Sharing policy. … … 5 7 6 8 Loading without Access-Control-Allow-Origin header, no "crossorigin" attribute on <video> 7 EVENT( load)8 PASS: shouldLoad should be ' true' and is.9 EVENT(error) 10 PASS: shouldLoad should be 'false' and is. 9 11 PASS: event.target should be '[object HTMLTrackElement]' and is. 10 PASS: trackElement.readyState should be ' 2' and is.12 PASS: trackElement.readyState should be '3' and is. 11 13 12 14 -
trunk/LayoutTests/http/tests/security/text-track-crossorigin.html
r274244 r293311 30 30 log('<br>'); 31 31 switch(counter) { 32 case 0:33 log('Loading <b>with out</b> Access-Control-Allow-Origin header, setting video.crossorigin to "anonymous"');34 url = "http://localhost:8000/security/resources/captions-with-access-control-headers.py? count=" + counter;35 videoElement.setAttribute('crossorigin', ' anonymous');32 case 2: 33 log('Loading <b>with</b> Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers, setting video.crossorigin to "use-credentials"'); 34 url = "http://localhost:8000/security/resources/captions-with-access-control-headers.py?origin=1&credentials=1"; 35 videoElement.setAttribute('crossorigin', 'use-credentials'); 36 36 trackElement.removeAttribute('src'); 37 37 trackElement.setAttribute('src', url); 38 shouldLoad = false; 39 ++counter; 40 break; 41 42 case 2: 43 log('Loading <b>with</b> Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers, setting video.crossorigin to "use-credentials"'); 44 url = "http://localhost:8000/security/resources/captions-with-access-control-headers.py?origin=1;credentials=1"; 45 trackElement.setAttribute('crossorigin', 'use-credentials'); 46 trackElement.setAttribute('src', url); 38 shouldLoad = true; 47 39 ++counter; 48 40 break; … … 52 44 if (window.testRunner) 53 45 testRunner.notifyDone(); 46 54 47 defaut: 55 48 if (window.testRunner) … … 70 63 log('<br>'); 71 64 switch(counter) { 65 case 0: 66 log('Loading <b>without</b> Access-Control-Allow-Origin header, setting video.crossorigin to "anonymous"'); 67 url = "http://localhost:8000/security/resources/captions-with-access-control-headers.py?count=" + counter; 68 videoElement.setAttribute('crossorigin', 'anonymous'); 69 trackElement.removeAttribute('src'); 70 trackElement.setAttribute('src', url); 71 shouldLoad = false; 72 ++counter; 73 break; 74 72 75 case 1: 73 76 log('Loading <b>with</b> Access-Control-Allow-Origin header, leaving video.crossorigin as "anonymous"'); 74 77 url = "http://localhost:8000/security/resources/captions-with-access-control-headers.py?origin=1"; 78 trackElement.removeAttribute('src'); 75 79 trackElement.setAttribute('src', url); 76 80 shouldLoad = true; 77 81 ++counter; 78 82 break; 83 79 84 defaut: 80 85 if (window.testRunner) … … 90 95 var url = "http://localhost:8000/security/resources/captions-with-access-control-headers.py" 91 96 trackElement.setAttribute('src', url); 97 shouldLoad = false; 92 98 } 93 99 -
trunk/LayoutTests/imported/w3c/ChangeLog
r293288 r293311 1 2022-04-24 Youenn Fablet <youenn@apple.com> 2 3 TextTrackLoader should use SameOrigin mode by default 4 https://bugs.webkit.org/show_bug.cgi?id=239381 5 6 Reviewed by Eric Carlson. 7 8 * web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode-expected.txt: 9 * web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-data-url-expected.txt: 10 * web-platform-tests/service-workers/service-worker/webvtt-cross-origin.https-expected.txt: 11 1 12 2022-04-22 Cathie Chen <cathiechen@igalia.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode-expected.txt
r267646 r293311 1 CONSOLE MESSAGE: Unsafe attempt to load URL javascript:"network error" from origin http://localhost:8800. Domains, protocols and ports must match. 2 3 CONSOLE MESSAGE: Unsafe attempt to load URL javascript:"network error" from origin http://localhost:8800. Domains, protocols and ports must match. 4 1 5 2 6 PASS track element cloneNode, not loaded -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-data-url-expected.txt
r285145 r293311 1 CONSOLE MESSAGE: Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin. Status code: 2002 CONSOLE MESSAGE: Cross-origin text track load denied by Cross-Origin Resource Sharing policy.3 CONSOLE MESSAGE: Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin. Status code: 2004 CONSOLE MESSAGE: Cross-origin text track load denied by Cross-Origin Resource Sharing policy.5 1 6 2 FAIL track element data: URL No CORS null is not an object (evaluating 't.track.cues.length') 7 FAIL track element data: URL anonymous assert_unreached: got error event Reached unreachable code8 FAIL track element data: URL use-credentials assert_unreached: got error event Reached unreachable code3 FAIL track element data: URL anonymous null is not an object (evaluating 't.track.cues.length') 4 FAIL track element data: URL use-credentials null is not an object (evaluating 't.track.cues.length') 9 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/webvtt-cross-origin.https-expected.txt
r267647 r293311 2 2 PASS initialize global state 3 3 PASS same-origin text track should load 4 FAIL cross-origin text track with no-cors request should not load assert_equals: expected "error event" but got "load event" 4 PASS cross-origin text track with no-cors request should not load 5 5 PASS cross-origin text track with rejected cors request should not load 6 FAIL cross-origin text track with approved cors request should not load assert_equals: expected "error event" but got "load event" 6 PASS cross-origin text track with approved cors request should not load 7 7 PASS same-origin text track that redirects same-origin should load 8 FAIL same-origin text track that redirects cross-origin should not load assert_equals: expected "error event" but got "load event" 8 PASS same-origin text track that redirects cross-origin should not load 9 9 PASS same-origin text track that redirects to a cross-origin text track with rejected cors should not load 10 FAIL same-origin text track that redirects to a cross-origin text track with approved cors should not load assert_equals: expected "error event" but got "load event" 10 PASS same-origin text track that redirects to a cross-origin text track with approved cors should not load 11 11 PASS restore global state 12 12 -
trunk/Source/WebCore/ChangeLog
r293308 r293311 1 2022-04-24 Youenn Fablet <youenn@apple.com> 2 3 TextTrackLoader should use SameOrigin mode by default 4 https://bugs.webkit.org/show_bug.cgi?id=239381 5 6 Reviewed by Eric Carlson. 7 8 Covered by updated test. 9 10 * loader/TextTrackLoader.cpp: 11 1 12 2022-04-24 Diego Pino Garcia <dpino@igalia.com> 2 13 -
trunk/Source/WebCore/loader/TextTrackLoader.cpp
r290026 r293311 148 148 ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions(); 149 149 options.contentSecurityPolicyImposition = element.isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck; 150 options.sameOriginDataURLFlag = SameOriginDataURLFlag::Set; 150 151 151 152 // FIXME: Do we really need to call completeURL here? … … 155 156 resourceRequest.setInspectorInitiatorNodeIdentifier(InspectorInstrumentation::identifierForNode(*mediaElement)); 156 157 157 auto cueRequest = createPotentialAccessControlRequest(WTFMove(resourceRequest), WTFMove(options), m_document, element.mediaElementCrossOriginAttribute() );158 auto cueRequest = createPotentialAccessControlRequest(WTFMove(resourceRequest), WTFMove(options), m_document, element.mediaElementCrossOriginAttribute(), SameOriginFlag::Yes); 158 159 m_resource = m_document.cachedResourceLoader().requestTextTrack(WTFMove(cueRequest)).value_or(nullptr); 159 160 if (!m_resource)
Note:
See TracChangeset
for help on using the changeset viewer.