Skip to content

Commit

Permalink
Bug 1941267 [wpt PR 50043] - Remove unrelated checks from trusted-typ…
Browse files Browse the repository at this point in the history
…es-svg-script-set-href.html, a=testonly

Automatic update from web-platform-tests
Remove unrelated checks from trusted-types-svg-script-set-href.html (#50043)

* Remove unrelated checks from trusted-types-svg-script-set-href.html

This test is intended to cover setting href [1] [2] but it also
currently verifies some (currently not specified) unrelated behavior
when setting the text of the script via innerHTML. A similar test exist
in block-text-node-insertion-into-svg-script-element.html, but for a
disconnected script. This PR just move the unrelated test to
trusted-types-svg-script.html instead.

[1] w3c/svgwg#934
[2] whatwg/dom#1268

--

wpt-commits: 696792b6aa714c2d7c54b986814bbdbbdecf1dd8
wpt-pr: 50043

UltraBlame original commit: c08a3d36866a0421ce1e7f511543715b7a9c1b38
  • Loading branch information
marco-c committed Jan 16, 2025
1 parent 0647555 commit 26fd27e
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,12 @@
policy
"
{
createScript
:
x
=
>
x
createHTML
:
x
=
>
x
createScriptURL
:
x
script_url
=
>
x
script_url
}
)
;
Expand Down Expand Up @@ -1101,56 +1089,10 @@
default
"
{
createScript
:
(
x
_
sink
)
=
>
{
assert_equals
(
sink
'
SVGScriptElement
text
'
)
;
return
x
;
}
createHTML
:
(
x
_
sink
)
=
>
{
assert_equals
(
sink
'
Element
innerHTML
'
)
;
return
x
;
}
createScriptURL
:
(
x
script_url
_
sink
)
Expand All @@ -1167,7 +1109,7 @@
)
;
return
x
script_url
;
}
}
Expand All @@ -1194,55 +1136,6 @@
=
>
{
document
.
getElementById
(
"
script
"
)
.
innerHTML
=
"
'
modified
via
innerHTML
'
;
"
;
return
Promise
.
resolve
(
)
;
}
"
Assign
String
to
SVGScriptElement
.
innerHTML
w
/
default
policy
.
"
)
;
promise_test
(
t
=
>
{
const
elem
=
Expand Down
106 changes: 106 additions & 0 deletions testing/web-platform/tests/trusted-types/trusted-types-svg-script.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,112 @@
"
)
;
promise_test
(
t
=
>
{
trustedTypes
.
createPolicy
(
"
default
"
{
createScript
:
(
input
_
sink
)
=
>
{
assert_equals
(
sink
'
SVGScriptElement
text
'
)
;
return
input
;
}
createHTML
:
(
input
_
sink
)
=
>
{
assert_equals
(
sink
'
Element
innerHTML
'
)
;
return
input
;
}
}
)
;
document
.
getElementById
(
"
script
"
)
.
innerHTML
=
"
'
modified
via
innerHTML
'
;
"
;
return
Promise
.
resolve
(
)
;
}
"
Assign
String
to
SVGScriptElement
.
innerHTML
w
/
default
policy
.
"
)
;
<
/
script
Expand Down

0 comments on commit 26fd27e

Please sign in to comment.