Skip to content

Commit 4990e54

Browse files
Merge pull request #21 from dzenana-trenutak/submission/dzenana.t-grouping
Add grouping tests
2 parents fe1892b + 9f4bb4c commit 4990e54

32 files changed

+2030
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>the blockquote element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-blockquote-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
</head>
11+
<body>
12+
<h1>Description</h1>
13+
<p>This test validates the blockquote element.</p>
14+
15+
<div id="log"></div>
16+
17+
<hr>
18+
19+
<blockquote>0- Cite is not provided.</blockquote>
20+
<blockquote cite="blehblah">1- Cite = "blehblah" </blockquote>
21+
<blockquote cite="http://w3c-test.org/">2- Cite = "http://w3c-test.org/"</blockquote>
22+
<blockquote cite="http://www2.w3c-test.org/">3- Cite = "http://www2.w3c-test.org/"</blockquote>
23+
<blockquote cite="http://天気の良い日.w3c-test.org/">4- Cite = "http://天気の良い日.w3c-test.org/"</blockquote>
24+
<blockquote cite="http://élève.w3c-test.org/">5- Cite = "http://élève.w3c-test.org/"</blockquote>
25+
<blockquote cite="https://www.w3c-test.org/">6- Cite = "https://www.w3c-test.org/"</blockquote>
26+
<blockquote cite=" http://w3c-test.org/ ">7- Cite = "http://w3c-test.org/" w/ spaces </blockquote>
27+
<blockquote cite=" http://w3c-test.org/ ">8- Cite = "http://w3c-test.org/" w/ tabs </blockquote>
28+
<blockquote cite="&#x20http://w3c-test.org/&#x20">9- Cite = "http://w3c-test.org/" w/ Unicode space </blockquote>
29+
<blockquote cite="&#x09http://w3c-test.org/&#x09">10- Cite = "http://w3c-test.org/" w/ Unicode tab</blockquote>
30+
<blockquote cite="&#x0Ahttp://w3c-test.org/&#x0A">11- Cite = "http://w3c-test.org/" w/ Unicode newline</blockquote>
31+
<blockquote cite="&#x0Chttp://w3c-test.org/&#x0C">12- Cite = "http://w3c-test.org/" w/ Unicode formfeed</blockquote>
32+
<blockquote cite="&#x0Dhttp://w3c-test.org/&#x0D">13- Cite = "http://w3c-test.org/" w/ Unicode carriage return </blockquote>
33+
<blockquote cite=" &#x20&#x09&#x0A http://w3c-test.org/ &#x0C &#x0D ">14- Cite = "http://w3c-test.org/" w/ combo spaces </blockquote>
34+
35+
<script>
36+
"use strict";
37+
38+
var testURLs = [{actual: "", resolved: ""},
39+
{actual: "blehblah", resolved: document.location.protocol + "//" + document.location.host + "/blehblah"},
40+
{actual: "http://w3c-test.org/", resolved: "http://w3c-test.org/"},
41+
{actual: "http://www2.w3c-test.org/", resolved: "http://www2.w3c-test.org/"},
42+
{actual: "http://天気の良い日.w3c-test.org/", resolved: "http://天気の良い日.w3c-test.org/"},
43+
{actual: "http://élève.w3c-test.org/", resolved: "http://élève.w3c-test.org/"},
44+
{actual: "https://www.w3c-test.org/", resolved: "https://www.w3c-test.org/"},
45+
{actual: " http://w3c-test.org/ ", resolved: "http://w3c-test.org/"}, // with spaces
46+
{actual: " http://w3c-test.org/ ", resolved: "http://w3c-test.org/"}, // with tabs
47+
{actual: "\u0020http://w3c-test.org/\u0020", resolved: "http://w3c-test.org/"}, // with unicode space
48+
{actual: "\u0009http://w3c-test.org/\u0009", resolved: "http://w3c-test.org/"}, // with unicode tab
49+
{actual: "\u000Ahttp://w3c-test.org/\u000A", resolved: "http://w3c-test.org/"}, // with unicode newline
50+
{actual: "\u000Chttp://w3c-test.org/\u000C", resolved: "http://w3c-test.org/"}, // with unicode formfeed
51+
{actual: "\u000Dhttp://w3c-test.org/\u000D", resolved: "http://w3c-test.org/"}, // with unicode carriage return
52+
{actual: " \u0020\u0009\u000A http://w3c-test.org/ \u000C \u000D ", resolved: "http://w3c-test.org/"} // with combo unicode spaces
53+
];
54+
55+
var testElement = {}, testQuotes = [];
56+
57+
setup(function () {
58+
testQuotes = document.getElementsByTagName("blockquote");
59+
testElement = testQuotes[0];
60+
});
61+
62+
// check that prototype matches spec's DOM interface
63+
test(function () {
64+
assert_equals(Object.getPrototypeOf(testElement), HTMLQuoteElement.prototype, "HTMLQuoteElement.prototype should be used for blockquote.");
65+
}, "The prototype for blockquote is HTMLQuoteElement.prototype");
66+
67+
// check that "cite" is an "own" property
68+
test(function () {
69+
assert_own_property(testElement, "cite", "blockquote should have 'cite' as own property.");
70+
}, "blockquote should have 'cite' as own property.");
71+
72+
// If the content attribute is absent, the IDL attribute must return the default value, if the content attribute has one, or else the empty string.
73+
test(function () {
74+
assert_equals(testElement.cite, "", "If the cite content attribute is absent, the IDL attribute must return the empty string.");
75+
}, "If the cite content attribute is absent, the IDL attribute must return the empty string.");
76+
77+
// On setting, the IDL attribute must set the content attribute to the specified literal value.
78+
test(function () {
79+
testElement.cite = "foo bar";
80+
assert_equals(testElement.attributes["cite"].value, "foo bar", "Setting cite IDL sets content attribute to specified literal value.");
81+
}, "Setting cite IDL sets content attribute to specified literal value.");
82+
83+
// All other testQuote examples have content attributes to test vis-a-vis registering and resolving
84+
85+
for (var i = 1; i < testQuotes.length; i++) {
86+
// Check that element's cite content attribute registered properly (literally, not resolved)
87+
test(function () {
88+
assert_equals(testQuotes[i].attributes["cite"].value, testURLs[i].actual, "blockquote #" + i + ": content attribute");
89+
}, "blockquote #" + i + ": cite content attribute registers markup.");
90+
}
91+
92+
for (var i = 1; i < testQuotes.length; i++) {
93+
// The cite IDL attribute must reflect the element's cite content attribute (resolving URLs relative to the element)...
94+
test(function () {
95+
assert_equals(testQuotes[i].cite, testURLs[i].resolved, "blockquote #" + i + ": cite IDL reflects content attribute.");
96+
}, "blockquote #" + i + ": cite IDL reflects content attribute.");
97+
}
98+
99+
// Not checking: Is a sectioning root
100+
101+
</script>
102+
</body>
103+
</html>
104+
105+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>the dd element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-dd-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script>
11+
"use strict";
12+
13+
// check that prototype matches spec's DOM interface
14+
test(function () {
15+
var testElement = document.createElement("dd");
16+
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for dd");
17+
}, "The prototype for dd is HTMLElement.prototype");
18+
19+
</script>
20+
</head>
21+
<body>
22+
<h1>Description</h1>
23+
<p>This test validates the dd element.</p>
24+
25+
<div id="log"></div>
26+
</body>
27+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>The div element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-div-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script>
11+
"use strict";
12+
13+
// check that prototype matches spec's DOM interface
14+
test(function () {
15+
var testElement = document.createElement("div");
16+
assert_equals(Object.getPrototypeOf(testElement), HTMLDivElement.prototype, "HTMLDivElement.prototype should be used for div");
17+
}, "The prototype for div is HTMLDivElement.prototype");
18+
19+
</script>
20+
</head>
21+
<body>
22+
<h1>Description</h1>
23+
<p>This test validates the div element.</p>
24+
25+
<div id="log"></div>
26+
27+
</body>
28+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>the dl element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-dl-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script>
11+
"use strict";
12+
13+
// check that prototype matches spec's DOM interface
14+
test(function () {
15+
var testElement = document.createElement("dl");
16+
assert_equals(Object.getPrototypeOf(testElement), HTMLDListElement.prototype, "HTMLDListElement.prototype should be used for dl");
17+
}, "The prototype for dl is HTMLDListElement.prototype");
18+
19+
// Not checking: effects of markup on defining groups and the name-pair values within those groups
20+
21+
</script>
22+
</head>
23+
<body>
24+
<h1>Description</h1>
25+
<p>This test validates the dl element.</p>
26+
27+
<div id="log"></div>
28+
29+
</body>
30+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>the dl element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-dt-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script>
11+
"use strict";
12+
13+
// check that prototype matches spec's DOM interface
14+
test(function () {
15+
var testElement = document.createElement("dt");
16+
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for dt");
17+
}, "The prototype for dt is HTMLElement.prototype");
18+
19+
</script>
20+
</head>
21+
<body>
22+
<h1>Description</h1>
23+
<p>This test validates the dt element.</p>
24+
25+
<div id="log"></div>
26+
27+
</body>
28+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>the figcaption element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-figcaption-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script>
11+
"use strict";
12+
13+
// check that prototype matches spec's DOM interface
14+
test(function () {
15+
var testElement = document.createElement("figcaption");
16+
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for figcaption");
17+
}, "The prototype for figcaption is HTMLElement.prototype");
18+
19+
</script>
20+
</head>
21+
<body>
22+
<h1>Description</h1>
23+
<p>This test validates the figcaption element.</p>
24+
25+
<div id="log"></div>
26+
27+
</body>
28+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>the figure element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-figure-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script>
11+
"use strict";
12+
13+
// check that prototype matches spec's DOM interface
14+
test(function () {
15+
var testElement = document.createElement("figure");
16+
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for figure");
17+
}, "The prototype for figure is HTMLElement.prototype");
18+
19+
// Not checking: Sectioning root
20+
21+
</script>
22+
</head>
23+
<body>
24+
<h1>Description</h1>
25+
<p>This test validates the figure element.</p>
26+
27+
<div id="log"></div>
28+
</body>
29+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>the hr element</title>
6+
<link rel="author" title="dzenana" href="mailto:[email protected]">
7+
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-hr-element">
8+
<script src="/resources/testharness.js"></script>
9+
<script src="/resources/testharnessreport.js"></script>
10+
<script>
11+
"use strict";
12+
13+
// check that prototype matches spec's DOM interface
14+
test(function () {
15+
var testElement = document.createElement("hr");
16+
assert_equals(Object.getPrototypeOf(testElement), HTMLHRElement.prototype, "HTMLHRElement.prototype should be used for hr");
17+
}, "The prototype for hr is HTMLHRElement.prototype");
18+
19+
// Not checking: "The hr element does not affect the document's outline."
20+
21+
</script>
22+
</head>
23+
<body>
24+
<h1>Description</h1>
25+
<p>This test validates the hr element.</p>
26+
27+
<div id="log"></div>
28+
29+
</body>
30+
</html>
31+
32+

0 commit comments

Comments
 (0)