In the context of the development of the OMTP BONDI APIs that will serve as input to the new Device APIs and Policy Working Group, an OMTP Member, Aplix, developed and released under an open-source license a tool called widlproc that checks the validity of WebIDL interfaces, and turns valid fragments into an XML format.
I already have plenty of ideas on how to exploit that XML serialization of WebIDLs, but as a first step into the world of WebIDLs, I have developed and set up on-line WebIDL checker that provides a wrapper around widlproc. You feed it with the address of an HTML document containing WebIDLs and it:
- automatically extracts WebIDLs fragments from an HTML document (using XPath),
- verifies the validity of these fragments (through widlproc),
- outputs error messages when finding invalid fragments,
- outputs an HTML representation of the APIs otherwise (by applying an XSLT style sheet to wildproc output).
Some examples of results:
- on the 140 WebIDLs included in the HTML 5 specification (where it would have detected the bugs I reported earlier by running widlproc manually on the spec)
- on the latest draft of the GeoLocation API
- on the Camera API proposed by Nokia for the Device APIs and Policy Working Group – where the tool reports an error for the use of the
sequencekeyword that hasn’t made it yet in the official WebIDL spec (but is defined in the editor’s version) and thus isn’t recognized by widlproc yet.
It is clearly a niche-tool – how many people on earth are ever going to write a WebIDL ? But hopefully it will help in detecting bugs in WebIDLs produced by W3C groups and others.