Intent to Prototype: HTMLScriptElement.supports(type) method

50 views
Skip to first unread message

Tsuyoshi Horo

unread,
Sep 5, 2021, 10:03:03 PM9/5/21
to blink-dev

Contact emails

ho...@chromium.org

 

Explainer

https://github.com/horo-t/explainers/blob/main/script_element_supports.md

 

Specification

https://html.spec.whatwg.org/multipage/scripting.html#dom-script-supports

 

Summary

Provides a unified way to detect new features that use script elements.

 

Blink component

Blink>HTML>Script

 

Motivation

Currently there is no simple way to know what kind of types can be used for HTMLScriptElement’s type attribute.


There are several new feature proposals using the script element.

  https://github.com/WICG/import-maps/

  https://github.com/jeremyroman/alternate-loading-modes/blob/main/triggers.md#speculation-rules

  https://github.com/WICG/resource-bundles/


We can use the nomodule attribute to detect the module type support. But there is no unified method to detect such new features.


If we have the HTMLScriptElement.supports(type) method which is like linkElement.relList.supports(), we can easily detect such features.

 

 

 

Initial public proposal

https://github.com/whatwg/html/issues/6472

 

TAG review

 

 

TAG review status

Pending

 

Risks

Interoperability and Compatibility

Gecko: Supportive on the issue and pull request but no formal signal yet

WebKit: No signal

Web developers: The developer feedback on the spec issue was positive.

 

Debuggability

Developers will be able to call this method from DevTools's console.

 

Is this feature fully tested by web-platform-tests?

Yes

https://crrev.com/c/3133553 will add WPT tests.

 

Flag name

--enable-blink-features=ScriptElementSupports

 

Requires code in //chrome?

False

 

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1245528

 

Estimated milestones

No milestones specified

 

Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5712146835963904

 

This intent message was generated by Chrome Platform Status.


Yoav Weiss

unread,
Sep 6, 2021, 1:08:37 AM9/6/21
to Tsuyoshi Horo, blink-dev
On Mon, Sep 6, 2021 at 4:03 AM Tsuyoshi Horo <ho...@chromium.org> wrote:

Contact emails

ho...@chromium.org

 

Explainer

https://github.com/horo-t/explainers/blob/main/script_element_supports.md

 

Specification

https://html.spec.whatwg.org/multipage/scripting.html#dom-script-supports

 

Summary

Provides a unified way to detect new features that use script elements.

 

Blink component

Blink>HTML>Script

 

Motivation

Currently there is no simple way to know what kind of types can be used for HTMLScriptElement’s type attribute.


There are several new feature proposals using the script element.

  https://github.com/WICG/import-maps/

  https://github.com/jeremyroman/alternate-loading-modes/blob/main/triggers.md#speculation-rules

  https://github.com/WICG/resource-bundles/


We can use the nomodule attribute to detect the module type support. But there is no unified method to detect such new features.


If we have the HTMLScriptElement.supports(type) method which is like linkElement.relList.supports(), we can easily detect such features.

 

 

 

Initial public proposal

https://github.com/whatwg/html/issues/6472

 

TAG review


I think it makes sense to file for a TAG review at this point, to avoid delays further down the road.
 

 

 

TAG review status

Pending

 

Risks

Interoperability and Compatibility

Gecko: Supportive on the issue and pull request but no formal signal yet

WebKit: No signal

Web developers: The developer feedback on the spec issue was positive.

 

Debuggability

Developers will be able to call this method from DevTools's console.

 

Is this feature fully tested by web-platform-tests?

Yes

https://crrev.com/c/3133553 will add WPT tests.

 

Flag name

--enable-blink-features=ScriptElementSupports

 

Requires code in //chrome?

False

 

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1245528

 

Estimated milestones

No milestones specified

 

Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5712146835963904

 

This intent message was generated by Chrome Platform Status.


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADk0S-VYs68fp19ARTmiz9-68nodU5%3Djf_bbfGcJ81Z-ar%2BsPw%40mail.gmail.com.

Tsuyoshi Horo

unread,
Sep 6, 2021, 1:53:20 AM9/6/21
to Yoav Weiss, blink-dev
Thank you for your comment.

I just requested a TAG review.

Thank you.

Reply all
Reply to author
Forward
0 new messages