Tests: Import some newly-passing SVG tests
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/abe1e148121 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3693 Reviewed-by: https://github.com/gmta ✅
|
@ -0,0 +1,9 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 4 tests
|
||||
|
||||
4 Pass
|
||||
Pass new Document(): interfaces
|
||||
Pass new Document(): children
|
||||
Pass new Document(): metadata
|
||||
Pass new Document(): characterSet aliases
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass Null test
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass Dynamic Adding of Elements
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass Dynamic Removal of Elements
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass childElementCount
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass childElementCount
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass Entity References
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass firstElementChild with namespaces
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass firstElementChild
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass lastElementChild
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass nextElementSibling
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass previousElementSibling
|
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Pass
|
||||
Pass Null test
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="windows-1252"?>
|
||||
<!-- Using windows-1252 to ensure that new Document() doesn't inherit utf-8
|
||||
from the parent document. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
width="100%" height="100%" viewBox="0 0 800 600">
|
||||
<title>Document constructor</title>
|
||||
<html:script src="../../resources/testharness.js"></html:script>
|
||||
<html:script src="../../resources/testharnessreport.js"></html:script>
|
||||
<html:script><![CDATA[
|
||||
test(function() {
|
||||
var doc = new Document();
|
||||
assert_true(doc instanceof Node, "Should be a Node");
|
||||
assert_true(doc instanceof Document, "Should be a Document");
|
||||
assert_false(doc instanceof XMLDocument, "Should not be an XMLDocument");
|
||||
assert_equals(Object.getPrototypeOf(doc), Document.prototype,
|
||||
"Document should be the primary interface");
|
||||
}, "new Document(): interfaces")
|
||||
|
||||
test(function() {
|
||||
var doc = new Document();
|
||||
assert_equals(doc.firstChild, null, "firstChild");
|
||||
assert_equals(doc.lastChild, null, "lastChild");
|
||||
assert_equals(doc.doctype, null, "doctype");
|
||||
assert_equals(doc.documentElement, null, "documentElement");
|
||||
assert_array_equals(doc.childNodes, [], "childNodes");
|
||||
}, "new Document(): children")
|
||||
|
||||
test(function() {
|
||||
var doc = new Document();
|
||||
assert_equals(doc.URL, "about:blank");
|
||||
assert_equals(doc.documentURI, "about:blank");
|
||||
assert_equals(doc.compatMode, "CSS1Compat");
|
||||
assert_equals(doc.characterSet, "UTF-8");
|
||||
assert_equals(doc.contentType, "application/xml");
|
||||
assert_equals(doc.createElement("DIV").localName, "DIV");
|
||||
}, "new Document(): metadata")
|
||||
|
||||
test(function() {
|
||||
var doc = new Document();
|
||||
assert_equals(doc.characterSet, "UTF-8", "characterSet");
|
||||
assert_equals(doc.charset, "UTF-8", "charset");
|
||||
assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding");
|
||||
}, "new Document(): characterSet aliases")
|
||||
]]></html:script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>Null test</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of firstElementChild and lastChildElement returning null</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle" font-weight="bold">Test</text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_equals(parentEl.firstElementChild, null)
|
||||
assert_equals(parentEl.lastElementChild, null)
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 797 B |
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>Dynamic Adding of Elements</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of Dynamic Adding of Elements</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of this test is
|
||||
<tspan id="first_element_child" font-weight="bold">unknown.</tspan></text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var newChild = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||
parentEl.appendChild(newChild);
|
||||
assert_equals(parentEl.childElementCount, 2)
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 923 B |
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>Dynamic Removal of Elements</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of Dynamic Removal of Elements</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of this test is
|
||||
<tspan id="first_element_child" font-weight="bold">unknown.</tspan><tspan id="last_element_child"> </tspan></text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var lec = parentEl.lastElementChild;
|
||||
parentEl.removeChild(lec);
|
||||
assert_equals(parentEl.childElementCount, 1)
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 917 B |
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>childElementCount</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of childElementCount with No Child Element Nodes</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle" font-weight="bold">Test</text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_equals(parentEl.childElementCount, 0)
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 745 B |
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>childElementCount</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of childElementCount</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of <tspan id="first_element_child"><tspan>this</tspan> <tspan>test</tspan></tspan> is
|
||||
<tspan id="middle_element_child" font-weight="bold">unknown.</tspan>
|
||||
|
||||
|
||||
|
||||
<tspan id="last_element_child" style="display:none;">fnord</tspan> </text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_true("childElementCount" in parentEl)
|
||||
assert_equals(parentEl.childElementCount, 3)
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 977 B |
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
|
||||
[
|
||||
<!ENTITY tree "<tspan id='first_element_child' font-weight='bold'>unknown.</tspan>">
|
||||
]>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>Entity References</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of Entity References</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of this test is &tree;</text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
var fec = parentEl.firstElementChild;
|
||||
assert_true(!!fec)
|
||||
assert_equals(fec.nodeType, 1)
|
||||
assert_equals(fec.getAttribute("id"), "first_element_child")
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 1 KiB |
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
xmlns:pickle="http://ns.example.org/pickle"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>firstElementChild with namespaces</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of firstElementChild with namespaces</text>
|
||||
<g id="parentEl">
|
||||
<pickle:dill id="first_element_child"/>
|
||||
</g>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var fec = parentEl.firstElementChild;
|
||||
assert_true(!!fec)
|
||||
assert_equals(fec.nodeType, 1)
|
||||
assert_equals(fec.getAttribute("id"), "first_element_child")
|
||||
assert_equals(fec.localName, "dill")
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 898 B |
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>firstElementChild</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of firstElementChild</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of this test is
|
||||
<tspan id="first_element_child" font-weight="bold">unknown.</tspan></text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var fec = parentEl.firstElementChild;
|
||||
assert_true(!!fec)
|
||||
assert_equals(fec.nodeType, 1)
|
||||
assert_equals(fec.getAttribute("id"), "first_element_child")
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 899 B |
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>lastElementChild</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of lastElementChild</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of <tspan id="first_element_child">this test</tspan> is <tspan id="last_element_child" font-weight="bold">not</tspan> known.</text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var lec = parentEl.lastElementChild;
|
||||
assert_true(!!lec)
|
||||
assert_equals(lec.nodeType, 1)
|
||||
assert_equals(lec.getAttribute("id"), "last_element_child")
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 936 B |
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>nextElementSibling</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of nextElementSibling</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of <tspan id="first_element_child">this test</tspan> is <tspan id="last_element_child" font-weight="bold">unknown.</tspan></text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var fec = document.getElementById("first_element_child");
|
||||
var nes = fec.nextElementSibling;
|
||||
assert_true(!!nes)
|
||||
assert_equals(nes.nodeType, 1)
|
||||
assert_equals(nes.getAttribute("id"), "last_element_child")
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 995 B |
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>previousElementSibling</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of previousElementSibling</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of <tspan id="first_element_child">this test</tspan> is
|
||||
<tspan id="middle_element_child" font-weight="bold">unknown.</tspan>
|
||||
|
||||
|
||||
|
||||
<tspan id="last_element_child" display="none">fnord</tspan> </text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var lec = document.getElementById("last_element_child");
|
||||
var pes = lec.previousElementSibling;
|
||||
assert_true(!!pes)
|
||||
assert_equals(pes.nodeType, 1)
|
||||
assert_equals(pes.getAttribute("id"), "middle_element_child")
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 1 KiB |
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
version="1.1"
|
||||
width="100%" height="100%" viewBox="0 0 400 400">
|
||||
<title>Null test</title>
|
||||
<h:script src="../../resources/testharness.js"/>
|
||||
<h:script src="../../resources/testharnessreport.js"/>
|
||||
|
||||
<text x="200" y="40" font-size="25" fill="black" text-anchor="middle">Test of previousElementSibling and nextElementSibling returning null</text>
|
||||
<text id="parentEl" x="200" y="70" font-size="20" fill="black" text-anchor="middle">The result of this test is <tspan id="first_element_child" font-weight="bold">unknown.</tspan></text>
|
||||
|
||||
<h:script><![CDATA[
|
||||
test(function() {
|
||||
var fec = document.getElementById("first_element_child");
|
||||
assert_equals(fec.previousElementSibling, null)
|
||||
assert_equals(fec.nextElementSibling, null)
|
||||
})
|
||||
]]></h:script>
|
||||
</svg>
|
After Width: | Height: | Size: 879 B |