From 95f5316b37ff40b0498d4dcc68dc8d60ab39f4bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 13 Jan 2025 10:33:58 +0100 Subject: [PATCH] Add tests for setAttribute/setAttributeNS and non-event-handler attributes This is a tentative test for [1] covering bullet 3 from [2]. There is a separate PR to cover the bullet 2 [3]. Most of these are probably already covered by other tests but assertions are scattered into multiple files as a side check in the default policy callback, so they are hard to understand and to guarantee they actually run (some mistakes were previously found about this in the past). Additionnaly, this new test cover both setAttribute and setAttributeNS and ensure the correct callback is called exactly once with proper attributes (e.g. to verify a call to setAttribute does not trigger the callback with the parameters of a reflected IDL attribute). [1] https://github.com/whatwg/dom/pull/1268 [2] https://w3c.github.io/trusted-types/dist/spec/#get-trusted-type-data-for-attribute [3] https://github.com/web-platform-tests/wpt/pull/50025 --- ...ribute-setAttributeNS-sinks.tentative.html | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 trusted-types/Element-setAttribute-setAttributeNS-sinks.tentative.html diff --git a/trusted-types/Element-setAttribute-setAttributeNS-sinks.tentative.html b/trusted-types/Element-setAttribute-setAttributeNS-sinks.tentative.html new file mode 100644 index 00000000000000..f9a3ae69c92c38 --- /dev/null +++ b/trusted-types/Element-setAttribute-setAttributeNS-sinks.tentative.html @@ -0,0 +1,98 @@ + + + + + + + + + +