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

Partially revert "Implement parseHTMLUnsafe and setHTMLUnsafe" #43202

Conversation

gsnedders
Copy link
Member

This partially reverts commit 17743f7.

There is no reason for the Declarative Shadow DOM API tests to rely on these methods, and this reduces test coverage for browsers that don't support them. Per general policy, tests shouldn't be relying on unrelated features, especially when those other features lack interoperable cross-browser support.

This partially reverts commit 17743f7.

There is no reason for the Declarative Shadow DOM API tests to rely on
these methods, and this reduces test coverage for browsers that don't
support them. Per general policy, tests shouldn't be relying on
unrelated features, especially when those other features lack
interoperable cross-browser support.
@@ -0,0 +1,4 @@
function setInnerHTML(el,content) {
const fragment = (new DOMParser()).parseFromString(`<pre>${content}</pre>`, 'text/html', {includeShadowRoots: true});
Copy link
Member

Choose a reason for hiding this comment

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

This is a non-standard API so I don't think this works.

Copy link
Contributor

@mfreed7 mfreed7 Nov 16, 2023

Choose a reason for hiding this comment

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

Right - this is the old version of parseHTMLUnsafe(), and it won’t be standardized.

Copy link
Contributor

Choose a reason for hiding this comment

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

Only chrome added the includeShadowRoots parameter, right?
So these tests would have never worked before my test change anyway?

Copy link
Member

Choose a reason for hiding this comment

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

WebKit had a preffed-off implementation, but I removed it.

I think @gsnedders is okay with closing this PR so I'll do that to avoid further confusion.

@annevk annevk closed this Nov 22, 2023
@gsnedders gsnedders deleted the declarative-shadow-dom-no-sanitizer-api branch November 24, 2023 14:47
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.

6 participants