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

issueReporter: Trusted Types compatibility: use DOM API for creating HTML elements instead of string concatenation. #104643

Closed
annkamsk opened this issue Aug 14, 2020 · 0 comments · Fixed by #104644
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders

Comments

@annkamsk
Copy link
Contributor

This is the next step in resolving #103699. It aims to replace construction of HTML elements by string concatenation with DOM API calls in all of the simple cases (i.a. when the text content of the element is not rendered in any special way eg. with codicons).

For example:
Replace
this._domNode.innerHTML = ‘<span>no commands</span>’;
with

this._domNode.innerText = ‘’;
this._domNode.appendChild(createHTMLElement<HTMLSpanElement>(‘span’, ‘no commands’);

This is ~10% of all of the issues discovered with tsec.

+@koto @engelsdamien

@annkamsk annkamsk changed the title Trusted Types compatibility: use DOM API for creating HTML elements instead of string concatenation. issueReporter: Trusted Types compatibility: use DOM API for creating HTML elements instead of string concatenation. Aug 24, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@jrieken @annkamsk and others