mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Add trusted type checks for global event handler attributes (#38718)
This only covers the global event handlers for now, while I figure out which others we are missing. We don't seem to be missing the WindowEventHandlers, but not sure where the others coming from. Part of #36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
9da8142e2a
commit
a31235e52b
11 changed files with 110 additions and 401 deletions
|
@ -1,6 +0,0 @@
|
|||
[GlobalEventHandlers-onclick.html]
|
||||
[a.setAttribute('onclick') sets an unsuitable trusted type.]
|
||||
expected: FAIL
|
||||
|
||||
[a.setAttribute('click') sets a test string.]
|
||||
expected: FAIL
|
|
@ -1,9 +0,0 @@
|
|||
[TrustedTypePolicyFactory-getAttributeType.html]
|
||||
[getAttributeType(\n "DIV",\n "onclick",\n "http://www.w3.org/1999/xhtml",\n "null") == "TrustedScript"]
|
||||
expected: FAIL
|
||||
|
||||
[getAttributeType(\n "g",\n "ondblclick",\n "http://www.w3.org/2000/svg",\n "null") == "TrustedScript"]
|
||||
expected: FAIL
|
||||
|
||||
[getAttributeType(\n "mrow",\n "onmousedown",\n "http://www.w3.org/1998/Math/MathML",\n "null") == "TrustedScript"]
|
||||
expected: FAIL
|
|
@ -1,9 +0,0 @@
|
|||
[TrustedTypePolicyFactory-getPropertyType.tentative.html]
|
||||
[sanity check trustedTypes.getAttributeType.]
|
||||
expected: FAIL
|
||||
|
||||
[getAttributeType tests adapted from w3c/trusted-types polyfill]
|
||||
expected: FAIL
|
||||
|
||||
[getPropertyType vs getAttributeType for event handler.]
|
||||
expected: FAIL
|
|
@ -1,12 +1,3 @@
|
|||
[block-string-assignment-to-Element-setAttribute.html]
|
||||
[div.onclick accepts only TrustedScript]
|
||||
expected: FAIL
|
||||
|
||||
[div.onclick's mutationobservers receive the default policy's value.]
|
||||
expected: FAIL
|
||||
|
||||
[div.onclick accepts string and null after default policy was created.]
|
||||
expected: FAIL
|
||||
|
||||
[`script.src = setAttributeNode(embed.src)` with string works.]
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,22 +1,4 @@
|
|||
[set-attributes-mutations-in-callback.tentative.html]
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -164,24 +146,6 @@
|
|||
[Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -329,24 +293,6 @@
|
|||
[Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,22 +1,4 @@
|
|||
[set-attributes-require-trusted-types-default-policy.html]
|
||||
[Element.setAttribute applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,22 +1,4 @@
|
|||
[set-attributes-require-trusted-types-no-default-policy.html]
|
||||
[Element.setAttribute throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttribute throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNS throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string]
|
||||
expected: FAIL
|
||||
|
||||
[Element.setAttributeNode throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,270 +0,0 @@
|
|||
[trusted-types-event-handlers.html]
|
||||
[Event handler onclick should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler onchange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler onfocus should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler oNclick should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler OnClIcK should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncopy should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncut should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onpaste should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onauxclick should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onabort should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onbeforeinput should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onbeforematch should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onbeforetoggle should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onblur should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncancel should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncanplay should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncanplaythrough should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onchange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onclick should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onclose should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncommand should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncontextmenu should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncontextlost should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncontextrestored should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oncuechange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondblclick should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondrag should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondragend should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondragenter should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondragexit should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondragleave should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondragover should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondragstart should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondrop should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ondurationchange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onemptied should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onended should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onerror should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onfocus should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onformdata should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oninput should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.oninvalid should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onkeydown should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onkeypress should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onkeyup should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onload should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onloadeddata should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onloadedmetadata should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onloadstart should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onmousedown should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onmouseenter should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onmouseleave should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onmousemove should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onmouseout should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onmouseover should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onmouseup should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onwheel should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onpause should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onplay should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onplaying should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onprogress should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onratechange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onreset should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onresize should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onscroll should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onscrollend should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onsecuritypolicyviolation should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onseeked should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onseeking should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onselect should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onshow should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onslotchange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onstalled should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onsubmit should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onsuspend should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ontimeupdate should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ontoggle should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onvolumechange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onwaiting should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onanimationend should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onanimationiteration should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ontransitionrun should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ontransitionend should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.ontransitioncancel should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onselectstart should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onselectionchange should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onwebkitanimationend should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onwebkitanimationiteration should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onwebkitanimationstart should be blocked.]
|
||||
expected: FAIL
|
||||
|
||||
[Event handler div.onwebkittransitionend should be blocked.]
|
||||
expected: FAIL
|
|
@ -1,6 +0,0 @@
|
|||
[trusted-types-reporting-for-Element-setAttribute.html]
|
||||
[Violation report for Element.setAttribute('onclick', plain_string)]
|
||||
expected: FAIL
|
||||
|
||||
[Violation report for Element.setAttributeNS(null, 'onclick', plain_string)]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue