-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add grouping tests #21
Merged
sideshowbarker
merged 2 commits into
web-platform-tests:master
from
dzenana-trenutak:submission/dzenana.t-grouping
Apr 13, 2013
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
html/semantics/grouping-content/the-blockquote-element/grouping-blockquote.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>the blockquote element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-blockquote-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the blockquote element.</p> | ||
|
||
<div id="log"></div> | ||
|
||
<hr> | ||
|
||
<blockquote>0- Cite is not provided.</blockquote> | ||
<blockquote cite="blehblah">1- Cite = "blehblah" </blockquote> | ||
<blockquote cite="http://w3c-test.org/">2- Cite = "http://w3c-test.org/"</blockquote> | ||
<blockquote cite="http://www2.w3c-test.org/">3- Cite = "http://www2.w3c-test.org/"</blockquote> | ||
<blockquote cite="http://天気の良い日.w3c-test.org/">4- Cite = "http://天気の良い日.w3c-test.org/"</blockquote> | ||
<blockquote cite="http://élève.w3c-test.org/">5- Cite = "http://élève.w3c-test.org/"</blockquote> | ||
<blockquote cite="https://www.w3c-test.org/">6- Cite = "https://www.w3c-test.org/"</blockquote> | ||
<blockquote cite=" http://w3c-test.org/ ">7- Cite = "http://w3c-test.org/" w/ spaces </blockquote> | ||
<blockquote cite=" http://w3c-test.org/ ">8- Cite = "http://w3c-test.org/" w/ tabs </blockquote> | ||
<blockquote cite=" http://w3c-test.org/ ">9- Cite = "http://w3c-test.org/" w/ Unicode space </blockquote> | ||
<blockquote cite="	http://w3c-test.org/	">10- Cite = "http://w3c-test.org/" w/ Unicode tab</blockquote> | ||
<blockquote cite="
http://w3c-test.org/
">11- Cite = "http://w3c-test.org/" w/ Unicode newline</blockquote> | ||
<blockquote cite="http://w3c-test.org/">12- Cite = "http://w3c-test.org/" w/ Unicode formfeed</blockquote> | ||
<blockquote cite="
http://w3c-test.org/
">13- Cite = "http://w3c-test.org/" w/ Unicode carriage return </blockquote> | ||
<blockquote cite="  	
 http://w3c-test.org/  
 ">14- Cite = "http://w3c-test.org/" w/ combo spaces </blockquote> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
