Commit 79f068c6 authored by andersca's avatar andersca

2005-12-30 Anders Carlsson <andersca@mac.com>

        Reviewed by Eric.

		- Update tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=6297
        XMLSerializer should use createMarkup

        * fast/dom/XMLSerializer.html:
        * fast/dom/XMLSerializer-expected.txt:
        Create a document fragment and serialize it.

        * fast/dom/dom-parse-serialize.html:
        * fast/dom/dom-parse-serialize-expected.txt:
        Add some entities to attributes and text nodes.

        * fast/xsl/xslt-processer-expected.txt:
        Update test results.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e1be1a16
2005-12-30 Anders Carlsson <andersca@mac.com>
Reviewed by Eric.
- Update tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=6297
XMLSerializer should use createMarkup
* fast/dom/XMLSerializer.html:
* fast/dom/XMLSerializer-expected.txt:
Create a document fragment and serialize it.
* fast/dom/dom-parse-serialize.html:
* fast/dom/dom-parse-serialize-expected.txt:
Add some entities to attributes and text nodes.
* fast/xsl/xslt-processer-expected.txt:
Update test results.
2005-12-30 Eric Seidel <eseidel@apple.com>
No review, just adding a couple missing results.
......
This tests XMLSerializer on different node types. If the test is successful, there should be four lines of output. The first line should be the child1 tag. The second should be the child2 tag. The third one should be a comment and the fourth one should be the complete document.
This tests XMLSerializer on different node types. If the test is successful, there should be five lines of output. The first line should be the child1 tag. The second should be the child2 tag. The third one should be a comment, the fourth one should be the complete document and the fifth one should be the complete document but serialized from a document fragment node.
<child1>First child</child1>
<child2 attr="an attribute">Second child</child2>
<!-- A comment -->
<test><child1>First child</child1><child2 attr="an attribute">Second child</child2><!-- A comment --></test>
<test><child1>First child</child1><child2 attr="an attribute">Second child</child2><!-- A comment --></test>
......@@ -30,18 +30,23 @@ function runTests() {
child2 = child1.nextSibling
comment = child2.nextSibling;
fragment = doc.createDocumentFragment();
fragment.appendChild(doc.documentElement.cloneNode(true))
serializer = new XMLSerializer();
debug(serializer.serializeToString(child1));
debug(serializer.serializeToString(child2));
debug(serializer.serializeToString(comment));
debug(serializer.serializeToString(doc));
debug(serializer.serializeToString(fragment));
}
</script>
</head>
<body onload="runTests()">
This tests XMLSerializer on different node types. If the test is successful, there should be four lines of output. The first line should be the child1 tag. The second should be the child2 tag. The third one should be a comment and the fourth one should be the complete document.
This tests XMLSerializer on different node types. If the test is successful, there should be five lines of output. The first line should be the child1 tag. The second should be the child2 tag. The third one should be a comment, the fourth one should be the complete document and the fifth one should be the complete document but serialized from a document fragment node.
<ul id="console">
</ul>
</body>
......
......@@ -25,7 +25,7 @@ layer at (0,0) size 800x600
text run at (0,60) width 40: "<doc>"
text run at (0,75) width 536: " <foo xmlns=\"foobar\">One</foo> <x:bar xmlns:x=\"barfoo\">Two</x:bar>"
text run at (0,90) width 184: " <d id=\"id3\">Three</d>"
text run at (0,105) width 48: "</doc>"
text run at (0,105) width 392: "<f id=\"&amp;&lt;&gt;\">Four&amp;&lt;&gt;</f></doc>"
RenderBlock {DIV} at (0,268) size 784x61 [border: (1px solid #000000)]
RenderBlock (anonymous) at (1,1) size 782x18
RenderInline {SPAN} at (0,0) size 112x18 [color=#800000]
......@@ -46,4 +46,4 @@ layer at (0,0) size 800x600
text run at (0,0) width 40: "<doc>"
text run at (0,15) width 536: " <foo xmlns=\"foobar\">One</foo> <x:bar xmlns:x=\"barfoo\">Two</x:bar>"
text run at (0,30) width 184: " <d id=\"id3\">Three</d>"
text run at (0,45) width 48: "</doc>"
text run at (0,45) width 392: "<f id=\"&amp;&lt;&gt;\">Four&amp;&lt;&gt;</f></doc>"
......@@ -40,7 +40,7 @@ function execute()
{
var parser = new DOMParser();
var str =
'<?xml version="1.0"?>\n<!DOCTYPE doc [\n<!ATTLIST d id ID #IMPLIED>\n]>\n<doc>\n <foo xmlns="foobar">One</foo> <x:bar xmlns:x="barfoo">Two</x:bar>\n <d id="id3">Three</d>\n</doc>\n';
'<?xml version="1.0"?>\n<!DOCTYPE doc [\n<!ATTLIST d id ID #IMPLIED>\n]>\n<doc>\n <foo xmlns="foobar">One</foo> <x:bar xmlns:x="barfoo">Two</x:bar>\n <d id="id3">Three</d>\n<f id="&amp;&lt;&gt;">Four&amp;&lt;&gt;</f><empty/><empty></empty></doc>\n';
var doc = parser.parseFromString(str,"text/xml");
document.getElementById("id1").firstChild.nodeValue = str;
......
0.1 original xml:
<?xml-stylesheet type="text/xsl" href="xslt-text.xsl"?><TEST>SOURCE XML: <<<&тест&>>></TEST>
<?xml-stylesheet type="text/xsl" href="xslt-text.xsl"?><TEST>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;</TEST>
0.2 xsl1:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" encoding="KOI8-R" />
<xsl:template match="TEST">CHARACTERS IN XSLT: <<<&тест&>>>
<xsl:apply-templates /><xsl:text>
<xsl:output method="text" encoding="KOI8-R"/>
<xsl:template match="TEST">CHARACTERS IN XSLT: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;
<xsl:apply-templates/><xsl:text>
</xsl:text></xsl:template>
<xsl:template>
<xsl:value-of select="." />
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
0.3 xsl2:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8" />
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="TEST">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
CHARACTERS IN XSLT: ééééééééééé <br /> <xsl:apply-templates />
CHARACTERS IN XSLT: ééééééééééé <br /> <xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template>
<xsl:value-of select="." />
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
......@@ -37,11 +37,11 @@
1.1 Import two different stylesheets:
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8"></HEAD><BODY>
CHARACTERS IN XSLT: ééééééééééé <BR><BR>SOURCE XML: <<<&тест&>>>
CHARACTERS IN XSLT: ééééééééééé <BR><BR>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;
</BODY></HTML>
1.2 Import same stylesheet twice:
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title /></head>
<head><title></title></head>
<body>
<pre>CHARACTERS IN XSLT: <<<&тест&>>>
SOURCE XML: <<<&тест&>>>
......@@ -67,9 +67,9 @@ Success
Success
2.5 transformed fragment containing only text:
****Failure**** (expected: "SUCCESS" actual: "<html xmlns="http://www.w3.org/1999/xhtml">
<head><title /></head>
<head><title></title></head>
<body>
<pre />
<pre></pre>
</body>
</html>")
2.6 fragment using passed parameters:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment