-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interest
Description
What problem are you trying to solve?
Trusted Types added a bunch of IDL changes like this:
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
This is to assign TrustedHTML object, while the getter will only ever return a DOMString. The intention is not clear from the IDL until you read the prose.
What solutions exist today?
Just use the most permissive type to allow both getter and setter requirements 😞
How would you solve it?
Something like the following would be nicer:
attribute getter DOMString innerHTML;
[CEReactions] attribute setter (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
Although the syntax is sad - it allows invalid setup like having a setter only.
[CEReactions, GetterType=DOMString]
attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
Something like this could work too, but I'm not very happy to put types into extended attribute value 🤔
Anything else?
Found while reading the result of microsoft/TypeScript-DOM-lib-generator#2074.
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interest