Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for innerHTML, innerText, textContent, text and src IDL prop… #50022

Merged

Conversation

fred-wang
Copy link
Contributor

…erties

These properties allow to change a script text or URL and need special attention. Existing tests for them are scattered over multiple files and check many other things. This new test focuses on checking whether setting these properties to a plain string would be blocked by a default policy, and what trusted type name and sink names would be passed to the corresponding create callback. We try setting the properties on HTMLDivElement, HTMLScriptElement or SVGScriptElement when they exist.

…erties

These properties allow to change a script text or URL and need special
attention. Existing tests for them are scattered over multiple files
and check many other things. This new test focuses on checking whether
setting these properties to a plain string would be blocked by a default
policy, and what trusted type name and sink names would be passed to the
corresponding create callback. We try setting the properties on
HTMLDivElement, HTMLScriptElement or SVGScriptElement when they exist.
@fred-wang
Copy link
Contributor Author

cc @lukewarlow

I'm not quite sure what the SVG behavior would be, given that's currently not defined in the spec IIUC.

@fred-wang
Copy link
Contributor Author

OK, I have added what the spec currently for SVG innerText and textContent too, we can always change that if the spec changes.

The tests pass in all browsers.

@fred-wang fred-wang requested a review from lukewarlow January 10, 2025 13:04
@fred-wang fred-wang marked this pull request as ready for review January 10, 2025 13:04
Copy link
Member

@lukewarlow lukewarlow left a comment

Choose a reason for hiding this comment

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

LGTM

@fred-wang fred-wang merged commit 17ba65b into master Jan 13, 2025
19 checks passed
@fred-wang fred-wang deleted the blocking-string-assignment-to-text-and-urls-properties branch January 13, 2025 15:16
sadym-chromium pushed a commit that referenced this pull request Jan 14, 2025
#50022)

These properties allow to change a script text or URL and need special
attention. Existing tests for them are scattered over multiple files
and check many other things. This new test focuses on checking whether
setting these properties to a plain string would be blocked by a default
policy, and what trusted type name and sink names would be passed to the
corresponding create callback. We try setting the properties on
HTMLDivElement, HTMLScriptElement or SVGScriptElement when they exist.
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.

4 participants