This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0012.html I noticed that the hc_*.html files are nearly standalone now, they can be opened directly in a browser, but one can't run the Javascript code that it's supposed to be testing (for debugging purposes, to test some behaviour without the full JSUnit framework around). Could the scripts that generate the hc_*.html files include something like <a href="javascript:hc_documentgetelementsbytagnametotallength()">test</a> in the <body> part of the page? It shouldn't hurt the normal (non-interactive) case, but it would help when debugging individual problems. Of course I add such lines myself, but it would save a bit of time if all hc_* files had this already. Thanks. -- David FAURE, faure@kde.org Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html
Index: test-to-html.xsl =================================================================== RCS file: /sources/public/2001/DOM-Test-Suite/transforms/test-to-html.xsl,v retrieving revision 1.2 diff -u -r1.2 test-to-html.xsl --- test-to-html.xsl 26 Feb 2002 06:35:36 -0000 1.2 +++ test-to-html.xsl 25 Jun 2003 22:53:24 -0000 @@ -160,7 +160,7 @@ <xsl:template match="text()"> <xsl:param name="indent"/> - <xsl:variable name="normedText" value="normalize-space(.)"/> + <xsl:variable name="normedText" select="normalize-space(.)"/> <xsl:if test="string-length($normedText) > 0"> <xsl:value-of select="$indent"/> <xsl:value-of select="$normedText"/> Index: test-to-jsunit.xsl =================================================================== RCS file: /sources/public/2001/DOM-Test-Suite/transforms/test-to-jsunit.xsl,v retrieving revision 1.13 diff -u -r1.13 test-to-jsunit.xsl --- test-to-jsunit.xsl 20 Jun 2003 20:13:04 -0000 1.13 +++ test-to-jsunit.xsl 25 Jun 2003 22:53:25 -0000 @@ -126,7 +126,9 @@ </head> <body> <p class="jsUnitHeading"><xsl:value-of select="@name"/></p> - <p class="jsUnitDefault">This page contains test "<xsl:value-of select="@name"/>".</p> + <p class="jsUnitDefault">Test source:</p> + <xsl:apply-templates select="." mode="html_source"/> + <p class="jsUnitDefault">Test documents:</p> <xsl:for-each select="$loads"> <xsl:choose> <xsl:when test="@href = 'staff'"/> @@ -135,9 +137,14 @@ <xsl:otherwise> <iframe name="{@var}" src='files/{@href}.html'></iframe> + <br/> </xsl:otherwise> </xsl:choose> </xsl:for-each> + + <a href="javascript:setUpPage()">Run setUpPage</a> + <br/> + <a href="javascript:{@name}()">Run <xsl:value-of select="@name"/></a> </body> </html> </xsl:template> @@ -381,6 +388,137 @@ See W3C License http://www.w3.org/Consortium/Legal/ for more details. </xsl:comment> </xsl:template> + + +<xsl:template match="*[local-name()='metadata']" mode="html_source"> + <xsl:param name="indent"/> + <xsl:value-of select="$indent"/> + <xsl:text><metadata></xsl:text> + <br/> + <xsl:apply-templates select="*" mode="html_metadata"> + <xsl:with-param name="indent" select="concat('     ',$indent)"/> + </xsl:apply-templates> + <xsl:text></metadata></xsl:text> + <br/> +</xsl:template> + +<xsl:template match="*" mode="html_metadata"> + <xsl:param name="indent"/> + <xsl:value-of select="$indent"/> + <xsl:text><</xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:apply-templates select="@*" mode="html_source"/> + <xsl:choose> + <xsl:when test="*|text()"> + <xsl:text>></xsl:text> + <xsl:apply-templates select="*|text()" mode="html-metadata"/> + <xsl:text></</xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:text>></xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>/></xsl:text> + </xsl:otherwise> + </xsl:choose> + <br/> +</xsl:template> + + +<xsl:template match="*" mode="html_source"> + <xsl:param name="indent"/> + <!-- indent the element --> + <xsl:value-of select="$indent"/> + <!-- start the element --> + <xsl:text><</xsl:text> + <!-- output the tag name --> + <xsl:value-of select="local-name()"/> + <!-- output any attributes --> + <xsl:apply-templates select="@*" mode="html_source"/> + + <xsl:choose> + <!-- if there are any child elements --> + + <xsl:when test="*|comment()"> + <!-- then close the start tag --> + <xsl:text>></xsl:text> + <br/> + <!-- emit the child elements --> + <xsl:apply-templates select="*|comment()|text()" mode="html_source"> + <xsl:with-param name="indent" select="concat('     ',$indent)"/> + </xsl:apply-templates> + <!-- write the end tag --> + <xsl:value-of select="$indent"/> + <xsl:text></</xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:text>></xsl:text> + <br/> + </xsl:when> + + <xsl:otherwise> + <!-- close an empty tag --> + <xsl:text>/></xsl:text> + <br/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="@id" mode="html_source"> + <xsl:text> </xsl:text> + <a id="{.}"> + <xsl:text>id='</xsl:text> + <xsl:value-of select="."/> + <xsl:text>'</xsl:text> + </a> +</xsl:template> + +<xsl:template match="@resource" mode="html_source"> + <xsl:text> resource='</xsl:text> + <xsl:choose> + <xsl:when test="contains(.,'#xpointer(id(')"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="substring-before(.,'#xpointer')"/> + <xsl:text>#</xsl:text> + <xsl:variable name="after" select="substring-after(.,"#xpointer(id('")"/> + <xsl:value-of select="substring-before($after,"')")"/> + </xsl:attribute> + <xsl:value-of select="."/> + </a> + </xsl:when> + + <xsl:otherwise> + <a href="{.}"> + <xsl:value-of select="."/> + </a> + </xsl:otherwise> + </xsl:choose> + <xsl:text>'</xsl:text> +</xsl:template> + +<xsl:template match="@*" mode="html_source"> + <xsl:text> </xsl:text> + <xsl:value-of select="local-name()"/> + <xsl:text>='</xsl:text> + <xsl:value-of select="."/> + <xsl:text>'</xsl:text> +</xsl:template> + +<xsl:template match="comment()" mode="html_source"> + <xsl:param name="indent"/> + <xsl:value-of select="$indent"/> + <xsl:text><!--</xsl:text> + <xsl:value-of select="."/> + <xsl:text>--></xsl:text> + <br/> +</xsl:template> + +<xsl:template match="text()" mode="html_metadata"> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="text()" mode="html_source"> +</xsl:template> + </xsl:stylesheet>