Skip to content

Commit 3a9bc97

Browse files
committed
REGRESSION(r254031): Captions fail to load on jw.org
https://bugs.webkit.org/show_bug.cgi?id=216672 <rdar://problem/69016059> Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode-expected.txt: * web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-data-url-expected.txt: * web-platform-tests/service-workers/service-worker/webvtt-cross-origin.https-expected.txt: Source/WebCore: Revert r254031. * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load): LayoutTests: * http/tests/security/contentSecurityPolicy/resources/track.php: Removed. * http/tests/security/contentSecurityPolicy/track-redirect-allowed.html: * http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html: * http/tests/security/contentSecurityPolicy/track-redirect-blocked.html: * http/tests/security/text-track-crossorigin-expected.txt: * http/tests/security/text-track-crossorigin.html: Canonical link: https://commits.webkit.org/229505@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 4619da3 commit 3a9bc97

13 files changed

Lines changed: 72 additions & 61 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2020-09-18 Jer Noble <jer.noble@apple.com>
2+
3+
REGRESSION(r254031): Captions fail to load on jw.org
4+
https://bugs.webkit.org/show_bug.cgi?id=216672
5+
<rdar://problem/69016059>
6+
7+
Reviewed by Eric Carlson.
8+
9+
* http/tests/security/contentSecurityPolicy/resources/track.php: Removed.
10+
* http/tests/security/contentSecurityPolicy/track-redirect-allowed.html:
11+
* http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html:
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+
116
2020-09-18 Diego Pino Garcia <dpino@igalia.com>
217

318
[WPE] Unreviewed test gardening. Mark several fast/layoutformattingcontext as failure after r267024.

LayoutTests/http/tests/security/contentSecurityPolicy/resources/track.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

LayoutTests/http/tests/security/contentSecurityPolicy/track-redirect-allowed.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="media-src http://127.0.0.1:8000/resources/redirect.php http://localhost:8000">
77
</head>
88
<body>
9-
<video crossorigin="anonymous">
10-
<track src="http://127.0.0.1:8000/resources/redirect.php?code=307&cors_allow_origin=*&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.php" kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')">
9+
<video>
10+
<track src="http://127.0.0.1:8000/resources/redirect.php?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.vtt" kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')">
1111
</video>
1212
<script>
1313
document.querySelector("track").track.mode = "hidden"; // Load the track

LayoutTests/http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="media-src http://127.0.0.1:8000/resources/redirect.php http://localhost:8000/this-path-should-be-ignored-when-matching-a-redirected-request">
77
</head>
88
<body>
9-
<video crossorigin="anonymous">
10-
<track src="http://127.0.0.1:8000/resources/redirect.php?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.php" kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')">
9+
<video>
10+
<track src="http://127.0.0.1:8000/resources/redirect.php?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.vtt" kind="captions" onload="alertAndDone('PASS')" onerror="alertAndDone('FAIL')">
1111
</video>
1212
<script>
1313
document.querySelector("track").track.mode = "hidden"; // Load the track

LayoutTests/http/tests/security/contentSecurityPolicy/track-redirect-blocked.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta http-equiv="Content-Security-Policy" content="media-src http://127.0.0.1:8000/resources/redirect.php">
77
</head>
88
<body>
9-
<video crossorigin="anonymous">
9+
<video>
1010
<track src="http://127.0.0.1:8000/resources/redirect.php?code=307&url=http%3A%2F%2Flocalhost%3A8000/security/contentSecurityPolicy/resources/track.vtt" kind="captions" onload="alertAndDone('FAIL')" onerror="alertAndDone('PASS')">
1111
</video>
1212
<script>

LayoutTests/http/tests/security/text-track-crossorigin-expected.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
CONSOLE MESSAGE: Unsafe attempt to load URL http://localhost:8000/security/resources/captions-with-access-control-headers.php from origin http://127.0.0.1:8000. Domains, protocols and ports must match.
2-
31
CONSOLE MESSAGE: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
42
CONSOLE MESSAGE: Cross-origin text track load denied by Cross-Origin Resource Sharing policy.
53
Tests loading cross-domain <track>.
64

75

86
Loading without Access-Control-Allow-Origin header, no "crossorigin" attribute on <video>
9-
EVENT(error)
10-
PASS: shouldLoad should be 'false' and is.
7+
EVENT(load)
8+
PASS: shouldLoad should be 'true' and is.
119
PASS: event.target should be '[object HTMLTrackElement]' and is.
12-
PASS: trackElement.readyState should be '3' and is.
10+
PASS: trackElement.readyState should be '2' and is.
1311

1412

1513
Loading without Access-Control-Allow-Origin header, setting video.crossorigin to "anonymous"
@@ -33,12 +31,5 @@ PASS: event.target should be '[object HTMLTrackElement]' and is.
3331
PASS: trackElement.readyState should be '2' and is.
3432

