WebIDL checker
A growing number of W3C groups are in the process of developing JavaScript APIs: the HTML Working Group, the Web Applications Working Group, the SVG Working Group, the Geolocation Working Group, and the newly created Device APIs and Policy Working Group of which I am one of the Staff Contacts.
The Web Applications Working Group has been developing a common IDL format to define these APIs, called WebIDL, which basically takes the OMG IDL format and extend it to make it more useful and informative in the context of JavaScript APIs.
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.
July 30th, 2009 at 09:31
[…] released a WebIDL checker /archives/2009/07/webidl-checker/ (thanks to @kaihendry for making widlproc […]
September 3rd, 2010 at 07:27
The link is broken. Has the format moved to somewhere else ?
September 3rd, 2010 at 07:30
My previous comment is erroneous. The “OMG IDL format” link is broken.
October 30th, 2010 at 09:47
hi, do you know any tools to general from WebIDL and/or xml produced by widlproc javascript stubs of that APIs ? thanks