var strElement = "blockquote", testElement = {}, testElementProperties = [], testQuotes = []; | ||
|
||
var testURLs = [{actual: "", resolved: ""}, | ||
{actual: "blehblah", resolved: document.location.protocol + "//" + document.location.host + "/blehblah"}, | ||
{actual: "http://w3c-test.org/", resolved: "http://w3c-test.org/"}, | ||
{actual: "http://www2.w3c-test.org/", resolved: "http://www2.w3c-test.org/"}, | ||
{actual: "http://天気の良い日.w3c-test.org/", resolved: "http://天気の良い日.w3c-test.org/"}, | ||
{actual: "http://élève.w3c-test.org/", resolved: "http://élève.w3c-test.org/"}, | ||
{actual: "https://www.w3c-test.org/", resolved: "https://www.w3c-test.org/"}, | ||
{actual: " http://w3c-test.org/ ", resolved: "http://w3c-test.org/"}, // with spaces | ||
{actual: " http://w3c-test.org/ ", resolved: "http://w3c-test.org/"}, // with tabs | ||
{actual: "\u0020http://w3c-test.org/\u0020", resolved: "http://w3c-test.org/"}, // with unicode space | ||
{actual: "\u0009http://w3c-test.org/\u0009", resolved: "http://w3c-test.org/"}, // with unicode tab | ||
{actual: "\u000Ahttp://w3c-test.org/\u000A", resolved: "http://w3c-test.org/"}, // with unicode newline | ||
{actual: "\u000Chttp://w3c-test.org/\u000C", resolved: "http://w3c-test.org/"}, // with unicode formfeed | ||
{actual: "\u000Dhttp://w3c-test.org/\u000D", resolved: "http://w3c-test.org/"}, // with unicode carriage return | ||
{actual: " \u0020\u0009\u000A http://w3c-test.org/ \u000C \u000D ", resolved: "http://w3c-test.org/"} // with combo unicode spaces | ||
]; | ||
|
||
setup(function () { | ||
testQuotes = document.getElementsByTagName(strElement); | ||
testElement = testQuotes[0]; | ||
testElementProperties = Object.getOwnPropertyNames(testElement); | ||
}); | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLQuoteElement.prototype, "HTMLQuoteElement.prototype should be used for " + strElement); | ||
}, "The prototype for " + strElement + " is HTMLQuoteElement.prototype"); | ||
|
||
// check that "cite" is an "own" property | ||
test(function () { | ||
assert_own_property(testElementProperties, "cite", strElement + " should have 'cite' as own property."); | ||
}, strElement + " should have 'cite' as own property."); | ||
|
||
// 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. | ||
test(function () { | ||
assert_equals(testQuotes[0].cite, "", strElement + "If the cite content attribute is absent, the IDL attribute must return the empty string."); | ||
}, "If the cite content attribute is absent, the IDL attribute must return the empty string."); | ||
|
||
// On setting, the IDL attribute must set the content attribute to the specified literal value. | ||
test(function () { | ||
testQuotes[0].cite = "foo bar"; | ||
assert_equals(testQuotes[0].attributes["cite"].value, "foo bar", "Setting cite IDL sets content attribute to specified literal value."); | ||
}, "Setting cite IDL sets content attribute to specified literal value."); | ||
|
||
// All other testQuote examples have content attributes to test vis-a-vis registering and resolving | ||
|
||
for (var i = 1; i < testQuotes.length; i++) { | ||
// Check that element's cite content attribute registered properly (literally, not resolved) | ||
test(function () { | ||
assert_equals(testQuotes[i].attributes["cite"].value, testURLs[i].actual, strElement + " #" + i + ": content attribute"); | ||
}, strElement + " #" + i + ": cite content attribute registers markup."); | ||
} | ||
|
||
for (var i = 1; i < testQuotes.length; i++) { | ||
// The cite IDL attribute must reflect the element's cite content attribute (resolving URLs relative to the element)... | ||
test(function () { | ||
assert_equals(testQuotes[i].cite, testURLs[i].resolved, strElement + " #" + i + ": cite IDL reflects content attribute."); | ||
}, strElement + " #" + i + ": cite IDL reflects content attribute."); | ||
} | ||
|
||
// Not checking: Is a sectioning root | ||
|
||
</script> | ||
</body> | ||
</html> | ||
|
||
|
27 changes: 27 additions & 0 deletions
27
html/semantics/grouping-content/the-dd-element/grouping-dd.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>the dd element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-dd-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
var testElement = document.createElement("dd"); | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for dd"); | ||
}, "The prototype for dd is HTMLElement.prototype"); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the dd element.</p> | ||
|
||
<div id="log"></div> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
html/semantics/grouping-content/the-div-element/grouping-div.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>The div element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-div-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
var testElement = document.createElement("div"); | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLDivElement.prototype, "HTMLDivElement.prototype should be used for div"); | ||
}, "The prototype for div is HTMLDivElement.prototype"); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the div element.</p> | ||
|
||
<div id="log"></div> | ||
|
||
</body> | ||
</html> |
30 changes: 30 additions & 0 deletions
30
html/semantics/grouping-content/the-dl-element/grouping-dl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>the dl element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-dl-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
var testElement = document.createElement("dl"); | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLDListElement.prototype, "HTMLDListElement.prototype should be used for dl"); | ||
}, "The prototype for dl is HTMLDListElement.prototype"); | ||
|
||
// Not checking: effects of markup on defining groups and the name-pair values within those groups | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the dl element.</p> | ||
|
||
<div id="log"></div> | ||
|
||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
html/semantics/grouping-content/the-dt-element/grouping-dt.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>the dl element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-dt-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
var testElement = document.createElement("dt"); | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for dt"); | ||
}, "The prototype for dt is HTMLElement.prototype"); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the dt element.</p> | ||
|
||
<div id="log"></div> | ||
|
||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
html/semantics/grouping-content/the-figcaption-element/grouping-figcaption.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>the figcaption element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-figcaption-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
var testElement = document.createElement("figcaption"); | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for figcaption"); | ||
}, "The prototype for figcaption is HTMLElement.prototype"); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the figcaption element.</p> | ||
|
||
<div id="log"></div> | ||
|
||
</body> | ||
</html> |
29 changes: 29 additions & 0 deletions
29
html/semantics/grouping-content/the-figure-element/grouping-figure.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>the figure element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-figure-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
var testElement = document.createElement("figure"); | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLElement.prototype, "HTMLElement.prototype should be used for figure"); | ||
}, "The prototype for figure is HTMLElement.prototype"); | ||
|
||
// Not checking: Sectioning root | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the figure element.</p> | ||
|
||
<div id="log"></div> | ||
</body> | ||
</html> |
32 changes: 32 additions & 0 deletions
32
html/semantics/grouping-content/the-hr-element/grouping-hr.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>the hr element</title> | ||
<link rel="author" title="dzenana" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/html/wg/drafts/html/CR/grouping-content.html#the-hr-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
// check that prototype matches spec's DOM interface | ||
test(function () { | ||
var testElement = document.createElement("hr"); | ||
assert_equals(Object.getPrototypeOf(testElement), HTMLHRElement.prototype, "HTMLHRElement.prototype should be used for hr"); | ||
}, "The prototype for hr is HTMLHRElement.prototype"); | ||
|
||
// Not checking: "The hr element does not affect the document's outline." | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates the hr element.</p> | ||
|
||
<div id="log"></div> | ||
|
||
</body> | ||
</html> | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct. Per WebIDL, "cite" should be a getter property of HTMLQuoteElement.prototype.
(Did you actually mean
testElementProperties
here, or did you meantestElement
?)