apt: move test on the right place
26
tests/wpt/dom/nodes/Document-getElementsByClassName.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<title>Document.getElementsByClassName</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var a = document.createElement("a"),
|
||||
b = document.createElement("b");
|
||||
a.className = "foo";
|
||||
this.add_cleanup(function() {document.body.removeChild(a);});
|
||||
document.body.appendChild(a);
|
||||
|
||||
var l = document.getElementsByClassName("foo");
|
||||
assert_true(l instanceof HTMLCollection);
|
||||
assert_equals(l.length, 1);
|
||||
|
||||
b.className = "foo";
|
||||
document.body.appendChild(b);
|
||||
assert_equals(l.length, 2);
|
||||
|
||||
document.body.removeChild(b);
|
||||
assert_equals(l.length, 1);
|
||||
}, "getElementsByClassName() should be a live collection");
|
||||
</script>
|
||||
20
tests/wpt/dom/nodes/Element-childElement-null-svg.svg
Normal file
@@ -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: 787 B |
20
tests/wpt/dom/nodes/Element-childElement-null-xhtml.xhtml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Null Test</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of firstElementChild and lastChildElement returning null</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl" style="font-weight:bold;">Test.</p>
|
||||
<script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_equals(parentEl.firstElementChild, null)
|
||||
assert_equals(parentEl.lastElementChild, null)
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
15
tests/wpt/dom/nodes/Element-childElement-null.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>Null test</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of firstElementChild and lastChildElement returning null</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl" style="font-weight:bold;">Test.</p>
|
||||
<script>
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_equals(parentEl.firstElementChild, null)
|
||||
assert_equals(parentEl.lastElementChild, null)
|
||||
})
|
||||
</script>
|
||||
@@ -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: 913 B |
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Dynamic Adding of Elements</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of Dynamic Adding of Elements</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is
|
||||
<span id="first_element_child" style="font-weight:bold;">logged above.</span></p>
|
||||
<script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var newChild = document.createElement("span");
|
||||
parentEl.appendChild(newChild);
|
||||
assert_equals(parentEl.childElementCount, 2)
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>Dynamic Adding of Elements</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of Dynamic Adding of Elements</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is
|
||||
<span id="first_element_child" style="font-weight:bold;">logged above.</span></p>
|
||||
<script>
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var newChild = document.createElement("span");
|
||||
parentEl.appendChild(newChild);
|
||||
assert_equals(parentEl.childElementCount, 2)
|
||||
})
|
||||
</script>
|
||||
@@ -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: 907 B |
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Dynamic Removal of Elements</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of Removal Adding of Elements</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is
|
||||
<span id="first_element_child" style="font-weight:bold;">logged above.</span><span id="last_element_child"> </span></p>
|
||||
<script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var lec = parentEl.lastElementChild;
|
||||
parentEl.removeChild(lec);
|
||||
assert_equals(parentEl.childElementCount, 1)
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>Dynamic Removal of Elements</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of Dynamic Removal of Elements</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is
|
||||
<span id="first_element_child" style="font-weight:bold;">unknown.</span><span id="last_element_child"> </span></p>
|
||||
<script>
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl");
|
||||
var lec = parentEl.lastElementChild;
|
||||
parentEl.removeChild(lec);
|
||||
assert_equals(parentEl.childElementCount, 1)
|
||||
})
|
||||
</script>
|
||||
@@ -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: 735 B |
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>childElementCount without Child Element Nodes</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of childElementCount with No Child Element Nodes</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl" style="font-weight:bold;">Test.</p>
|
||||
<script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_equals(parentEl.childElementCount, 0)
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
14
tests/wpt/dom/nodes/Element-childElementCount-nochild.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>childElementCount without Child Element Nodes</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of childElementCount with No Child Element Nodes</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl" style="font-weight:bold;">Test.</p>
|
||||
<script>
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_equals(parentEl.childElementCount, 0)
|
||||
})
|
||||
</script>
|
||||
25
tests/wpt/dom/nodes/Element-childElementCount-svg.svg
Normal file
@@ -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: 967 B |
25
tests/wpt/dom/nodes/Element-childElementCount-xhtml.xhtml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>childElementCount</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of childElementCount</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of <span id="first_element_child"><span>this</span> <span>test</span></span> is
|
||||
<span id="middle_element_child" style="font-weight:bold;">unknown.</span>
|
||||
|
||||
|
||||
|
||||
<span id="last_element_child" style="display:none;">fnord</span> </p>
|
||||
<script><![CDATA[
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_true("childElementCount" in parentEl)
|
||||
assert_equals(parentEl.childElementCount, 3)
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
20
tests/wpt/dom/nodes/Element-childElementCount.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>childElementCount</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of childElementCount</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of <span id="first_element_child"><span>this</span> <span>test</span></span> is
|
||||
<span id="middle_element_child" style="font-weight:bold;">given above.</span>
|
||||
|
||||
|
||||
|
||||
<span id="last_element_child" style="display:none;">fnord</span> </p>
|
||||
<script>
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
assert_true("childElementCount" in parentEl)
|
||||
assert_equals(parentEl.childElementCount, 3)
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
||||
[
|
||||
<!ENTITY tree "<span id='first_element_child' style='font-weight:bold;'>unknown.</span>">
|
||||
]>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Entity References</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of Entity References</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is &tree;</p>
|
||||
<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")
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
26
tests/wpt/dom/nodes/Element-firstElementChild-entity.svg
Normal file
@@ -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: 1015 B |
@@ -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: 888 B |
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:pickle="http://ns.example.org/pickle">
|
||||
<head>
|
||||
<title>firstElementChild with namespaces</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of firstElementChild with namespaces</h1>
|
||||
<div id="parentEl">
|
||||
<pickle:dill id="first_element_child"/>
|
||||
</div>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is
|
||||
<span id="first_element_child" style="font-weight:bold;">logged above.</span></p>
|
||||
<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")
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
21
tests/wpt/dom/nodes/Element-firstElementChild-namespace.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>firstElementChild with namespaces</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of firstElementChild with namespaces</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is a unknown.</p>
|
||||
<script>
|
||||
test(function() {
|
||||
var parentEl = document.getElementById("parentEl")
|
||||
var el = document.createElementNS("http://ns.example.org/pickle", "pickle:dill")
|
||||
el.setAttribute("id", "first_element_child")
|
||||
parentEl.appendChild(el)
|
||||
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")
|
||||
})
|
||||
</script>
|
||||
23
tests/wpt/dom/nodes/Element-firstElementChild-svg.svg
Normal file
@@ -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: 889 B |
23
tests/wpt/dom/nodes/Element-firstElementChild-xhtml.xhtml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>firstElementChild</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of firstElementChild</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is
|
||||
<span id="first_element_child" style="font-weight:bold;">logged above.</span></p>
|
||||
<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")
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
18
tests/wpt/dom/nodes/Element-firstElementChild.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>firstElementChild</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of firstElementChild</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of this test is
|
||||
<span id="first_element_child" style="font-weight:bold;">logged above.</span></p>
|
||||
<script>
|
||||
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")
|
||||
})
|
||||
</script>
|
||||
22
tests/wpt/dom/nodes/Element-lastElementChild-svg.svg
Normal file
@@ -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: 926 B |
22
tests/wpt/dom/nodes/Element-lastElementChild-xhtml.xhtml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>firstElementChild</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test of firstElementChild</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of <span id="first_element_child">this test</span> is <span id="last_element_child" style="font-weight:bold;">logged</span> above.</p>
|
||||
<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")
|
||||
})
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
17
tests/wpt/dom/nodes/Element-lastElementChild.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>lastElementChild</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h1>Test of lastElementChild</h1>
|
||||
<div id="log"></div>
|
||||
<p id="parentEl">The result of <span id="first_element_child">this test</span> is <span id="last_element_child" style="font-weight:bold;">logged</span> above.</p>
|
||||
<script>
|
||||
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")
|
||||
})
|
||||
</script>
|
||||