From 982d8598a4f05c2ae7950b9859797e42c5bc858c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 29 Nov 2024 10:15:21 +0000 Subject: [PATCH] Add a Trusted Type test for setting ShadowRoot's innerHTML. This is essentially a copy of block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html, replacing set `shadowRoot.setHTMLUnsafe(html)` with `shadowRoot.innerHTML = html`. Note that innerHTML uses `LegacyNullToEmptyString`, so setting it to a null behaves slightly differently. Differential Revision: https://phabricator.services.mozilla.com/D229149 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1931276 gecko-commit: 4b6f5fdc1a0ddf5ebd66be2d36743ac965489599 gecko-reviewers: smaug --- ...ng-assignment-to-ShadowRoot-innerHTML.html | 79 +++++++++++++++++++ ...ssignment-to-ShadowRoot-setHTMLUnsafe.html | 23 +++--- 2 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 trusted-types/block-string-assignment-to-ShadowRoot-innerHTML.html diff --git a/trusted-types/block-string-assignment-to-ShadowRoot-innerHTML.html b/trusted-types/block-string-assignment-to-ShadowRoot-innerHTML.html new file mode 100644 index 00000000000000..4b32db165810c3 --- /dev/null +++ b/trusted-types/block-string-assignment-to-ShadowRoot-innerHTML.html @@ -0,0 +1,79 @@ + + + + + + + + + + +
+ + + diff --git a/trusted-types/block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html b/trusted-types/block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html index a76543b3f68c7e..f61de6891f3c2c 100644 --- a/trusted-types/block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html +++ b/trusted-types/block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html @@ -12,9 +12,13 @@