-
Notifications
You must be signed in to change notification settings - Fork 74
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
CreateXXX as specced can return null values but not marked as such in IDL #414
Comments
Good catch again! I think this was lost in one of the refactorings. The behaviour we want is:
The spec currently doesn't follow that. I think the best course of action would be to:
Alternatively, inline the null/undefined-supporting variant of Create a Trusted Type into Process value with a default policy? |
I'm thinking potentially a separate algorithm that returns the raw response from the callback, which the Create a Trusted Type algorithm then wraps in a trusted type. and the default policy algorithm can call the version which returns the raw value and act accordingly? That's how I'd implement this myself so makes sense for the spec to match. That way we can also update the default policy handling to do more in future if we wanted extra behaviour. |
That also works :) |
I've extracted a new "Get Trusted Type policy value" algorithm and moved the stringify and null handling to the respective places in #420 this should fix this issue. |
https://w3c.github.io/trusted-types/dist/spec/#create-a-trusted-type-algorithm - returns null or undefined if that's what the default policies functions return and the default policy is being invoked.
But CreateXXX functions on TrustedTypePolicy are marked as returning TrustedHTML without any optionality.
Chromium doesn't ever seem to return null in this case either so I'm slightly confused.
The text was updated successfully, but these errors were encountered: