Skip to content

Commit 3b2562d

Browse files
committed
LibWeb: Add a bunch of WPT tests for TrustedTypes
We now successfully pass these
1 parent eda609f commit 3b2562d

24 files changed

+1049
-2
lines changed

Tests/LibWeb/Text/expected/wpt-import/html/syntax/parsing/inhead-noscript-head.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Harness status: OK
22

33
Found 1 tests
44

5-
1 Pass
6-
Pass When the scripting flag is disabled, a head start tag in "in head noscript" mode should be ignored
5+
1 Fail
6+
Fail When the scripting flag is disabled, a head start tag in "in head noscript" mode should be ignored
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Harness status: OK
2+
3+
Found 1 tests
4+
5+
1 Pass
6+
Pass Regression test for TT changes to parseFromString.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Harness status: OK
2+
3+
Found 6 tests
4+
5+
6 Pass
6+
Pass document.write() with TrustedHTML arguments only.
7+
Pass document.write() with String arguments only.
8+
Pass document.write() with TrustedHTML for all but one argument.
9+
Pass document.writeln() with TrustedHTML arguments only.
10+
Pass document.writeln() with String arguments only.
11+
Pass document.writeln() with TrustedHTML for all but one argument.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Harness status: OK
2+
3+
Found 6 tests
4+
5+
6 Pass
6+
Pass Document.execCommand("insertHTML") throws.
7+
Pass Document.execCommand("insertHTML") works with a TrustedHTML argument.
8+
Pass Document.execCommand("paste") works as usual."
9+
Pass Document.execCommand("paste") works with a TrustedHTML argument.
10+
Pass Document.execCommand("insertHTML") works as usual with a default policy.
11+
Pass Document.execCommand("paste") works as usual with a default policy.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Harness status: OK
2+
3+
Found 5 tests
4+
5+
5 Pass
6+
Pass iframe.srcdoc assigned via policy (successful HTML transformation).
7+
Pass `iframe.srcdoc = string` throws.
8+
Pass `iframe.srcdoc = null` throws.
9+
Pass `iframe.srcdoc = string` assigned via default policy (successful HTML transformation).
10+
Pass `iframe.srcdoc = null` assigned via default policy does not throw
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Harness status: OK
2+
3+
Found 104 tests
4+
5+
104 Pass
6+
Pass Event handler onclick should be blocked.
7+
Pass Event handler onchange should be blocked.
8+
Pass Event handler onfocus should be blocked.
9+
Pass Event handler oNclick should be blocked.
10+
Pass Event handler OnClIcK should be blocked.
11+
Pass Non-event handler one should not be blocked.
12+
Pass Non-event handler oNe should not be blocked.
13+
Pass Non-event handler onIcon should not be blocked.
14+
Pass Non-event handler offIcon should not be blocked.
15+
Pass Non-event handler blubb should not be blocked.
16+
Pass Non-event handler div.align should not be blocked.
17+
Pass Non-event handler div.title should not be blocked.
18+
Pass Non-event handler div.inert should not be blocked.
19+
Pass Non-event handler div.draggable should not be blocked.
20+
Pass Event handler div.onabort should be blocked.
21+
Pass Event handler div.onauxclick should be blocked.
22+
Pass Event handler div.onbeforeinput should be blocked.
23+
Pass Event handler div.onbeforematch should be blocked.
24+
Pass Event handler div.onbeforetoggle should be blocked.
25+
Pass Event handler div.onblur should be blocked.
26+
Pass Event handler div.oncancel should be blocked.
27+
Pass Event handler div.oncanplay should be blocked.
28+
Pass Event handler div.oncanplaythrough should be blocked.
29+
Pass Event handler div.onchange should be blocked.
30+
Pass Event handler div.onclick should be blocked.
31+
Pass Event handler div.onclose should be blocked.
32+
Pass Event handler div.oncommand should be blocked.
33+
Pass Event handler div.oncontextlost should be blocked.
34+
Pass Event handler div.oncontextmenu should be blocked.
35+
Pass Event handler div.oncontextrestored should be blocked.
36+
Pass Event handler div.oncopy should be blocked.
37+
Pass Event handler div.oncuechange should be blocked.
38+
Pass Event handler div.oncut should be blocked.
39+
Pass Event handler div.ondblclick should be blocked.
40+
Pass Event handler div.ondrag should be blocked.
41+
Pass Event handler div.ondragend should be blocked.
42+
Pass Event handler div.ondragenter should be blocked.
43+
Pass Event handler div.ondragleave should be blocked.
44+
Pass Event handler div.ondragover should be blocked.
45+
Pass Event handler div.ondragstart should be blocked.
46+
Pass Event handler div.ondrop should be blocked.
47+
Pass Event handler div.ondurationchange should be blocked.
48+
Pass Event handler div.onemptied should be blocked.
49+
Pass Event handler div.onended should be blocked.
50+
Pass Event handler div.onerror should be blocked.
51+
Pass Event handler div.onfocus should be blocked.
52+
Pass Event handler div.onfocusin should be blocked.
53+
Pass Event handler div.onfocusout should be blocked.
54+
Pass Event handler div.onformdata should be blocked.
55+
Pass Event handler div.oninput should be blocked.
56+
Pass Event handler div.oninvalid should be blocked.
57+
Pass Event handler div.onkeydown should be blocked.
58+
Pass Event handler div.onkeypress should be blocked.
59+
Pass Event handler div.onkeyup should be blocked.
60+
Pass Event handler div.onload should be blocked.
61+
Pass Event handler div.onloadeddata should be blocked.
62+
Pass Event handler div.onloadedmetadata should be blocked.
63+
Pass Event handler div.onloadstart should be blocked.
64+
Pass Event handler div.onmousedown should be blocked.
65+
Pass Event handler div.onmouseenter should be blocked.
66+
Pass Event handler div.onmouseleave should be blocked.
67+
Pass Event handler div.onmousemove should be blocked.
68+
Pass Event handler div.onmouseout should be blocked.
69+
Pass Event handler div.onmouseover should be blocked.
70+
Pass Event handler div.onmouseup should be blocked.
71+
Pass Event handler div.onpaste should be blocked.
72+
Pass Event handler div.onpause should be blocked.
73+
Pass Event handler div.onplay should be blocked.
74+
Pass Event handler div.onplaying should be blocked.
75+
Pass Event handler div.onprogress should be blocked.
76+
Pass Event handler div.onratechange should be blocked.
77+
Pass Event handler div.onreset should be blocked.
78+
Pass Event handler div.onresize should be blocked.
79+
Pass Event handler div.onscroll should be blocked.
80+
Pass Event handler div.onscrollend should be blocked.
81+
Pass Event handler div.onsecuritypolicyviolation should be blocked.
82+
Pass Event handler div.onseeked should be blocked.
83+
Pass Event handler div.onseeking should be blocked.
84+
Pass Event handler div.onselect should be blocked.
85+
Pass Event handler div.onselectionchange should be blocked.
86+
Pass Event handler div.onslotchange should be blocked.
87+
Pass Event handler div.onstalled should be blocked.
88+
Pass Event handler div.onsubmit should be blocked.
89+
Pass Event handler div.onsuspend should be blocked.
90+
Pass Event handler div.ontimeupdate should be blocked.
91+
Pass Event handler div.ontoggle should be blocked.
92+
Pass Event handler div.onvolumechange should be blocked.
93+
Pass Event handler div.onwaiting should be blocked.
94+
Pass Event handler div.onwebkitanimationend should be blocked.
95+
Pass Event handler div.onwebkitanimationiteration should be blocked.
96+
Pass Event handler div.onwebkitanimationstart should be blocked.
97+
Pass Event handler div.onwebkittransitionend should be blocked.
98+
Pass Event handler div.onwheel should be blocked.
99+
Pass Event handler div.onpointerover should be blocked.
100+
Pass Event handler div.onpointerenter should be blocked.
101+
Pass Event handler div.onpointerdown should be blocked.
102+
Pass Event handler div.onpointermove should be blocked.
103+
Pass Event handler div.onpointerrawupdate should be blocked.
104+
Pass Event handler div.onpointerup should be blocked.
105+
Pass Event handler div.onpointercancel should be blocked.
106+
Pass Event handler div.onpointerout should be blocked.
107+
Pass Event handler div.onpointerleave should be blocked.
108+
Pass Event handler div.ongotpointercapture should be blocked.
109+
Pass Event handler div.onlostpointercapture should be blocked.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Harness status: OK
2+
3+
Found 2 tests
4+
5+
2 Pass
6+
Pass No violation reported for TrustedHTML.
7+
Pass Violation report for plain string.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Harness status: OK
2+
3+
Found 2 tests
4+
5+
2 Pass
6+
Pass No violation reported for TrustedHTML.
7+
Pass Violation report for plain string.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Harness status: OK
2+
3+
Found 2 tests
4+
5+
2 Pass
6+
Pass No violation reported for TrustedHTML.
7+
Pass Violation report for plain string.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Harness status: Error
2+
3+
Found 10 tests
4+
5+
3 Pass
6+
7 Fail
7+
Pass No violation reported for trusted types.
8+
Fail Violation report for HTMLIFrameElement.setAttribute('srcdoc', plain_string)
9+
Fail Violation report for HTMLIFrameElement.setAttributeNS(null, 'srcdoc', plain_string)
10+
Pass Violation report for Element.setAttribute('onclick', plain_string)
11+
Pass Violation report for Element.setAttributeNS(null, 'onclick', plain_string)
12+
Fail Violation report for HTMLScriptElement.setAttribute('src', plain_string)
13+
Fail Violation report for HTMLScriptElement.setAttributeNS(null, 'src', plain_string)
14+
Fail Violation report for SVGScriptElement.setAttribute('href', plain_string)
15+
Fail Violation report for SVGScriptElement.setAttributeNS(null, 'href', plain_string)
16+
Fail Violation report for SVGScriptElement.setAttributeNS(http://www.w3.org/1999/xlink, 'href', plain_string)

0 commit comments

Comments
 (0)