Re: [w3ctag/design-reviews] HTMLScriptElement.supports(type) method (#674)

Our concern is due to the fact that the behavior is scoped to detecting supported values of type. Ideally, this would be expressed as `script.type.supports('...')`, but we accept the impracticality of getting that since `type` is a string.

Two alternate uses of `HTMLScriptElement.supports()` we came up with are: detecting JS features, e.g. `script.supports('es2021')`, or `script.supports('await')`, or a more generic `script.supports('some random js code')` (the latter would detect if everything is parseable without any execution); or collisions with a `HTMLElement.supports()` method that could be used to detect otherwise undetectable feature support on an element.

We did consider adding an argument to supports, e.g. `script.supports('type', 'module')`, but felt that was too early to define how alternative values would work.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/674#issuecomment-920137757

Received on Wednesday, 15 September 2021 15:45:26 UTC