#!/usr/bin/env python TEMPLATE = ''' <%(elementname)s> element applies style%(aschildof)s - Google Doctype

Google Doctype

Documenting the open web


This is a test case that checks how browsers react to specific JavaScript, CSS, or HTML markup. It does not necessarily correspond to any web standard, so you should not automatically interpret a "fail" result as a bug.

<%(parentelementname)s><%(elementname)s id="test">
tested.....<style type="text/css">
             div#control { color: #abcdef }
             %(elementname)s#test { color: #abcdef }
           </style>
           <div id="control"></div> <%(parentelementname)s><%(elementname)s id="test"></%(parentelementname)s>
expected...control.color == test.color
found......control.color 

''' for wikiname, parentelementname, elementname in [l.strip().split(' ', 2) for l in file('html/elements/elements.txt').readlines() if not l.startswith('#')]: testFile = 'html/elements/' + elementname.replace(' ', '-').replace('=', '-') + '-element-' if parentelementname != 'null': testFile += 'as-child-of-' + parentelementname + '-' aschildof = ' as child of ' + parentelementname else: aschildof = '' testFile += 'applies-style-test.html' output = TEMPLATE % globals() output = output.replace('', '').replace('', '') output = output.replace('<null>', '').replace('</null>', '') print testFile file(testFile, 'w').write(output)