Skip to content

Conversation

@lukewarlow
Copy link
Member

The previous tests were wrong and don't pass in either of the two implementations (Chromium or WebKit).

SVGScriptElement is intended to behave as close to HTMLScriptElement as possible and innerHTML doesn't work differently for HTMLScriptElement compared with other elements.

Copy link
Contributor

@fred-wang fred-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok, but I believe you can now really just copy

https://searchfox.org/mozilla-central/source/testing/web-platform/tests/trusted-types/trusted-types-reporting-for-Element-innerHTML.html

with createElement("div") replaced with createElementNS(NSURI_SVG, "script") (and use support/namespaces.js).

That will exercise clipping of sample.

@lukewarlow lukewarlow force-pushed the trusted-types-svg-script-fixes branch from 9eee087 to d18c8bc Compare February 3, 2025 14:35
Copy link
Contributor

@fred-wang fred-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, these newer tests are better indeed.

@lukewarlow lukewarlow changed the title Update tests for SVGScriptElement innerHTML to match reality Improve TT tests for SVG and HTML script innerHTML Feb 3, 2025
@lukewarlow lukewarlow enabled auto-merge (squash) February 3, 2025 14:37
@lukewarlow lukewarlow merged commit 50c5225 into master Feb 3, 2025
17 checks passed
@lukewarlow lukewarlow deleted the trusted-types-svg-script-fixes branch February 3, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants