Skip to content

Commit 26fd27e

Browse files
committed
Bug 1941267 [wpt PR 50043] - Remove unrelated checks from trusted-types-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
1 parent 0647555 commit 26fd27e

File tree

2 files changed

+110
-111
lines changed

2 files changed

+110
-111
lines changed

testing/web-platform/tests/trusted-types/trusted-types-svg-script-set-href.html

+4-111
Original file line numberDiff line numberDiff line change
@@ -169,24 +169,12 @@
169169
policy
170170
"
171171
{
172-
createScript
173-
:
174-
x
175-
=
176-
>
177-
x
178-
createHTML
179-
:
180-
x
181-
=
182-
>
183-
x
184172
createScriptURL
185173
:
186-
x
174+
script_url
187175
=
188176
>
189-
x
177+
script_url
190178
}
191179
)
192180
;
@@ -1101,56 +1089,10 @@
11011089
default
11021090
"
11031091
{
1104-
createScript
1105-
:
1106-
(
1107-
x
1108-
_
1109-
sink
1110-
)
1111-
=
1112-
>
1113-
{
1114-
assert_equals
1115-
(
1116-
sink
1117-
'
1118-
SVGScriptElement
1119-
text
1120-
'
1121-
)
1122-
;
1123-
return
1124-
x
1125-
;
1126-
}
1127-
createHTML
1128-
:
1129-
(
1130-
x
1131-
_
1132-
sink
1133-
)
1134-
=
1135-
>
1136-
{
1137-
assert_equals
1138-
(
1139-
sink
1140-
'
1141-
Element
1142-
innerHTML
1143-
'
1144-
)
1145-
;
1146-
return
1147-
x
1148-
;
1149-
}
11501092
createScriptURL
11511093
:
11521094
(
1153-
x
1095+
script_url
11541096
_
11551097
sink
11561098
)
@@ -1167,7 +1109,7 @@
11671109
)
11681110
;
11691111
return
1170-
x
1112+
script_url
11711113
;
11721114
}
11731115
}
@@ -1194,55 +1136,6 @@
11941136
=
11951137
>
11961138
{
1197-
document
1198-
.
1199-
getElementById
1200-
(
1201-
"
1202-
script
1203-
"
1204-
)
1205-
.
1206-
innerHTML
1207-
=
1208-
"
1209-
'
1210-
modified
1211-
via
1212-
innerHTML
1213-
'
1214-
;
1215-
"
1216-
;
1217-
return
1218-
Promise
1219-
.
1220-
resolve
1221-
(
1222-
)
1223-
;
1224-
}
1225-
"
1226-
Assign
1227-
String
1228-
to
1229-
SVGScriptElement
1230-
.
1231-
innerHTML
1232-
w
1233-
/
1234-
default
1235-
policy
1236-
.
1237-
"
1238-
)
1239-
;
1240-
promise_test
1241-
(
1242-
t
1243-
=
1244-
>
1245-
{
12461139
const
12471140
elem
12481141
=

testing/web-platform/tests/trusted-types/trusted-types-svg-script.html

+106
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,112 @@
440440
"
441441
)
442442
;
443+
promise_test
444+
(
445+
t
446+
=
447+
>
448+
{
449+
trustedTypes
450+
.
451+
createPolicy
452+
(
453+
"
454+
default
455+
"
456+
{
457+
createScript
458+
:
459+
(
460+
input
461+
_
462+
sink
463+
)
464+
=
465+
>
466+
{
467+
assert_equals
468+
(
469+
sink
470+
'
471+
SVGScriptElement
472+
text
473+
'
474+
)
475+
;
476+
return
477+
input
478+
;
479+
}
480+
createHTML
481+
:
482+
(
483+
input
484+
_
485+
sink
486+
)
487+
=
488+
>
489+
{
490+
assert_equals
491+
(
492+
sink
493+
'
494+
Element
495+
innerHTML
496+
'
497+
)
498+
;
499+
return
500+
input
501+
;
502+
}
503+
}
504+
)
505+
;
506+
document
507+
.
508+
getElementById
509+
(
510+
"
511+
script
512+
"
513+
)
514+
.
515+
innerHTML
516+
=
517+
"
518+
'
519+
modified
520+
via
521+
innerHTML
522+
'
523+
;
524+
"
525+
;
526+
return
527+
Promise
528+
.
529+
resolve
530+
(
531+
)
532+
;
533+
}
534+
"
535+
Assign
536+
String
537+
to
538+
SVGScriptElement
539+
.
540+
innerHTML
541+
w
542+
/
543+
default
544+
policy
545+
.
546+
"
547+
)
548+
;
443549
<
444550
/
445551
script

0 commit comments

Comments
 (0)