Closed dbates-wk closed 5 years ago
@travisleithead @hober @rniwa
@annevk
Do we have data as to what various browsers currently do?
This falls out from it being an enum. Web IDL describes enum handling.
This falls out from it being an enum. Web IDL describes enum handling.
Can we please spec this in the normative text? Maybe just move/copy the:
If type does not match a value in the SupportedType enumeration, an exception is thrown [WEBIDL].
to the normative text section.
The normative text for enums is here: https://heycam.github.io/webidl/#es-enumeration. You cannot put it in the algorithm for the function, because at that point IDL validation has already happened by definition.
The normative text for enums is here: https://heycam.github.io/webidl/#es-enumeration. You cannot put it in the algorithm for the function, because at that point IDL validation has already happened by definition.
I see. Is there anything that can be done here to improve the spec. language to make this more apparent?
Closing this issue since the normative equivalent text for throwing an exception for an unsupported MIME type falls out from https://heycam.github.io/webidl/#es-enumeration.
Do we have data as to what various browsers currently do?
I haven't checked Edge, but Mac Chrome Canary Version 74.0.3686.0, Mac Firefox 64.0.2, Safari Version 12.0 (14606.1.36.1.2) seems to be unhappy and throw an exception when I tried to evaluate:
(new DOMParser).parseFromString("<h1>Hello</h1>", "text/HTML")
@dbates-wk I'm not sure, there's a lot of methods that accept enums where the specification doesn't really talk about it and leaves that to IDL. I guess in WebKit this isn't implemented in the IDL layer thus far and therefore it's more of a method-by-method thing to account for?
Latest draft (12/11/2018) only has non-normative text for how parseFromString() behaves when passed an unsupported MIME type, highlighting for emphasis:
But all this text is marked non-normative. And there is no equivalent normative/requirement text to the bolded sentence above. Please spec something normative.
The bolded sentence above doesn’t sound too crazy, but I haven’t surveyed what browsers do, yet.