w3c/web-platform-tests — pull request #1272 by hallvors (2014-10-06 11:36:12+00:00)
Title: Scripts to extract xhr test suite metadata, annotate spec

*Nearly* all tests in the XHR test suite have (potentially outdated) meta data liking them to specific assertations in the spec. (Technically this is a set of space-separated XPath expressions for each link @rel=help element which, combined with the section linked to from the HREF, identifies a given assertation).

Here's some code to actually make use of this data. One Python script to extract the meta data into a single JSON file, and one javascript to iterate over the resulting JSON data and annotate the spec.

To test, load http://www.w3.org/TR/XMLHttpRequest/ and run this from the browser's dev tools' console:

document.body.appendChild(document.createElement('script')).src='http://hallvord.com/temp/xhr/annotate_spec.js'

You may have to disable mixed content blocking in your browser if the spec loads over https.