Skip to content

Commit

Permalink
Bug 1872206 [wpt PR 43808] - Add more dangling markup tests to WPT, a…
Browse files Browse the repository at this point in the history
…=testonly

Automatic update from web-platform-tests
Add more dangling markup tests to WPT

As part of formally adding dangling markup injection mitigation to
html spec[1], we need to add more tests to WPT. This change moves some
of the existing tests to WPT, and add more tests.

[1]: whatwg/html#10022

Change-Id: I7b03839adeb749c3206a4fb95a9dfa5785c634c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5151927
Auto-Submit: Jun Kokatsu <jkokatsugoogle.com>
Reviewed-by: Yifan Luo <lyfchromium.org>
Commit-Queue: Jonathan Hao <phaochromium.org>
Reviewed-by: Jonathan Hao <phaochromium.org>
Cr-Commit-Position: refs/heads/main{#1243370}

--

wpt-commits: 200fcfbdd33cdb61775b29bba6f08230fc15bfd1
wpt-pr: 43808

UltraBlame original commit: 91a7441aaacb9223d196da7765c28ca737c8a77e
  • Loading branch information
marco-c committed Jan 16, 2024
1 parent a5ef6ac commit bcf9cb7
Show file tree
Hide file tree
Showing 6 changed files with 1,382 additions and 0 deletions.
256 changes: 256 additions & 0 deletions testing/web-platform/tests/fetch/security/dangling-markup/media.html
@@ -0,0 +1,256 @@
<
!
DOCTYPE
html
>
<
script
src
=
"
/
resources
/
testharness
.
js
"
>
<
/
script
>
<
script
src
=
"
/
resources
/
testharnessreport
.
js
"
>
<
/
script
>
<
body
>
<
script
>
var
resources
=
{
"
audio
"
:
"
/
media
/
sound_5
.
mp3
"
"
video
"
:
"
/
media
/
test
.
mp4
"
}
;
for
(
const
key
in
resources
)
{
async_test
(
t
=
>
{
let
elem
=
document
.
body
.
appendChild
(
document
.
createElement
(
key
)
)
;
elem
.
onerror
=
t
.
unreached_func
(
{
key
}
should
load
)
;
elem
.
oncanplay
=
t
.
step_func
(
(
)
=
>
{
t
.
done
(
)
;
}
)
;
elem
.
src
=
resources
[
key
]
;
}
Should
load
{
key
}
)
;
async_test
(
t
=
>
{
let
elem
=
document
.
body
.
appendChild
(
document
.
createElement
(
key
)
)
;
elem
.
onerror
=
t
.
step_func
(
(
)
=
>
{
t
.
done
(
)
;
}
)
;
elem
.
oncanplay
=
t
.
unreached_func
(
{
key
}
should
not
load
)
;
elem
.
src
=
resources
[
key
]
+
"
?
\
n
<
"
;
}
Should
not
load
{
key
}
with
dangling
markup
in
URL
)
;
}
<
/
script
>

0 comments on commit bcf9cb7

Please sign in to comment.