'Canonical, authoritive source of W3C WebIDLs [duplicate]
How do I find the the authoritative source of machine-readable Web IDL for a given W3C standard?
For example, https://www.w3.org/TR/2018/REC-IndexedDB-2-20180130/ is the authoritative source of the Indexed Database 2.0 specification document. That specification links to the Web IDL standard, but not to any actual Web IDL files for IndexedDB itself.
If I search around, I can find the relevant Web IDL files interspersed with Web IDL files for other specifications, e.g. the IDB*
files in this repo or this Rust crate. However, I am looking for the single source which has the same authority as the above specification document. You'd think the W3C IndexedDB GitHub repo would have it but no.
Solution 1:[1]
There isn't another source that has the same authority as the specification document, for the obvious reason that if they differed which one would take precedence?
The way it's done in modern specs from the W3C and WHATWG is that the authorative spec for the IDL is embedded in the specification. The specification itself is designed to be machine readable. For instance, you'll find each IDL definitions inside an element with the class "idl". The name of the interface can be found within each block inside a dfn
element with the data attribute data-dfn-type="interface"
. And so on.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |