Extremely basic visual WebIDL comparison tool
Use it live at: https://inexorabletash.github.io/idldiff/
- The top left/right panels are CodeMirror editors that do very basic syntax highlighting of WebIDL files
- Type or paste WebIDL in the left and right panels
- The WebIDL will be validated using webidl2.js
- The first error encountered will be shown at the bottom, with the offending line highlighted
- If both left and right WebIDL are valid, the parsed results (AST structures) will be compared and the first set of differences reported.
Caveats:
- The diff report is extremely dumb. Basically just a recursive JS comparison function, with some attempt to provide context.
- By default, member order for interfaces is ignored. This is to facilitate testing that
reordering/commenting existing WebIDL files has not changed anything. To override this,
load the page with
?order
as a query parameter. - webidl2.js is missing support for some newer
WebIDL syntax such as
iterable<>
.
To hack on it or host it locally, clone including submodules:
git clone --recursive git://github.com/inexorabletash/idldiff.git
Or:
git clone git://github.com/inexorabletash/idldiff.git
cd idldiff
git submodule update --init --recursive
Then just fire up a web server in the directory and load index.html
- Ideally, the parsed ASTs would be reserialized to WebIDL and compared using a proper diff algorithm.