michael@0: /* michael@0: Distributed under both the W3C Test Suite License [1] and the W3C michael@0: 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the michael@0: policies and contribution forms [3]. michael@0: michael@0: [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license michael@0: [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license michael@0: [3] http://www.w3.org/2004/10/27-testcases michael@0: */ michael@0: michael@0: /* michael@0: * This file automatically generates browser tests for WebIDL interfaces, using michael@0: * the testharness.js framework. To use, first include the following: michael@0: * michael@0: * michael@0: * michael@0: * michael@0: * michael@0: * michael@0: * Then you'll need some type of IDLs. Here's some script that can be run on a michael@0: * spec written in HTML, which will grab all the elements with class="idl", michael@0: * concatenate them, and replace the body so you can copy-paste: michael@0: * michael@0: var s = ""; michael@0: [].forEach.call(document.getElementsByClassName("idl"), function(idl) { michael@0: //https://www.w3.org/Bugs/Public/show_bug.cgi?id=14914 michael@0: if (!idl.classList.contains("extract")) michael@0: { michael@0: s += idl.textContent + "\n\n"; michael@0: } michael@0: }); michael@0: document.body.innerHTML = '
';
michael@0:      document.body.firstChild.textContent = s;
michael@0:  *
michael@0:  * (TODO: write this in Python or something so that it can be done from the
michael@0:  * command line instead.)
michael@0:  *
michael@0:  * Once you have that, put it in your script somehow.  The easiest way is to
michael@0:  * embed it literally in an HTML file with