Typescript: HTMLStyleElement.type is deprecated even though it should not be

Created on 6 Apr 2019  路  5Comments  路  Source: microsoft/TypeScript

What steps will reproduce the problem?
When using HTMLStyleElement.type in javascript it is marked as deprecated

const styleElement  = document.createElement('style');
styleElement.type = 'text/css';

What is the expected result?
https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement/type
There is no information that this field is deprecated.

See attachments in https://youtrack.jetbrains.com/issue/WEB-38252

External

Most helpful comment

Just for anyone who will come to this thread just like me, as of today, the last HTML spec is this one:
https://html.spec.whatwg.org/multipage/

W3C does not provide HTML specs anymore and HTML 5.2 is no longer valid.

So yeah, it is deprecated as it should be.

All 5 comments

It's an obsolete feature per the HTML Standard: https://html.spec.whatwg.org/multipage/obsolete.html#dom-style-type

TypeScript generally has no way to indicate deprecated elements, and removing it would be a hefty breaking change. #390 is related.

It's an obsolete feature per the HTML Standard

However, it is not obsolete in the W3C Recommendation.

Which specification does TypeScript adhere to: WHATWG or W3C?

This is data is sourced from an IDL file we get from the browser. Not really interested in resolving W3C vs WHATWG discrepancies here for the sake of what shows up in the JS Doc.

Just for anyone who will come to this thread just like me, as of today, the last HTML spec is this one:
https://html.spec.whatwg.org/multipage/

W3C does not provide HTML specs anymore and HTML 5.2 is no longer valid.

So yeah, it is deprecated as it should be.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dlaberge picture dlaberge  路  3Comments

kyasbal-1994 picture kyasbal-1994  路  3Comments

MartynasZilinskas picture MartynasZilinskas  路  3Comments

seanzer picture seanzer  路  3Comments

uber5001 picture uber5001  路  3Comments