-
Notifications
You must be signed in to change notification settings - Fork 56
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
HTMLScriptElement.supports(type) method #674
Comments
Quick question: How is this detected today? Is this API proposing a nicer way to feature detect what values the |
This API is proposing a nicer and synchronous way to feature detect. For
(Note: Safari 10 did support For
|
@plinss and I looked at the proposal during our Gethen vf2f. The overall author simplification and improvement of the API over what they need to do today is certainly great. One concern we have is they way the capability is to be exposed, the |
I understand the concern. Changing the name to @domenic |
This PR reflects the feedback from the TAG review: w3ctag/design-reviews#674 The original HTMLScriptElement.supports() was introduced by whatwg#7008.
I kind of prefer the brevity and clarity of the existing method, and how it matches existing platform conventions (e.g. |
I definitely see @domenic's point. I suppose if in the future we need to detect something else, there can be an optional second argument to |
Our concern is due to the fact that the behavior is scoped to detecting supported values of type. Ideally, this would be expressed as Two alternate uses of We did consider adding an argument to supports, e.g. |
These don't seems specific to |
|
I don't understand why we would add anything to the |
For the reason I stated, as a general purpose supports mechanism, similar to Note that I'm not trying to design new features here, @atanassov and I are just asking the question "are there potential uses of a generic The bottom line is that while we can spend all day imagining (or denying) future uses, we just can't know what the future will bring. In general, using narrowly scoped features allows more flexibility down the road. If the goal here is brevity, I don't think saving 4 characters is worth the risk of future naming collisions which could lead to author confusion. If your concern is more about being consistent with |
OK. I guess we just have to agree to disagree. |
@domenic besides the brevity of the current name I don't see how the current proposal helps.
As @plinss pointed out, this is precisely the confusing part with the current proposal because |
It provides the appropriately-scoped capability for the name. |
But that’s just it, it doesn’t test what the script element supports, it tests what values of the type property the script element supports. What about when we want to add a test for values of another property? |
It is my judgment as HTML editor that the most fundamental property of the script element is what types it supports. If, in some hypothetical (but in my judgment extremely unlikely) future there were some other property we'd want to test support for, we would add a new method named |
Also, most newer IDL attributes are limited to "known values", which means you can do feature testing without a dedicated method. That's generally the HTML way and what I would expect us to continue to use. |
@annevk and @domenic, thank you both for the engagement and feedback. It seems like we've exhausted the feedback on this particular issue on both sides. You have TAG's naming opinion and it is up to you what the final shape of it is. After all, our position is to provide advice and not force an opinion. With that being said, the merit of the overall proposal is something we do like and want to see move forward, thus, closing the review. Thank you for working with us. Looking forward to your further progress. |
Ya ya yawm TAG!
I'm requesting a TAG review of HTMLScriptElement.supports(type) method.
HTMLScriptElement.supports(type) method provides a unified way to detect new features that use script elements.
Further details:
We'd prefer the TAG provide feedback as (please delete all but the desired option):
💬 leave review feedback as a comment in this issue and @-notify @horo-t
The text was updated successfully, but these errors were encountered: