-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1513462 [wpt PR 14474] - service worker: XSLT: Use response URL f…
…or the base URL., a=testonly Automatic update from web-platform-tests service worker: XSLT: Use response URL for the base URL. This aligns with the standard. See whatwg/fetch#146 Chrome Status: https://www.chromestatus.com/feature/4857368017895424 No intent to ship because it's a trivial change. Bug: 914135 Change-Id: I229aec6f8473bb6b7cdc88429afa830bc6eb80ed Reviewed-on: https://chromium-review.googlesource.com/c/1372109 Commit-Queue: Matt Falkenhagen <falkenchromium.org> Reviewed-by: Kent Tamura <tkentchromium.org> Cr-Commit-Position: refs/heads/master{#616248} -- wpt-commits: bc5122da94555fdf1b82b520599d860e722d8c05 wpt-pr: 14474 UltraBlame original commit: 93f7c970ddcf711010d0a29451229eee220771f0
- Loading branch information
Showing
5 changed files
with
674 additions
and
0 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
testing/web-platform/tests/service-workers/service-worker/resources/import-relative.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
< | ||
? | ||
xml | ||
version | ||
= | ||
" | ||
1 | ||
. | ||
0 | ||
" | ||
encoding | ||
= | ||
" | ||
utf | ||
- | ||
8 | ||
" | ||
? | ||
> | ||
< | ||
xsl | ||
: | ||
stylesheet | ||
version | ||
= | ||
" | ||
1 | ||
. | ||
0 | ||
" | ||
xmlns | ||
: | ||
xsl | ||
= | ||
" | ||
http | ||
: | ||
/ | ||
/ | ||
www | ||
. | ||
w3 | ||
. | ||
org | ||
/ | ||
1999 | ||
/ | ||
XSL | ||
/ | ||
Transform | ||
" | ||
> | ||
< | ||
xsl | ||
: | ||
import | ||
href | ||
= | ||
" | ||
xslt | ||
- | ||
pass | ||
. | ||
xsl | ||
" | ||
/ | ||
> | ||
< | ||
/ | ||
xsl | ||
: | ||
stylesheet | ||
> |
69 changes: 69 additions & 0 deletions
69
testing/web-platform/tests/service-workers/service-worker/resources/xsl-base-url-iframe.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
< | ||
? | ||
xml | ||
version | ||
= | ||
" | ||
1 | ||
. | ||
0 | ||
" | ||
? | ||
> | ||
< | ||
? | ||
xml | ||
- | ||
stylesheet | ||
type | ||
= | ||
" | ||
text | ||
/ | ||
xsl | ||
" | ||
href | ||
= | ||
" | ||
resources | ||
/ | ||
request | ||
- | ||
url | ||
- | ||
path | ||
/ | ||
import | ||
- | ||
relative | ||
. | ||
xsl | ||
" | ||
? | ||
> | ||
< | ||
stylesheet | ||
- | ||
test | ||
> | ||
This | ||
tests | ||
a | ||
stylesheet | ||
which | ||
has | ||
a | ||
xsl | ||
: | ||
import | ||
with | ||
a | ||
relative | ||
URL | ||
. | ||
< | ||
/ | ||
stylesheet | ||
- | ||
test | ||
> |
136 changes: 136 additions & 0 deletions
136
testing/web-platform/tests/service-workers/service-worker/resources/xsl-base-url-worker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
self | ||
. | ||
addEventListener | ||
( | ||
' | ||
fetch | ||
' | ||
event | ||
= | ||
> | ||
{ | ||
const | ||
url | ||
= | ||
new | ||
URL | ||
( | ||
event | ||
. | ||
request | ||
. | ||
url | ||
) | ||
; | ||
/ | ||
/ | ||
For | ||
the | ||
import | ||
- | ||
relative | ||
. | ||
xsl | ||
file | ||
respond | ||
in | ||
a | ||
way | ||
that | ||
changes | ||
the | ||
/ | ||
/ | ||
response | ||
URL | ||
. | ||
This | ||
is | ||
expected | ||
to | ||
change | ||
the | ||
base | ||
URL | ||
and | ||
allow | ||
the | ||
import | ||
/ | ||
/ | ||
from | ||
the | ||
file | ||
to | ||
succeed | ||
. | ||
const | ||
path | ||
= | ||
' | ||
request | ||
- | ||
url | ||
- | ||
path | ||
/ | ||
import | ||
- | ||
relative | ||
. | ||
xsl | ||
' | ||
; | ||
if | ||
( | ||
url | ||
. | ||
pathname | ||
. | ||
indexOf | ||
( | ||
path | ||
) | ||
! | ||
= | ||
- | ||
1 | ||
) | ||
{ | ||
/ | ||
/ | ||
Respond | ||
with | ||
a | ||
different | ||
URL | ||
deleting | ||
" | ||
request | ||
- | ||
url | ||
- | ||
path | ||
/ | ||
" | ||
. | ||
event | ||
. | ||
respondWith | ||
( | ||
fetch | ||
( | ||
' | ||
import | ||
- | ||
relative | ||
. | ||
xsl | ||
' | ||
) | ||
) | ||
; | ||
} | ||
} | ||
) | ||
; |
96 changes: 96 additions & 0 deletions
96
testing/web-platform/tests/service-workers/service-worker/resources/xslt-pass.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
< | ||
? | ||
xml | ||
version | ||
= | ||
" | ||
1 | ||
. | ||
0 | ||
" | ||
encoding | ||
= | ||
" | ||
utf | ||
- | ||
8 | ||
" | ||
? | ||
> | ||
< | ||
xsl | ||
: | ||
stylesheet | ||
version | ||
= | ||
" | ||
1 | ||
. | ||
0 | ||
" | ||
xmlns | ||
: | ||
xsl | ||
= | ||
" | ||
http | ||
: | ||
/ | ||
/ | ||
www | ||
. | ||
w3 | ||
. | ||
org | ||
/ | ||
1999 | ||
/ | ||
XSL | ||
/ | ||
Transform | ||
" | ||
> | ||
< | ||
xsl | ||
: | ||
template | ||
match | ||
= | ||
" | ||
/ | ||
" | ||
> | ||
< | ||
html | ||
> | ||
< | ||
body | ||
> | ||
< | ||
p | ||
> | ||
PASS | ||
< | ||
/ | ||
p | ||
> | ||
< | ||
/ | ||
body | ||
> | ||
< | ||
/ | ||
html | ||
> | ||
< | ||
/ | ||
xsl | ||
: | ||
template | ||
> | ||
< | ||
/ | ||
xsl | ||
: | ||
stylesheet | ||
> |
Oops, something went wrong.