3533

36-
Loading without Access-Control-Allow-Origin header, with a redirect, no "crossorigin" attribute on <video>
37-
EVENT(error)
38-
PASS: shouldLoad should be 'false' and is.
39-
PASS: event.target should be '[object HTMLTrackElement]' and is.
40-
PASS: trackElement.readyState should be '3' and is.
41-
42-
4334
END OF TEST
4435

LayoutTests/http/tests/security/text-track-crossorigin.html

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<script src="resources/cross-frame-access.js"></script>
55
<script>
66

7-
var shouldLoad = false;
7+
var shouldLoad = true;
88
var counter = 0;
99

1010
if (window.testRunner) {
@@ -29,6 +29,16 @@
2929

3030
log('<br>');
3131
switch(counter) {
32+
case 0:
33+
log('Loading <b>without</b> Access-Control-Allow-Origin header, setting video.crossorigin to "anonymous"');
34+
url = "http://localhost:8000/security/resources/captions-with-access-control-headers.php?count=" + counter;
35+
videoElement.setAttribute('crossorigin', 'anonymous');
36+
trackElement.removeAttribute('src');
37+
trackElement.setAttribute('src', url);
38+
shouldLoad = false;
39+
++counter;
40+
break;
41+
3242
case 2:
3343
log('Loading <b>with</b> Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers, setting video.crossorigin to "use-credentials"');
3444
url = "http://localhost:8000/security/resources/captions-with-access-control-headers.php?origin=1;credentials=1";
@@ -38,20 +48,12 @@
3848
break;
3949

4050
case 3:
41-
log('Loading <b>without</b> Access-Control-Allow-Origin header, with a redirect, no "crossorigin" attribute on &lt;video&gt;');
42-
url = "http://127.0.0.1:8000/security/resources/redir.php?url=http://localhost:8000/security/resources/captions-with-access-control-headers.php"
43-
videoElement.removeAttribute('crossorigin');
44-
trackElement.removeAttribute('crossorigin');
45-
trackElement.setAttribute('src', url);
46-
shouldLoad = false;
47-
++counter;
48-
break;
49-
50-
case 4:
5151
log("END OF TEST");
5252
if (window.testRunner)
5353
testRunner.notifyDone();
54-
break;
54+
defaut:
55+
if (window.testRunner)
56+
testRunner.notifyDone();
5557
}
5658
}
5759

@@ -67,28 +69,16 @@
6769

6870
log('<br>');
6971
switch(counter) {
70-
case 0:
71-
log('Loading <b>without</b> Access-Control-Allow-Origin header, setting video.crossorigin to "anonymous"');
72-
url = "http://localhost:8000/security/resources/captions-with-access-control-headers.php?count=" + counter;
73-
videoElement.setAttribute('crossorigin', 'anonymous');
74-
trackElement.removeAttribute('src');
75-
trackElement.setAttribute('src', url);
76-
++counter;
77-
break;
78-
7972
case 1:
8073
log('Loading <b>with</b> Access-Control-Allow-Origin header, leaving video.crossorigin as "anonymous"');
8174
url = "http://localhost:8000/security/resources/captions-with-access-control-headers.php?origin=1";
8275
trackElement.setAttribute('src', url);
8376
shouldLoad = true;
8477
++counter;
8578
break;
86-
87-
case 4:
88-
log("END OF TEST");
79+
defaut:
8980
if (window.testRunner)
9081
testRunner.notifyDone();
91-
break;
9282
}
9383
}
9484

LayoutTests/imported/w3c/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2020-09-18 Jer Noble <jer.noble@apple.com>
2+
3+
REGRESSION(r254031): Captions fail to load on jw.org
4+
https://bugs.webkit.org/show_bug.cgi?id=216672
5+
<rdar://problem/69016059>
6+
7+
Reviewed by Eric Carlson.
8+
9+
* web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode-expected.txt:
10+
* web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-data-url-expected.txt:
11+
* web-platform-tests/service-workers/service-worker/webvtt-cross-origin.https-expected.txt:
12+
113
2020-09-18 Chris Dumez <cdumez@apple.com>
214

315
Unreviewed, rebaseline imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html.

LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cloneNode-expected.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
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-
51

62
PASS track element cloneNode, not loaded
73
PASS track element cloneNode, loading
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
CONSOLE MESSAGE: Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
2+
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.
4+
CONSOLE MESSAGE: Cross-origin text track load denied by Cross-Origin Resource Sharing policy.
15

26
FAIL track element data: URL No CORS null is not an object (evaluating 't.track.cues.length')
3-
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')
7+
FAIL track element data: URL anonymous assert_unreached: got error event Reached unreachable code
8+
FAIL track element data: URL use-credentials assert_unreached: got error event Reached unreachable code
59

0 commit comments

Comments
 (0)