mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement Trusted types document write sinks (#36824)
Implements the Document.write algorithm covering Trusted HTML. Part of #36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
43edab336a
commit
c00e0aae61
9 changed files with 142 additions and 107 deletions
2
tests/wpt/meta/MANIFEST.json
vendored
2
tests/wpt/meta/MANIFEST.json
vendored
|
@ -818553,7 +818553,7 @@
|
|||
]
|
||||
],
|
||||
"block-string-assignment-to-Document-write.html": [
|
||||
"0b16a9c4910070b2bcf829d15b1aba8b7be9d060",
|
||||
"c774dca4390955b3b91f1648adb18ad22bd6e355",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[Document-write-exception-order.xhtml]
|
||||
[`document.write(string)` throws TypeError]
|
||||
expected: FAIL
|
|
@ -1,42 +0,0 @@
|
|||
[block-string-assignment-to-Document-write.html]
|
||||
[`document.write(string)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.write(string, string)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.write(string, TrustedHTML)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.writeln(string)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.writeln(string, string)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.writeln(string, TrustedHTML)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.write(null)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.writeln(null)` throws]
|
||||
expected: FAIL
|
||||
|
||||
[`document.write(string)` observes default policy]
|
||||
expected: FAIL
|
||||
|
||||
[`document.write(string, string)` observes default policy]
|
||||
expected: FAIL
|
||||
|
||||
[`document.write(string, TrustedHTML)` observes default policy]
|
||||
expected: FAIL
|
||||
|
||||
[`document.writeln(string)` observes default policy]
|
||||
expected: FAIL
|
||||
|
||||
[`document.writeln(string, string)` observes default policy]
|
||||
expected: FAIL
|
||||
|
||||
[`document.writeln(string, TrustedHTML)` observes default policy]
|
||||
expected: FAIL
|
|
@ -1,6 +0,0 @@
|
|||
[trusted-types-reporting-for-Document-write.html]
|
||||
[Violation report for plain string for write() with at least one plain string argument.]
|
||||
expected: FAIL
|
||||
|
||||
[Violation report for plain string for writeln() with at least one plain string argument.]
|
||||
expected: FAIL
|
|
@ -124,6 +124,9 @@
|
|||
assert_equals(sink, "Document write");
|
||||
} else if (html === "assertSinkEqualsDocumentWriteLn") {
|
||||
assert_equals(sink, "Document writeln");
|
||||
} else if (html === "assertSinkEqualsDocumentWriteLn\n") {
|
||||
// Ensure that new line characters aren't incorrectly added prior to processing
|
||||
assert_unreached(`Should not process any other HTML, but got "${html}"`);
|
||||
}
|
||||
|
||||
return html.replace("Hi", "Quack")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue