-
Notifications
You must be signed in to change notification settings - Fork 31
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
toString is reserved identifier. #30
Comments
Candidates:
|
I like sanitze 😊 I always feel bad about assigning string to innerHTML after working on Trusted Types, so something that is different from word string would be nice 😊 |
We had agreed on The reason for a default-to-DocFragment is that the Sanitizer will create a DOM Tree and traverse it internally. Returning a copy of that DOM tree is more performant than serializing it to a String and then using this tree to create another DOM tree when the developer ends up using innerHTML. i.e., |
Hmm, I really don’t like the word string. We are assigning things to innerHTML, and we should really call out that we are assigning HTML, not string. This is my personal preference though. |
This depends on #20 (comment). If TT would allow creating a I don't think we should even be offering strings as a return value for HTML in new APIs. We know what that led to. |
Agreed 😊
I'm against this idea for Sanitizer API (though this might make sense for other APIs)🙁 The reason being, because we need to be flexible about whatever people decides to add in their SanitizerConfig, we do need to return string when we are unsure if the output would cause an XSS. This will ensure that the output is string, and therefore it's still unsafe to assign it as an HTML. However I have to agree that this would make a confusion that sanitizeToHTML might return a string, which is weird 😂 |
Agreed. I guess a right way to put it, there should ideally be 3 distinct methods - for fragment, a string, and |
Marking as closed, since there's no more |
toString is a reserved identifier in WebIDL. (See sentence starting with "The identifier of any".) We need to pick a different name.
The text was updated successfully, but these errors were encountered: