Skip to content

Trusted Types compatibility: use DOM API for creating HTML elements instead of string concatenation in cellRenderer.ts #104661

@annkamsk

Description

@annkamsk

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

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

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

This issue is separated from #104643 as it occurs in what appears to be a more sensitive code, covered with more test cases and placed in a separate module. The issue type and fix strategy should be the same though.

Edit: + @koto @engelsdamien

Metadata

Metadata

Assignees

Labels

debtCode quality issuesengineeringVS Code - Build / issue tracking / etc.insiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions