mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,143 @@
|
|||
<!DOCTYPE html>
|
||||
<title>document.getElementsByTagName and foreign parser-inserted
|
||||
elements</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-document-getelementsbytagname">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<svg>
|
||||
<altglyph/>
|
||||
<altglyphdef/>
|
||||
<altglyphitem/>
|
||||
<animatecolor/>
|
||||
<animatemotion/>
|
||||
<animatetransform/>
|
||||
<clippath/>
|
||||
<feblend/>
|
||||
<fecolormatrix/>
|
||||
<fecomponenttransfer/>
|
||||
<fecomposite/>
|
||||
<feconvolvematrix/>
|
||||
<fediffuselighting/>
|
||||
<fedisplacementmap/>
|
||||
<fedistantlight/>
|
||||
<feflood/>
|
||||
<fefunca/>
|
||||
<fefuncb/>
|
||||
<fefuncg/>
|
||||
<fefuncr/>
|
||||
<fegaussianblur/>
|
||||
<feimage/>
|
||||
<femerge/>
|
||||
<femergenode/>
|
||||
<femorphology/>
|
||||
<feoffset/>
|
||||
<fepointlight/>
|
||||
<fespecularlighting/>
|
||||
<fespotlight/>
|
||||
<fetile/>
|
||||
<feturbulence/>
|
||||
<foreignobject/>
|
||||
<glyphref/>
|
||||
<lineargradient/>
|
||||
<radialgradient/>
|
||||
<textpath/>
|
||||
<ALTGLYPH/>
|
||||
<ALTGLYPHDEF/>
|
||||
<ALTGLYPHITEM/>
|
||||
<ANIMATECOLOR/>
|
||||
<ANIMATEMOTION/>
|
||||
<ANIMATETRANSFORM/>
|
||||
<CLIPPATH/>
|
||||
<FEBLEND/>
|
||||
<FECOLORMATRIX/>
|
||||
<FECOMPONENTTRANSFER/>
|
||||
<FECOMPOSITE/>
|
||||
<FECONVOLVEMATRIX/>
|
||||
<FEDIFFUSELIGHTING/>
|
||||
<FEDISPLACEMENTMAP/>
|
||||
<FEDISTANTLIGHT/>
|
||||
<FEFLOOD/>
|
||||
<FEFUNCA/>
|
||||
<FEFUNCB/>
|
||||
<FEFUNCG/>
|
||||
<FEFUNCR/>
|
||||
<FEGAUSSIANBLUR/>
|
||||
<FEIMAGE/>
|
||||
<FEMERGE/>
|
||||
<FEMERGENODE/>
|
||||
<FEMORPHOLOGY/>
|
||||
<FEOFFSET/>
|
||||
<FEPOINTLIGHT/>
|
||||
<FESPECULARLIGHTING/>
|
||||
<FESPOTLIGHT/>
|
||||
<FETILE/>
|
||||
<FETURBULENCE/>
|
||||
<FOREIGNOBJECT/>
|
||||
<GLYPHREF/>
|
||||
<LINEARGRADIENT/>
|
||||
<RADIALGRADIENT/>
|
||||
<TEXTPATH/>
|
||||
</svg>
|
||||
<script>
|
||||
var elements = [
|
||||
"altGlyph",
|
||||
"altGlyphDef",
|
||||
"altGlyphItem",
|
||||
"animateColor",
|
||||
"animateMotion",
|
||||
"animateTransform",
|
||||
"clipPath",
|
||||
"feBlend",
|
||||
"feColorMatrix",
|
||||
"feComponentTransfer",
|
||||
"feComposite",
|
||||
"feConvolveMatrix",
|
||||
"feDiffuseLighting",
|
||||
"feDisplacementMap",
|
||||
"feDistantLight",
|
||||
"feFlood",
|
||||
"feFuncA",
|
||||
"feFuncB",
|
||||
"feFuncG",
|
||||
"feFuncR",
|
||||
"feGaussianBlur",
|
||||
"feImage",
|
||||
"feMerge",
|
||||
"feMergeNode",
|
||||
"feMorphology",
|
||||
"feOffset",
|
||||
"fePointLight",
|
||||
"feSpecularLighting",
|
||||
"feSpotLight",
|
||||
"feTile",
|
||||
"feTurbulence",
|
||||
"foreignObject",
|
||||
"glyphRef",
|
||||
"linearGradient",
|
||||
"radialGradient",
|
||||
"textPath"];
|
||||
</script>
|
||||
</div>
|
||||
<script>
|
||||
var SVG = "http://www.w3.org/2000/svg";
|
||||
function t(el) {
|
||||
assert_equals(document.getElementsByTagName(el).length, 2);
|
||||
assert_equals(document.getElementsByTagName(el.toUpperCase()).length, 0);
|
||||
assert_equals(document.getElementsByTagName(el.toLowerCase()).length, 0);
|
||||
assert_equals(document.getElementsByTagNameNS(SVG, el).length, 2);
|
||||
assert_equals(document.getElementsByTagNameNS(SVG, el.toUpperCase()).length, 0);
|
||||
assert_equals(document.getElementsByTagNameNS(SVG, el.toLowerCase()).length, 0);
|
||||
}
|
||||
test(function() {
|
||||
var tests = [];
|
||||
assert_equals(document.getElementsByTagName('svg').length, 1);
|
||||
for (var i = 0, il = elements.length; i < il; ++i) {
|
||||
tests.push(["Testing " + elements[i], elements[i]]);
|
||||
}
|
||||
generate_tests(t, tests);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<title>getElementsByTagName and font</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-document-getelementsbytagname">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<font></font>
|
||||
<svg><font/></svg>
|
||||
</div>
|
||||
<script>
|
||||
var HTML = "http://www.w3.org/1999/xhtml", SVG = "http://www.w3.org/2000/svg";
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByTagName("FONT").length, 1);
|
||||
assert_equals(document.getElementsByTagName("FONT")[0].namespaceURI, HTML);
|
||||
}, "Upper-case font")
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByTagName("font").length, 2);
|
||||
assert_equals(document.getElementsByTagName("font")[0].namespaceURI, HTML);
|
||||
assert_equals(document.getElementsByTagName("font")[1].namespaceURI, SVG);
|
||||
}, "Lower-case font")
|
||||
</script>
|
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<title>getElementsByTagName and font</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-getelementsbytagname">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<font></font>
|
||||
<svg><font/></svg>
|
||||
</div>
|
||||
<script>
|
||||
var HTML = "http://www.w3.org/1999/xhtml", SVG = "http://www.w3.org/2000/svg";
|
||||
var wrapper = document.getElementById("test");
|
||||
test(function() {
|
||||
assert_equals(wrapper.getElementsByTagName("FONT").length, 1);
|
||||
assert_equals(wrapper.getElementsByTagName("FONT")[0].namespaceURI, HTML);
|
||||
}, "Upper-case font")
|
||||
test(function() {
|
||||
assert_equals(wrapper.getElementsByTagName("font").length, 2);
|
||||
assert_equals(wrapper.getElementsByTagName("font")[0].namespaceURI, HTML);
|
||||
assert_equals(wrapper.getElementsByTagName("font")[1].namespaceURI, SVG);
|
||||
}, "Lower-case font")
|
||||
</script>
|
|
@ -0,0 +1,29 @@
|
|||
<!doctype html>
|
||||
<title>getElementsByTagName and font</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-getelementsbytagname">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<svg id="outer">
|
||||
<foreignObject>
|
||||
<font></font>
|
||||
<svg><font/></svg>
|
||||
</foreignObject>
|
||||
</svg>
|
||||
</div>
|
||||
<script>
|
||||
var HTML = "http://www.w3.org/1999/xhtml", SVG = "http://www.w3.org/2000/svg";
|
||||
var wrapper = document.getElementById("outer");
|
||||
test(function() {
|
||||
assert_equals(wrapper.getElementsByTagName("FONT").length, 1);
|
||||
assert_equals(wrapper.getElementsByTagName("FONT")[0].namespaceURI, HTML);
|
||||
}, "Upper-case font")
|
||||
test(function() {
|
||||
assert_equals(wrapper.getElementsByTagName("font").length, 2);
|
||||
assert_equals(wrapper.getElementsByTagName("font")[0].namespaceURI, HTML);
|
||||
assert_equals(wrapper.getElementsByTagName("font")[1].namespaceURI, SVG);
|
||||
}, "Lower-case font")
|
||||
</script>
|
4
tests/wpt/web-platform-tests/html/syntax/parsing/README
Normal file
4
tests/wpt/web-platform-tests/html/syntax/parsing/README
Normal file
|
@ -0,0 +1,4 @@
|
|||
Note: the html5lib_* files in this directory are autogenerated.
|
||||
|
||||
To update them use the script /tools/scripts/update_html5lib_tests.py.
|
||||
Further instructions are provided in that file.
|
24
tests/wpt/web-platform-tests/html/syntax/parsing/common.js
Normal file
24
tests/wpt/web-platform-tests/html/syntax/parsing/common.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
function mark_diffs(expected, actual) {
|
||||
var expected_lines = expected.split("\n");
|
||||
var actual_lines = actual.split("\n");
|
||||
|
||||
var max_length = Math.max(expected_lines.length, actual_lines.length);
|
||||
|
||||
var expected_diff = ["code", {}];
|
||||
var actual_diff = ["code", {}];
|
||||
|
||||
for (var i=0; i<max_length; i++) {
|
||||
if (expected_lines[i] === actual_lines[i]) {
|
||||
expected_diff.push(expected_lines[i] + "\n");
|
||||
actual_diff.push(actual_lines[i] + "\n");
|
||||
} else {
|
||||
if (expected_lines[i]) {
|
||||
expected_diff.push(["span", {style:"color:red"}, expected_lines[i] + "\n"]);
|
||||
}
|
||||
if (actual_lines[i]) {
|
||||
actual_diff.push(["span", {style:"color:red"}, actual_lines[i] + "\n"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return [expected_diff, actual_diff];
|
||||
}
|
490
tests/wpt/web-platform-tests/html/syntax/parsing/contains.json
Normal file
490
tests/wpt/web-platform-tests/html/syntax/parsing/contains.json
Normal file
|
@ -0,0 +1,490 @@
|
|||
[
|
||||
{
|
||||
"id": "overview-of-the-parsing-model",
|
||||
"original_id": "overview-of-the-parsing-model"
|
||||
},
|
||||
{
|
||||
"id": "the-input-byte-stream",
|
||||
"original_id": "the-input-byte-stream",
|
||||
"children": [
|
||||
{
|
||||
"id": "determining-the-character-encoding",
|
||||
"original_id": "determining-the-character-encoding"
|
||||
},
|
||||
{
|
||||
"id": "character-encodings-0",
|
||||
"original_id": "character-encodings-0"
|
||||
},
|
||||
{
|
||||
"id": "changing-the-encoding-while-parsing",
|
||||
"original_id": "changing-the-encoding-while-parsing"
|
||||
},
|
||||
{
|
||||
"id": "preprocessing-the-input-stream",
|
||||
"original_id": "preprocessing-the-input-stream"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "parse-state",
|
||||
"original_id": "parse-state",
|
||||
"children": [
|
||||
{
|
||||
"id": "the-insertion-mode",
|
||||
"original_id": "the-insertion-mode"
|
||||
},
|
||||
{
|
||||
"id": "the-stack-of-open-elements",
|
||||
"original_id": "the-stack-of-open-elements"
|
||||
},
|
||||
{
|
||||
"id": "the-list-of-active-formatting-elements",
|
||||
"original_id": "the-list-of-active-formatting-elements"
|
||||
},
|
||||
{
|
||||
"id": "the-element-pointers",
|
||||
"original_id": "the-element-pointers"
|
||||
},
|
||||
{
|
||||
"id": "other-parsing-state-flags",
|
||||
"original_id": "other-parsing-state-flags"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tokenization",
|
||||
"original_id": "tokenization",
|
||||
"children": [
|
||||
{
|
||||
"id": "data-state",
|
||||
"original_id": "data-state"
|
||||
},
|
||||
{
|
||||
"id": "character-reference-in-data-state",
|
||||
"original_id": "character-reference-in-data-state"
|
||||
},
|
||||
{
|
||||
"id": "rcdata-state",
|
||||
"original_id": "rcdata-state"
|
||||
},
|
||||
{
|
||||
"id": "character-reference-in-rcdata-state",
|
||||
"original_id": "character-reference-in-rcdata-state"
|
||||
},
|
||||
{
|
||||
"id": "rawtext-state",
|
||||
"original_id": "rawtext-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-state",
|
||||
"original_id": "script-data-state"
|
||||
},
|
||||
{
|
||||
"id": "plaintext-state",
|
||||
"original_id": "plaintext-state"
|
||||
},
|
||||
{
|
||||
"id": "tag-open-state",
|
||||
"original_id": "tag-open-state"
|
||||
},
|
||||
{
|
||||
"id": "end-tag-open-state",
|
||||
"original_id": "end-tag-open-state"
|
||||
},
|
||||
{
|
||||
"id": "tag-name-state",
|
||||
"original_id": "tag-name-state"
|
||||
},
|
||||
{
|
||||
"id": "rcdata-less-than-sign-state",
|
||||
"original_id": "rcdata-less-than-sign-state"
|
||||
},
|
||||
{
|
||||
"id": "rcdata-end-tag-open-state",
|
||||
"original_id": "rcdata-end-tag-open-state"
|
||||
},
|
||||
{
|
||||
"id": "rcdata-end-tag-name-state",
|
||||
"original_id": "rcdata-end-tag-name-state"
|
||||
},
|
||||
{
|
||||
"id": "rawtext-less-than-sign-state",
|
||||
"original_id": "rawtext-less-than-sign-state"
|
||||
},
|
||||
{
|
||||
"id": "rawtext-end-tag-open-state",
|
||||
"original_id": "rawtext-end-tag-open-state"
|
||||
},
|
||||
{
|
||||
"id": "rawtext-end-tag-name-state",
|
||||
"original_id": "rawtext-end-tag-name-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-less-than-sign-state",
|
||||
"original_id": "script-data-less-than-sign-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-end-tag-open-state",
|
||||
"original_id": "script-data-end-tag-open-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-end-tag-name-state",
|
||||
"original_id": "script-data-end-tag-name-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escape-start-state",
|
||||
"original_id": "script-data-escape-start-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escape-start-dash-state",
|
||||
"original_id": "script-data-escape-start-dash-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escaped-state",
|
||||
"original_id": "script-data-escaped-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escaped-dash-state",
|
||||
"original_id": "script-data-escaped-dash-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escaped-dash-dash-state",
|
||||
"original_id": "script-data-escaped-dash-dash-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escaped-less-than-sign-state",
|
||||
"original_id": "script-data-escaped-less-than-sign-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escaped-end-tag-open-state",
|
||||
"original_id": "script-data-escaped-end-tag-open-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-escaped-end-tag-name-state",
|
||||
"original_id": "script-data-escaped-end-tag-name-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-double-escape-start-state",
|
||||
"original_id": "script-data-double-escape-start-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-double-escaped-state",
|
||||
"original_id": "script-data-double-escaped-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-double-escaped-dash-state",
|
||||
"original_id": "script-data-double-escaped-dash-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-double-escaped-dash-dash-state",
|
||||
"original_id": "script-data-double-escaped-dash-dash-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-double-escaped-less-than-sign-state",
|
||||
"original_id": "script-data-double-escaped-less-than-sign-state"
|
||||
},
|
||||
{
|
||||
"id": "script-data-double-escape-end-state",
|
||||
"original_id": "script-data-double-escape-end-state"
|
||||
},
|
||||
{
|
||||
"id": "before-attribute-name-state",
|
||||
"original_id": "before-attribute-name-state"
|
||||
},
|
||||
{
|
||||
"id": "attribute-name-state",
|
||||
"original_id": "attribute-name-state"
|
||||
},
|
||||
{
|
||||
"id": "after-attribute-name-state",
|
||||
"original_id": "after-attribute-name-state"
|
||||
},
|
||||
{
|
||||
"id": "before-attribute-value-state",
|
||||
"original_id": "before-attribute-value-state"
|
||||
},
|
||||
{
|
||||
"id": "attribute-value-double-quoted-state",
|
||||
"original_id": "attribute-value-(double-quoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "attribute-value-single-quoted-state",
|
||||
"original_id": "attribute-value-(single-quoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "attribute-value-unquoted-state",
|
||||
"original_id": "attribute-value-(unquoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "character-reference-in-attribute-value-state",
|
||||
"original_id": "character-reference-in-attribute-value-state"
|
||||
},
|
||||
{
|
||||
"id": "after-attribute-value-quoted-state",
|
||||
"original_id": "after-attribute-value-(quoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "self-closing-start-tag-state",
|
||||
"original_id": "self-closing-start-tag-state"
|
||||
},
|
||||
{
|
||||
"id": "bogus-comment-state",
|
||||
"original_id": "bogus-comment-state"
|
||||
},
|
||||
{
|
||||
"id": "markup-declaration-open-state",
|
||||
"original_id": "markup-declaration-open-state"
|
||||
},
|
||||
{
|
||||
"id": "comment-start-state",
|
||||
"original_id": "comment-start-state"
|
||||
},
|
||||
{
|
||||
"id": "comment-start-dash-state",
|
||||
"original_id": "comment-start-dash-state"
|
||||
},
|
||||
{
|
||||
"id": "comment-state",
|
||||
"original_id": "comment-state"
|
||||
},
|
||||
{
|
||||
"id": "comment-end-dash-state",
|
||||
"original_id": "comment-end-dash-state"
|
||||
},
|
||||
{
|
||||
"id": "comment-end-state",
|
||||
"original_id": "comment-end-state"
|
||||
},
|
||||
{
|
||||
"id": "comment-end-bang-state",
|
||||
"original_id": "comment-end-bang-state"
|
||||
},
|
||||
{
|
||||
"id": "doctype-state",
|
||||
"original_id": "doctype-state"
|
||||
},
|
||||
{
|
||||
"id": "before-doctype-name-state",
|
||||
"original_id": "before-doctype-name-state"
|
||||
},
|
||||
{
|
||||
"id": "doctype-name-state",
|
||||
"original_id": "doctype-name-state"
|
||||
},
|
||||
{
|
||||
"id": "after-doctype-name-state",
|
||||
"original_id": "after-doctype-name-state"
|
||||
},
|
||||
{
|
||||
"id": "after-doctype-public-keyword-state",
|
||||
"original_id": "after-doctype-public-keyword-state"
|
||||
},
|
||||
{
|
||||
"id": "before-doctype-public-identifier-state",
|
||||
"original_id": "before-doctype-public-identifier-state"
|
||||
},
|
||||
{
|
||||
"id": "doctype-public-identifier-double-quoted-state",
|
||||
"original_id": "doctype-public-identifier-(double-quoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "doctype-public-identifier-single-quoted-state",
|
||||
"original_id": "doctype-public-identifier-(single-quoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "after-doctype-public-identifier-state",
|
||||
"original_id": "after-doctype-public-identifier-state"
|
||||
},
|
||||
{
|
||||
"id": "between-doctype-public-and-system-identifiers-state",
|
||||
"original_id": "between-doctype-public-and-system-identifiers-state"
|
||||
},
|
||||
{
|
||||
"id": "after-doctype-system-keyword-state",
|
||||
"original_id": "after-doctype-system-keyword-state"
|
||||
},
|
||||
{
|
||||
"id": "before-doctype-system-identifier-state",
|
||||
"original_id": "before-doctype-system-identifier-state"
|
||||
},
|
||||
{
|
||||
"id": "doctype-system-identifier-double-quoted-state",
|
||||
"original_id": "doctype-system-identifier-(double-quoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "doctype-system-identifier-single-quoted-state",
|
||||
"original_id": "doctype-system-identifier-(single-quoted)-state"
|
||||
},
|
||||
{
|
||||
"id": "after-doctype-system-identifier-state",
|
||||
"original_id": "after-doctype-system-identifier-state"
|
||||
},
|
||||
{
|
||||
"id": "bogus-doctype-state",
|
||||
"original_id": "bogus-doctype-state"
|
||||
},
|
||||
{
|
||||
"id": "cdata-section-state",
|
||||
"original_id": "cdata-section-state"
|
||||
},
|
||||
{
|
||||
"id": "tokenizing-character-references",
|
||||
"original_id": "tokenizing-character-references"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tree-construction",
|
||||
"original_id": "tree-construction",
|
||||
"children": [
|
||||
{
|
||||
"id": "creating-and-inserting-elements",
|
||||
"original_id": "creating-and-inserting-elements"
|
||||
},
|
||||
{
|
||||
"id": "closing-elements-that-have-implied-end-tags",
|
||||
"original_id": "closing-elements-that-have-implied-end-tags"
|
||||
},
|
||||
{
|
||||
"id": "foster-parenting",
|
||||
"original_id": "foster-parenting"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inhtml",
|
||||
"original_id": "parsing-main-inhtml",
|
||||
"children": [
|
||||
{
|
||||
"id": "the-initial-insertion-mode",
|
||||
"original_id": "the-initial-insertion-mode"
|
||||
},
|
||||
{
|
||||
"id": "the-before-html-insertion-mode",
|
||||
"original_id": "the-before-html-insertion-mode"
|
||||
},
|
||||
{
|
||||
"id": "the-before-head-insertion-mode",
|
||||
"original_id": "the-before-head-insertion-mode"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inhead",
|
||||
"original_id": "parsing-main-inhead"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inheadnoscript",
|
||||
"original_id": "parsing-main-inheadnoscript"
|
||||
},
|
||||
{
|
||||
"id": "the-after-head-insertion-mode",
|
||||
"original_id": "the-after-head-insertion-mode"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inbody",
|
||||
"original_id": "parsing-main-inbody"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-incdata",
|
||||
"original_id": "parsing-main-incdata"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-intable",
|
||||
"original_id": "parsing-main-intable"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-intabletext",
|
||||
"original_id": "parsing-main-intabletext"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-incaption",
|
||||
"original_id": "parsing-main-incaption"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-incolgroup",
|
||||
"original_id": "parsing-main-incolgroup"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-intbody",
|
||||
"original_id": "parsing-main-intbody"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-intr",
|
||||
"original_id": "parsing-main-intr"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-intd",
|
||||
"original_id": "parsing-main-intd"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inselect",
|
||||
"original_id": "parsing-main-inselect"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inselectintable",
|
||||
"original_id": "parsing-main-inselectintable"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-afterbody",
|
||||
"original_id": "parsing-main-afterbody"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inframeset",
|
||||
"original_id": "parsing-main-inframeset"
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-afterframeset",
|
||||
"original_id": "parsing-main-afterframeset"
|
||||
},
|
||||
{
|
||||
"id": "the-after-after-body-insertion-mode",
|
||||
"original_id": "the-after-after-body-insertion-mode"
|
||||
},
|
||||
{
|
||||
"id": "the-after-after-frameset-insertion-mode",
|
||||
"original_id": "the-after-after-frameset-insertion-mode"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "parsing-main-inforeign",
|
||||
"original_id": "parsing-main-inforeign"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "the-end",
|
||||
"original_id": "the-end"
|
||||
},
|
||||
{
|
||||
"id": "coercing-an-html-dom-into-an-infoset",
|
||||
"original_id": "coercing-an-html-dom-into-an-infoset"
|
||||
},
|
||||
{
|
||||
"id": "an-introduction-to-error-handling-and-strange-cases-in-the-parser",
|
||||
"original_id": "an-introduction-to-error-handling-and-strange-cases-in-the-parser",
|
||||
"children": [
|
||||
{
|
||||
"id": "misnested-tags-b-i-b-i",
|
||||
"original_id": "misnested-tags:-b-i-/b-/i"
|
||||
},
|
||||
{
|
||||
"id": "misnested-tags-b-p-b-p",
|
||||
"original_id": "misnested-tags:-b-p-/b-/p"
|
||||
},
|
||||
{
|
||||
"id": "unexpected-markup-in-tables",
|
||||
"original_id": "unexpected-markup-in-tables"
|
||||
},
|
||||
{
|
||||
"id": "scripts-that-modify-the-page-as-it-is-being-parsed",
|
||||
"original_id": "scripts-that-modify-the-page-as-it-is-being-parsed"
|
||||
},
|
||||
{
|
||||
"id": "the-execution-of-scripts-that-are-moving-across-multiple-documents",
|
||||
"original_id": "the-execution-of-scripts-that-are-moving-across-multiple-documents"
|
||||
},
|
||||
{
|
||||
"id": "unclosed-formatting-elements",
|
||||
"original_id": "unclosed-formatting-elements"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG inside HTML OBJECT element parses correctly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
var svgNS = "http://www.w3.org/2000/svg";
|
||||
if(document.getElementsByTagName("object")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","green");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red");
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="RunTest()">
|
||||
<div class="testdata">
|
||||
<p id="instructions"> Test passes if a green rectangle is visible on the page below this line. </p>
|
||||
</div>
|
||||
|
||||
<object>
|
||||
<svg width="100px" height="100px" >
|
||||
<rect width="100px" height="100px" fill="none"/>
|
||||
</svg>
|
||||
</object>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG inside HTML BUTTON element parses correctly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
var svgNS = "http://www.w3.org/2000/svg";
|
||||
if(document.getElementsByTagName("button")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","green");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red");
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="RunTest()">
|
||||
|
||||
<div class="testdata">
|
||||
<p id="instructions">Test passes if the button has a green rectangle while 'FillerText1' and 'FillerText3' are on either side of the button.</p>
|
||||
</div>
|
||||
<div>
|
||||
FillerText1
|
||||
<button>
|
||||
<svg width="100px" height="100px">
|
||||
<rect width="100px" height="100px" fill="none" />
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
FillerText3
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG inside HTML CAPTION element parses correctly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
var svgNS = "http://www.w3.org/2000/svg";
|
||||
if(document.getElementsByTagName("caption")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","green");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red");
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="RunTest()">
|
||||
<div class="testdata">
|
||||
<p id="instructions">Test passes if a green square appears above and centered relative to the table.</p>
|
||||
</div>
|
||||
<div>
|
||||
<table border="1">
|
||||
<caption>
|
||||
<svg width="100px" height="100px">
|
||||
<rect width="100px" height="100px" fill="none" />
|
||||
</svg>
|
||||
</caption>
|
||||
<thead>
|
||||
<th>FillerText</th>
|
||||
<th>FillerText</th>
|
||||
<th>FillerText</th>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>FillerText</td>
|
||||
<td>FillerText</td>
|
||||
<td>FillerText</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>FillerText</td>
|
||||
<td>FillerText</td>
|
||||
<td>FillerText</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>FillerText</td>
|
||||
<td>FillerText</td>
|
||||
<td>FillerText</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG inside HTML FORM element parses correctly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
var svgNS = "http://www.w3.org/2000/svg";
|
||||
if(document.getElementsByTagName("form")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","green");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red");
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="RunTest()">
|
||||
<div class="testdata">
|
||||
<p id="instructions">Test passes if green rectangle is visible below 'FillerText1'.</p>
|
||||
</div>
|
||||
<div>
|
||||
FillerText1
|
||||
<form>
|
||||
<svg width="100px" height="100px">
|
||||
<rect width="100px" height="100px" fill="none" />
|
||||
</svg>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<svg width="100px" height="100px">
|
||||
<rect width="100px" height="100px" fill="none" />
|
||||
</svg>
|
||||
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG inside HTML 'HTML' element parses correctly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(document.body.childNodes[0].localName=="svg")
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","green");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red");
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="RunTest()">
|
||||
<div class="testdata">
|
||||
<p id="instructions">Test passes if a green rectangle is visible on the page above this line.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG inside HTML 'BODY' element parses correctly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(document.body.childNodes[3].localName=="svg")
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","green");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red");
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementsByTagName("rect")[0].setAttribute("fill","red")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="RunTest()">
|
||||
<div class="testdata">
|
||||
<p id="instructions"> Test passes if a green rectangle is visible on the page below this line. </p>
|
||||
</div>
|
||||
<svg width="100px" height="100px" >
|
||||
<rect x="0" y="0" width="100px" height="100px" />
|
||||
</svg>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG Self Closing tags parses properly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
var parentNode = document.getElementById("rect1");
|
||||
if(parentNode.childNodes[1].localName=="circle")
|
||||
{
|
||||
document.getElementById("testresult").innerHTML = "PASS";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("testresult").innerHTML = "FAIL"
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementById("testresult").innerHTML = "FAIL";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="RunTest()">
|
||||
<div class="testdata">
|
||||
<p id="instructions"> Test passes if the word "PASS" appears below </p>
|
||||
<p> Test Result : </p>
|
||||
<p id="testresult"> RUNNING </div>
|
||||
</div>
|
||||
|
||||
<svg width="100px" height="100px">
|
||||
<rect id="rect1" >
|
||||
<circle> </circle>
|
||||
</rect>
|
||||
</svg>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG Self Closing tags parses properly" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function RunTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
var parentNode = document.getElementById("svg1");
|
||||
if(parentNode.childNodes[1].localName=="rect" && parentNode.childNodes[3].localName=="circle")
|
||||
{
|
||||
document.getElementById("testresult").innerHTML = "PASS";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("testresult").innerHTML = "FAIL"
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
document.getElementById("testresult").innerHTML = "FAIL";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="RunTest()">
|
||||
|
||||
<div class="testdata">
|
||||
<p id="instructions"> Test passes if the word "PASS" appears below </p>
|
||||
<p> Test Result : </p>
|
||||
<p id="testresult"> RUNNING </div>
|
||||
</div>
|
||||
<svg id="svg1" width="100px" height="100px">
|
||||
<rect id="rect1" />
|
||||
<circle id="circle1" />
|
||||
</svg>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG elements are styled using ID Selector" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<style>
|
||||
#d1
|
||||
{
|
||||
fill: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="testdata">
|
||||
<p id="instructions">Test passes if a green square is visible below this line.</p>
|
||||
</div>
|
||||
<div id="d1">
|
||||
<svg width="100px" height="100px">
|
||||
<rect width="100px" height="100px" />
|
||||
</svg>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML 5 Foreign Content SVG in HTML </title>
|
||||
<meta description="Test to verify SVG elements are styled using CLASS Selector" />
|
||||
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
|
||||
|
||||
<style>
|
||||
.svg1
|
||||
{
|
||||
fill: green ;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="testdata">
|
||||
<p id="instructions">Test passes if a green square is visible below this line. </p>
|
||||
</div>
|
||||
<div id="d1">
|
||||
<svg class="svg1" width="100px" height="100px">
|
||||
<rect width="100px" height="100px"/>
|
||||
</svg>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_adoption02.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['cefc9890d621707fedf5eb634f3a86d753659d9b','2a8f569e9d55b3cb7e54b026f758dea8593f4cb4',];
|
||||
var tests = {
|
||||
"cefc9890d621707fedf5eb634f3a86d753659d9b":[async_test('html5lib_adoption02.html cefc9890d621707fedf5eb634f3a86d753659d9b'), "%3Cb%3E1%3Ci%3E2%3Cp%3E3%3C/b%3E4", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%223%22%0A%7C%20%20%20%20%20%20%20%20%20%224%22"],"2a8f569e9d55b3cb7e54b026f758dea8593f4cb4":[async_test('html5lib_adoption02.html 2a8f569e9d55b3cb7e54b026f758dea8593f4cb4'), "%3Ca%3E%3Cdiv%3E%3Cstyle%3E%3C/style%3E%3Caddress%3E%3Ca%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cstyle%3E%0A%7C%20%20%20%20%20%20%20%3Caddress%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_comments01.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['3dbda8330033c3fbf3185a55e963075328099578','7476098e9823b3deee1857739daf719ff18e37b4','a6c42885c32fa988374894c0871b5a289786912a','d59b196ec9f6f19ded28d5e1fb48cbec2b1a4187','97486c43262a9a5c3fec1a3b028b99b7ca8c0e3e','06145ae05b1d92b71aed067ed6f1aab1afea50ae','5064d84d3adaf6262cf3573e9e112f40e3abc147','8b36d140a4a223b083a8d41af7c98a1c20377856','1894e23c5ee89d6f4b5f1dbe9b681b42863b4d1f','2cefeae994b6b0be0accbfff4757fef40ed914eb','ac9fd94008255e73cba953dbd374cb41703f5446','617815b6a683613fcb6b9cd5841b2ea7428d838d','bb8faf75d2e28aee13ec4a0d8eab00b4d7475763','89c4ae1ae34df9dff0e516afdef87cd169c3e6a5',];
|
||||
var tests = {
|
||||
"3dbda8330033c3fbf3185a55e963075328099578":[async_test('html5lib_comments01.html 3dbda8330033c3fbf3185a55e963075328099578'), "FOO%3C%21--%20BAR%20--%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"7476098e9823b3deee1857739daf719ff18e37b4":[async_test('html5lib_comments01.html 7476098e9823b3deee1857739daf719ff18e37b4'), "FOO%3C%21--%20BAR%20--%21%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"a6c42885c32fa988374894c0871b5a289786912a":[async_test('html5lib_comments01.html a6c42885c32fa988374894c0871b5a289786912a'), "FOO%3C%21--%20BAR%20--%20%20%20%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%20%20%3EBAZ%20--%3E"],"d59b196ec9f6f19ded28d5e1fb48cbec2b1a4187":[async_test('html5lib_comments01.html d59b196ec9f6f19ded28d5e1fb48cbec2b1a4187'), "FOO%3C%21--%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%3CQUX%3E%20--%20MUX%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"97486c43262a9a5c3fec1a3b028b99b7ca8c0e3e":[async_test('html5lib_comments01.html 97486c43262a9a5c3fec1a3b028b99b7ca8c0e3e'), "FOO%3C%21--%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%21%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%3CQUX%3E%20--%20MUX%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"06145ae05b1d92b71aed067ed6f1aab1afea50ae":[async_test('html5lib_comments01.html 06145ae05b1d92b71aed067ed6f1aab1afea50ae'), "FOO%3C%21--%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%20%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20BAR%20--%20%3CQUX%3E%20--%20MUX%20--%20%3EBAZ%20--%3E"],"5064d84d3adaf6262cf3573e9e112f40e3abc147":[async_test('html5lib_comments01.html 5064d84d3adaf6262cf3573e9e112f40e3abc147'), "FOO%3C%21----%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"8b36d140a4a223b083a8d41af7c98a1c20377856":[async_test('html5lib_comments01.html 8b36d140a4a223b083a8d41af7c98a1c20377856'), "FOO%3C%21---%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"1894e23c5ee89d6f4b5f1dbe9b681b42863b4d1f":[async_test('html5lib_comments01.html 1894e23c5ee89d6f4b5f1dbe9b681b42863b4d1f'), "FOO%3C%21--%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"2cefeae994b6b0be0accbfff4757fef40ed914eb":[async_test('html5lib_comments01.html 2cefeae994b6b0be0accbfff4757fef40ed914eb'), "%3C%3Fxml%20version%3D%221.0%22%3EHi", "%23document%0A%7C%20%3C%21--%20%3Fxml%20version%3D%221.0%22%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22Hi%22"],"ac9fd94008255e73cba953dbd374cb41703f5446":[async_test('html5lib_comments01.html ac9fd94008255e73cba953dbd374cb41703f5446'), "%3C%3Fxml%20version%3D%221.0%22%3E", "%23document%0A%7C%20%3C%21--%20%3Fxml%20version%3D%221.0%22%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"617815b6a683613fcb6b9cd5841b2ea7428d838d":[async_test('html5lib_comments01.html 617815b6a683613fcb6b9cd5841b2ea7428d838d'), "%3C%3Fxml%20version", "%23document%0A%7C%20%3C%21--%20%3Fxml%20version%20--%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"bb8faf75d2e28aee13ec4a0d8eab00b4d7475763":[async_test('html5lib_comments01.html bb8faf75d2e28aee13ec4a0d8eab00b4d7475763'), "FOO%3C%21-----%3EBAZ", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22FOO%22%0A%7C%20%20%20%20%20%3C%21--%20-%20--%3E%0A%7C%20%20%20%20%20%22BAZ%22"],"89c4ae1ae34df9dff0e516afdef87cd169c3e6a5":[async_test('html5lib_comments01.html 89c4ae1ae34df9dff0e516afdef87cd169c3e6a5'), "%3Chtml%3E%3C%21--%20comment%20--%3E%3Ctitle%3EComment%20before%20head%3C/title%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3C%21--%20%20comment%20%20--%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%20%20%3Ctitle%3E%0A%7C%20%20%20%20%20%20%20%22Comment%20before%20head%22%0A%7C%20%20%20%3Cbody%3E"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_inbody01.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['3e20aae3cbc7f10b28cbfc1e20b2949708872a3c','ec6b9d9dccaa3494a317afac0edfcc485b959663','cc4923612d10b2115cd03e269080ddf5463d95ae','a5ebf8808e479239966038951d5383ed65ff4eb6',];
|
||||
var tests = {
|
||||
"3e20aae3cbc7f10b28cbfc1e20b2949708872a3c":[async_test('html5lib_inbody01.html 3e20aae3cbc7f10b28cbfc1e20b2949708872a3c'), "%3Cbutton%3E1%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cbutton%3E%0A%7C%20%20%20%20%20%20%20%221%22"],"ec6b9d9dccaa3494a317afac0edfcc485b959663":[async_test('html5lib_inbody01.html ec6b9d9dccaa3494a317afac0edfcc485b959663'), "%3Cfoo%3E1%3Cp%3E2%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22"],"cc4923612d10b2115cd03e269080ddf5463d95ae":[async_test('html5lib_inbody01.html cc4923612d10b2115cd03e269080ddf5463d95ae'), "%3Cdd%3E1%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%20%20%221%22"],"a5ebf8808e479239966038951d5383ed65ff4eb6":[async_test('html5lib_inbody01.html a5ebf8808e479239966038951d5383ed65ff4eb6'), "%3Cfoo%3E1%3Cdd%3E2%3C/foo%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%20%20%3Cdd%3E%0A%7C%20%20%20%20%20%20%20%20%20%222%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_innerHTML_tests4.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['8c692a23f8c9b5860cf06fb334041d2e97e96f5c','95cb768746a1ca7ac02d39c0bb2b10d9e965e37c','06bd3583493359d112d19765f68fac3901267408','48d8375ef2d9d73bd133f2947858a3450a988d53','36fb2178fbdfa1b32701a9d9214c3fd115fd7184','d373bc3abdda01b17a6055af21b16c151dd1d697','4f91b1d4c6e2bbc0595c9effc490b7357e9cefc2',];
|
||||
var tests = {
|
||||
"8c692a23f8c9b5860cf06fb334041d2e97e96f5c":[async_test('html5lib_innerHTML_tests4.html 8c692a23f8c9b5860cf06fb334041d2e97e96f5c'), "direct%20div%20content", "%23document%0A%7C%20%22direct%20div%20content%22", 'div'],"95cb768746a1ca7ac02d39c0bb2b10d9e965e37c":[async_test('html5lib_innerHTML_tests4.html 95cb768746a1ca7ac02d39c0bb2b10d9e965e37c'), "direct%20textarea%20content", "%23document%0A%7C%20%22direct%20textarea%20content%22", 'textarea'],"06bd3583493359d112d19765f68fac3901267408":[async_test('html5lib_innerHTML_tests4.html 06bd3583493359d112d19765f68fac3901267408'), "textarea%20content%20with%20%3Cem%3Epseudo%3C/em%3E%20%3Cfoo%3Emarkup", "%23document%0A%7C%20%22textarea%20content%20with%20%3Cem%3Epseudo%3C/em%3E%20%3Cfoo%3Emarkup%22", 'textarea'],"48d8375ef2d9d73bd133f2947858a3450a988d53":[async_test('html5lib_innerHTML_tests4.html 48d8375ef2d9d73bd133f2947858a3450a988d53'), "this%20is%20%26%23x0043%3BDATA%20inside%20a%20%3Cstyle%3E%20element", "%23document%0A%7C%20%22this%20is%20%26%23x0043%3BDATA%20inside%20a%20%3Cstyle%3E%20element%22", 'style'],"36fb2178fbdfa1b32701a9d9214c3fd115fd7184":[async_test('html5lib_innerHTML_tests4.html 36fb2178fbdfa1b32701a9d9214c3fd115fd7184'), "%3C/plaintext%3E", "%23document%0A%7C%20%22%3C/plaintext%3E%22", 'plaintext'],"d373bc3abdda01b17a6055af21b16c151dd1d697":[async_test('html5lib_innerHTML_tests4.html d373bc3abdda01b17a6055af21b16c151dd1d697'), "setting%20html%27s%20innerHTML", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E%0A%7C%20%20%20%22setting%20html%27s%20innerHTML%22", 'html'],"4f91b1d4c6e2bbc0595c9effc490b7357e9cefc2":[async_test('html5lib_innerHTML_tests4.html 4f91b1d4c6e2bbc0595c9effc490b7357e9cefc2'), "%3Ctitle%3Esetting%20head%27s%20innerHTML%3C/title%3E", "%23document%0A%7C%20%3Ctitle%3E%0A%7C%20%20%20%22setting%20head%27s%20innerHTML%22", 'head'],
|
||||
}
|
||||
init_tests("innerHTML");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_innerHTML_tests6.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['ccb245e2f1d9fe1580235854daa1a124525aca61','ed2b0f8fe477e3a6a0d9052b46bd94e628fb666a','ed4acc4544b7ee83072a3c2ae078e3cbaf8303fb','28f111cdfb84bfa4a70b57e3aeec1f0aa13337de','616bd17e481973f9fe286aa30727ee22850fc31e','1cfb3baf2ad29109ddd5581daa3a009029c71491','98ba377bacd2ec343919bdc589116eabf94402d5','7cf2db8c65b79da98e39b13772ed0440ff177fd7','cb78efe1d4f4279be6c0a363cce643b3591efdc5','82911b0551c00e9971dd1491f8f2d2782aa3ac63','a3ff1f1809e8018b725620f1d04b6ebb24fda9a4','e35e330f7eb5bb27df1fe702843747e104a193be','c1dc3add1fcb1f506ea395691a710eb8e727b123',];
|
||||
var tests = {
|
||||
"ccb245e2f1d9fe1580235854daa1a124525aca61":[async_test('html5lib_innerHTML_tests6.html ccb245e2f1d9fe1580235854daa1a124525aca61'), "%3Cbody%3E%0A%3Cdiv%3E", "%23document%0A%7C%20%22%0A%22%0A%7C%20%3Cdiv%3E", 'div'],"ed2b0f8fe477e3a6a0d9052b46bd94e628fb666a":[async_test('html5lib_innerHTML_tests6.html ed2b0f8fe477e3a6a0d9052b46bd94e628fb666a'), "%3C/caption%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'caption'],"ed4acc4544b7ee83072a3c2ae078e3cbaf8303fb":[async_test('html5lib_innerHTML_tests6.html ed4acc4544b7ee83072a3c2ae078e3cbaf8303fb'), "%3C/table%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'caption'],"28f111cdfb84bfa4a70b57e3aeec1f0aa13337de":[async_test('html5lib_innerHTML_tests6.html 28f111cdfb84bfa4a70b57e3aeec1f0aa13337de'), "%3C/table%3E%3C/tbody%3E%3C/tfoot%3E%3C/thead%3E%3C/tr%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'td'],"616bd17e481973f9fe286aa30727ee22850fc31e":[async_test('html5lib_innerHTML_tests6.html 616bd17e481973f9fe286aa30727ee22850fc31e'), "foo%3Ccol%3E", "%23document%0A%7C%20%3Ccol%3E", 'colgroup'],"1cfb3baf2ad29109ddd5581daa3a009029c71491":[async_test('html5lib_innerHTML_tests6.html 1cfb3baf2ad29109ddd5581daa3a009029c71491'), "%3C/frameset%3E%3Cframe%3E", "%23document%0A%7C%20%3Cframe%3E", 'frameset'],"98ba377bacd2ec343919bdc589116eabf94402d5":[async_test('html5lib_innerHTML_tests6.html 98ba377bacd2ec343919bdc589116eabf94402d5'), "%3C/body%3E%3Cdiv%3E", "%23document%0A%7C%20%3Cdiv%3E", 'body'],"7cf2db8c65b79da98e39b13772ed0440ff177fd7":[async_test('html5lib_innerHTML_tests6.html 7cf2db8c65b79da98e39b13772ed0440ff177fd7'), "%3C/tr%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"cb78efe1d4f4279be6c0a363cce643b3591efdc5":[async_test('html5lib_innerHTML_tests6.html cb78efe1d4f4279be6c0a363cce643b3591efdc5'), "%3C/tbody%3E%3C/tfoot%3E%3C/thead%3E%3Ctd%3E", "%23document%0A%7C%20%3Ctd%3E", 'tr'],"82911b0551c00e9971dd1491f8f2d2782aa3ac63":[async_test('html5lib_innerHTML_tests6.html 82911b0551c00e9971dd1491f8f2d2782aa3ac63'), "%3Ccaption%3E%3Ccol%3E%3Ccolgroup%3E%3Ctbody%3E%3Ctfoot%3E%3Cthead%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctr%3E", 'tbody'],"a3ff1f1809e8018b725620f1d04b6ebb24fda9a4":[async_test('html5lib_innerHTML_tests6.html a3ff1f1809e8018b725620f1d04b6ebb24fda9a4'), "%3C/table%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctr%3E", 'tbody'],"e35e330f7eb5bb27df1fe702843747e104a193be":[async_test('html5lib_innerHTML_tests6.html e35e330f7eb5bb27df1fe702843747e104a193be'), "%3C/table%3E%3Ctr%3E", "%23document%0A%7C%20%3Ctbody%3E%0A%7C%20%20%20%3Ctr%3E", 'table'],"c1dc3add1fcb1f506ea395691a710eb8e727b123":[async_test('html5lib_innerHTML_tests6.html c1dc3add1fcb1f506ea395691a710eb8e727b123'), "%3Cbody%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E", 'html'],
|
||||
}
|
||||
init_tests("innerHTML");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_innerHTML_tests7.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['7aabda442dc7b37110c3d03b1465fa893dc25625',];
|
||||
var tests = {
|
||||
"7aabda442dc7b37110c3d03b1465fa893dc25625":[async_test('html5lib_innerHTML_tests7.html 7aabda442dc7b37110c3d03b1465fa893dc25625'), "%3Cbody%3EX%3C/body%3E%3C/body%3E", "%23document%0A%7C%20%3Chead%3E%0A%7C%20%3Cbody%3E%0A%7C%20%20%20%22X%22", 'html'],
|
||||
}
|
||||
init_tests("innerHTML");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_isindex.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['579ca96e69c47b3d2ac83f1aa79a450b745d21f3','cb91f67071d81dd18d7ba9990de8f0f845c375f0','bd8ac64cc8f1422fac94bbe1c8828c0b51dca3f2',];
|
||||
var tests = {
|
||||
"579ca96e69c47b3d2ac83f1aa79a450b745d21f3":[async_test('html5lib_isindex.html 579ca96e69c47b3d2ac83f1aa79a450b745d21f3'), "%3Cisindex%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22This%20is%20a%20searchable%20index.%20Enter%20search%20keywords%3A%20%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"cb91f67071d81dd18d7ba9990de8f0f845c375f0":[async_test('html5lib_isindex.html cb91f67071d81dd18d7ba9990de8f0f845c375f0'), "%3Cisindex%20name%3D%22A%22%20action%3D%22B%22%20prompt%3D%22C%22%20foo%3D%22D%22%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E%0A%7C%20%20%20%20%20%20%20action%3D%22B%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E%0A%7C%20%20%20%20%20%20%20%3Clabel%3E%0A%7C%20%20%20%20%20%20%20%20%20%22C%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cinput%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20foo%3D%22D%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20name%3D%22isindex%22%0A%7C%20%20%20%20%20%20%20%3Chr%3E"],"bd8ac64cc8f1422fac94bbe1c8828c0b51dca3f2":[async_test('html5lib_isindex.html bd8ac64cc8f1422fac94bbe1c8828c0b51dca3f2'), "%3Cform%3E%3Cisindex%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cform%3E"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_main-element.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['336a047fbc84b86dfd4baea5881b50fe0cdb5ce8','fc887f078ddc2723261a7dfb25829efe2da284f2','ebd10973e73d3a339bdf22f8bbac2f028044e096',];
|
||||
var tests = {
|
||||
"336a047fbc84b86dfd4baea5881b50fe0cdb5ce8":[async_test('html5lib_main-element.html 336a047fbc84b86dfd4baea5881b50fe0cdb5ce8'), "%3C%21doctype%20html%3E%3Cp%3Efoo%3Cmain%3Ebar%3Cp%3Ebaz", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Cmain%3E%0A%7C%20%20%20%20%20%20%20%22bar%22%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22baz%22"],"fc887f078ddc2723261a7dfb25829efe2da284f2":[async_test('html5lib_main-element.html fc887f078ddc2723261a7dfb25829efe2da284f2'), "%3C%21doctype%20html%3E%3Cmain%3E%3Cp%3Efoo%3C/main%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cmain%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%22bar%22"],"ebd10973e73d3a339bdf22f8bbac2f028044e096":[async_test('html5lib_main-element.html ebd10973e73d3a339bdf22f8bbac2f028044e096'), "%3C%21DOCTYPE%20html%3Exxx%3Csvg%3E%3Cx%3E%3Cg%3E%3Ca%3E%3Cmain%3E%3Cb%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22xxx%22%0A%7C%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%3Csvg%20x%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20a%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20main%3E%0A%7C%20%20%20%20%20%3Cb%3E"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_pending-spec-changes-plain-text-unsafe.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['8afa8d082dc447be5cab2eeb3e13efb07ec72aa6',];
|
||||
var tests = {
|
||||
"8afa8d082dc447be5cab2eeb3e13efb07ec72aa6":[async_test('html5lib_pending-spec-changes-plain-text-unsafe.html 8afa8d082dc447be5cab2eeb3e13efb07ec72aa6'), "%3Cbody%3E%3Ctable%3E%00filler%00text%00", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22fillertext%22%0A%7C%20%20%20%20%20%3Ctable%3E"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_pending-spec-changes.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['965e062f9d01c4334cb12637e84dcbf438d38faf','8772d25919914a17118b2105e126aaa5bc83f92c','9804e9659cd045f199d9f58ef85c2639724359aa',];
|
||||
var tests = {
|
||||
"965e062f9d01c4334cb12637e84dcbf438d38faf":[async_test('html5lib_pending-spec-changes.html 965e062f9d01c4334cb12637e84dcbf438d38faf'), "%3Cinput%20type%3D%22hidden%22%3E%3Cframeset%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cframeset%3E"],"8772d25919914a17118b2105e126aaa5bc83f92c":[async_test('html5lib_pending-spec-changes.html 8772d25919914a17118b2105e126aaa5bc83f92c'), "%3C%21DOCTYPE%20html%3E%3Ctable%3E%3Ccaption%3E%3Csvg%3Efoo%3C/table%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ccaption%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%22bar%22"],"9804e9659cd045f199d9f58ef85c2639724359aa":[async_test('html5lib_pending-spec-changes.html 9804e9659cd045f199d9f58ef85c2639724359aa'), "%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Csvg%3E%3Cdesc%3E%3Ctd%3E%3C/desc%3E%3Ccircle%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ccircle%3E"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_scripted_adoption01.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['8970fe21b551a270aa74648bb2e8b905edb54522',];
|
||||
var tests = {
|
||||
"8970fe21b551a270aa74648bb2e8b905edb54522":[async_test('html5lib_scripted_adoption01.html 8970fe21b551a270aa74648bb2e8b905edb54522'), "%3Cp%3E%3Cb%20id%3D%22A%22%3E%3Cscript%3Edocument.getElementById%28%22A%22%29.id%20%3D%20%22B%22%3C/script%3E%3C/p%3ETEXT%3C/b%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20id%3D%22B%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22document.getElementById%28%22A%22%29.id%20%3D%20%22B%22%22%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20id%3D%22A%22%0A%7C%20%20%20%20%20%20%20%22TEXT%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_scripted_ark.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['b9a7cd0310cab4fd4eb77aed9149b966918e7ca2',];
|
||||
var tests = {
|
||||
"b9a7cd0310cab4fd4eb77aed9149b966918e7ca2":[async_test('html5lib_scripted_ark.html b9a7cd0310cab4fd4eb77aed9149b966918e7ca2'), "%3Cp%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cfont%20size%3D4%3E%3Cscript%3Edocument.getElementsByTagName%28%22font%22%29%5B2%5D.setAttribute%28%22size%22%2C%20%225%22%29%3B%3C/script%3E%3Cfont%20size%3D4%3E%3Cp%3EX", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%225%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22document.getElementsByTagName%28%22font%22%29%5B2%5D.setAttribute%28%22size%22%2C%20%225%22%29%3B%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Cfont%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20size%3D%224%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22X%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_scripted_webkit01.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['3ff6ec1125852c7933bf6d89ecb375354e6e1b40','46ae362de712eb9c55916de93110299dbbcb5726',];
|
||||
var tests = {
|
||||
"3ff6ec1125852c7933bf6d89ecb375354e6e1b40":[async_test('html5lib_scripted_webkit01.html 3ff6ec1125852c7933bf6d89ecb375354e6e1b40'), "1%3Cscript%3Edocument.write%28%222%22%29%3C/script%3E3", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%222%22%29%22%0A%7C%20%20%20%20%20%2223%22"],"46ae362de712eb9c55916de93110299dbbcb5726":[async_test('html5lib_scripted_webkit01.html 46ae362de712eb9c55916de93110299dbbcb5726'), "1%3Cscript%3Edocument.write%28%22%3Cscript%3Edocument.write%28%272%27%29%3C/scr%22%2B%20%22ipt%3E%3Cscript%3Edocument.write%28%273%27%29%3C/scr%22%20%2B%20%22ipt%3E%22%29%3C/script%3E4", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%221%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%22%3Cscript%3Edocument.write%28%272%27%29%3C/scr%22%2B%20%22ipt%3E%3Cscript%3Edocument.write%28%273%27%29%3C/scr%22%20%2B%20%22ipt%3E%22%29%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%272%27%29%22%0A%7C%20%20%20%20%20%222%22%0A%7C%20%20%20%20%20%3Cscript%3E%0A%7C%20%20%20%20%20%20%20%22document.write%28%273%27%29%22%0A%7C%20%20%20%20%20%2234%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_tests12.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['95751b82f57d4feaaf06d208d57b7f6cc4d5fef5','411c792cef85cbb029d5c91f4a2142751a319bc2',];
|
||||
var tests = {
|
||||
"95751b82f57d4feaaf06d208d57b7f6cc4d5fef5":[async_test('html5lib_tests12.html 95751b82f57d4feaaf06d208d57b7f6cc4d5fef5'), "%3C%21DOCTYPE%20html%3E%3Cbody%3E%3Cp%3Efoo%3Cmath%3E%3Cmtext%3E%3Ci%3Ebaz%3C/i%3E%3C/mtext%3E%3Cannotation-xml%3E%3Csvg%3E%3Cdesc%3E%3Cb%3Eeggs%3C/b%3E%3C/desc%3E%3Cg%3E%3CforeignObject%3E%3CP%3Espam%3CTABLE%3E%3Ctr%3E%3Ctd%3E%3Cimg%3E%3C/td%3E%3C/table%3E%3C/foreignObject%3E%3C/g%3E%3Cg%3Equux%3C/g%3E%3C/svg%3E%3C/annotation-xml%3E%3C/math%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22eggs%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22spam%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22quux%22%0A%7C%20%20%20%20%20%20%20%22bar%22"],"411c792cef85cbb029d5c91f4a2142751a319bc2":[async_test('html5lib_tests12.html 411c792cef85cbb029d5c91f4a2142751a319bc2'), "%3C%21DOCTYPE%20html%3E%3Cbody%3Efoo%3Cmath%3E%3Cmtext%3E%3Ci%3Ebaz%3C/i%3E%3C/mtext%3E%3Cannotation-xml%3E%3Csvg%3E%3Cdesc%3E%3Cb%3Eeggs%3C/b%3E%3C/desc%3E%3Cg%3E%3CforeignObject%3E%3CP%3Espam%3CTABLE%3E%3Ctr%3E%3Ctd%3E%3Cimg%3E%3C/td%3E%3C/table%3E%3C/foreignObject%3E%3C/g%3E%3Cg%3Equux%3C/g%3E%3C/svg%3E%3C/annotation-xml%3E%3C/math%3Ebar", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22foo%22%0A%7C%20%20%20%20%20%3Cmath%20math%3E%0A%7C%20%20%20%20%20%20%20%3Cmath%20mtext%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ci%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%22baz%22%0A%7C%20%20%20%20%20%20%20%3Cmath%20annotation-xml%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Csvg%20svg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20desc%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22eggs%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20foreignObject%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22spam%22%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cimg%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Csvg%20g%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22quux%22%0A%7C%20%20%20%20%20%22bar%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_tests14.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['d0faa36cd34bbc8e41bacd676e995aef68cb8ef7','9d97df65d72e97363840684da4e164b50c4bf1cb','c5de9372cd188bc22d40d4ad08eb6f787ab521ea','d16e1c0655b2086c1bd995cf6f1c5c7106e48ef0','383a71bb62eacf93dcb2399c7dd7419d92a91899','ee5e2e4a3346d225907f27c1f12b3cb2e77c32c4','cd557ae48cd48356c367e470927d0fc108724409',];
|
||||
var tests = {
|
||||
"d0faa36cd34bbc8e41bacd676e995aef68cb8ef7":[async_test('html5lib_tests14.html d0faa36cd34bbc8e41bacd676e995aef68cb8ef7'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Cbody%3E%3Cxyz%3Aabc%3E%3C/xyz%3Aabc%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxyz%3Aabc%3E"],"9d97df65d72e97363840684da4e164b50c4bf1cb":[async_test('html5lib_tests14.html 9d97df65d72e97363840684da4e164b50c4bf1cb'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Cbody%3E%3Cxyz%3Aabc%3E%3C/xyz%3Aabc%3E%3Cspan%3E%3C/span%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxyz%3Aabc%3E%0A%7C%20%20%20%20%20%3Cspan%3E"],"c5de9372cd188bc22d40d4ad08eb6f787ab521ea":[async_test('html5lib_tests14.html c5de9372cd188bc22d40d4ad08eb6f787ab521ea'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Chtml%20abc%3Adef%3Dgh%3E%3Cxyz%3Aabc%3E%3C/xyz%3Aabc%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20abc%3Adef%3D%22gh%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cxyz%3Aabc%3E"],"d16e1c0655b2086c1bd995cf6f1c5c7106e48ef0":[async_test('html5lib_tests14.html d16e1c0655b2086c1bd995cf6f1c5c7106e48ef0'), "%3C%21DOCTYPE%20html%3E%3Chtml%20xml%3Alang%3Dbar%3E%3Chtml%20xml%3Alang%3Dfoo%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20xml%3Alang%3D%22bar%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"383a71bb62eacf93dcb2399c7dd7419d92a91899":[async_test('html5lib_tests14.html 383a71bb62eacf93dcb2399c7dd7419d92a91899'), "%3C%21DOCTYPE%20html%3E%3Chtml%20123%3D456%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20123%3D%22456%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"ee5e2e4a3346d225907f27c1f12b3cb2e77c32c4":[async_test('html5lib_tests14.html ee5e2e4a3346d225907f27c1f12b3cb2e77c32c4'), "%3C%21DOCTYPE%20html%3E%3Chtml%20123%3D456%3E%3Chtml%20789%3D012%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20123%3D%22456%22%0A%7C%20%20%20789%3D%22012%22%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"cd557ae48cd48356c367e470927d0fc108724409":[async_test('html5lib_tests14.html cd557ae48cd48356c367e470927d0fc108724409'), "%3C%21DOCTYPE%20html%3E%3Chtml%3E%3Cbody%20789%3D012%3E", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20789%3D%22012%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_tests24.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['692c2dbacf18cb758f26a3d9e7d9add4356f9067','614cc9827d3a0c5f91863dde5281dd0d97f64e6d','c517924583ee71b8e684c9ca1f2eed5e88139a39','140a82fab878c139b388d159c511eb999fe2d8c7','a2ddddcccb652a6529daafd4153a0e12b6d5ca8c','da2e30a0b6577b608bf48bbd11a16ff832bc7e46','66a5777f5453bd4b5161f00df02883b6d71f7cea','c8d97f31b70f67005eeacc3c86ac29e577c3d0ed',];
|
||||
var tests = {
|
||||
"692c2dbacf18cb758f26a3d9e7d9add4356f9067":[async_test('html5lib_tests24.html 692c2dbacf18cb758f26a3d9e7d9add4356f9067'), "%3C%21DOCTYPE%20html%3E%26NotEqualTilde%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%89%82%CC%B8%22"],"614cc9827d3a0c5f91863dde5281dd0d97f64e6d":[async_test('html5lib_tests24.html 614cc9827d3a0c5f91863dde5281dd0d97f64e6d'), "%3C%21DOCTYPE%20html%3E%26NotEqualTilde%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%89%82%CC%B8A%22"],"c517924583ee71b8e684c9ca1f2eed5e88139a39":[async_test('html5lib_tests24.html c517924583ee71b8e684c9ca1f2eed5e88139a39'), "%3C%21DOCTYPE%20html%3E%26ThickSpace%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%81%9F%E2%80%8A%22"],"140a82fab878c139b388d159c511eb999fe2d8c7":[async_test('html5lib_tests24.html 140a82fab878c139b388d159c511eb999fe2d8c7'), "%3C%21DOCTYPE%20html%3E%26ThickSpace%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%81%9F%E2%80%8AA%22"],"a2ddddcccb652a6529daafd4153a0e12b6d5ca8c":[async_test('html5lib_tests24.html a2ddddcccb652a6529daafd4153a0e12b6d5ca8c'), "%3C%21DOCTYPE%20html%3E%26NotSubset%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%8A%82%E2%83%92%22"],"da2e30a0b6577b608bf48bbd11a16ff832bc7e46":[async_test('html5lib_tests24.html da2e30a0b6577b608bf48bbd11a16ff832bc7e46'), "%3C%21DOCTYPE%20html%3E%26NotSubset%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%E2%8A%82%E2%83%92A%22"],"66a5777f5453bd4b5161f00df02883b6d71f7cea":[async_test('html5lib_tests24.html 66a5777f5453bd4b5161f00df02883b6d71f7cea'), "%3C%21DOCTYPE%20html%3E%26Gopf%3B", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%F0%9D%94%BE%22"],"c8d97f31b70f67005eeacc3c86ac29e577c3d0ed":[async_test('html5lib_tests24.html c8d97f31b70f67005eeacc3c86ac29e577c3d0ed'), "%3C%21DOCTYPE%20html%3E%26Gopf%3BA", "%23document%0A%7C%20%3C%21DOCTYPE%20html%3E%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22%F0%9D%94%BEA%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_tests8.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['5097f2cd0124cf5a23c7ccbe25f71a06966503df','0e11d51b0f71098caaccd166c368918c93683a7c','5c8ec9b2d6f03c2e971dc192897f3fcff92e5a32','a1fe2c2debb936fc1bf663f0d7228eb509522467','dbd09e012016b52703ab081360265d3bf96f3c76','a57d838264ec0d79c8b0c3cb1feb5cb941c0084d','263ff1438ee785d081669eea0fa110cca1d0d590','1ace730a87644923b11aa89e4e472cc5dd91edb7','26454c08b0d791754bf2f94fbee62624cae5fa5c',];
|
||||
var tests = {
|
||||
"5097f2cd0124cf5a23c7ccbe25f71a06966503df":[async_test('html5lib_tests8.html 5097f2cd0124cf5a23c7ccbe25f71a06966503df'), "%3Cdiv%3E%0A%3Cdiv%3E%3C/div%3E%0A%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%0A%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%0Ax%22"],"0e11d51b0f71098caaccd166c368918c93683a7c":[async_test('html5lib_tests8.html 0e11d51b0f71098caaccd166c368918c93683a7c'), "%3Cdiv%3Ex%3Cdiv%3E%3C/div%3E%0A%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22%0Ax%22"],"5c8ec9b2d6f03c2e971dc192897f3fcff92e5a32":[async_test('html5lib_tests8.html 5c8ec9b2d6f03c2e971dc192897f3fcff92e5a32'), "%3Cdiv%3Ex%3Cdiv%3E%3C/div%3Ex%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22xx%22"],"a1fe2c2debb936fc1bf663f0d7228eb509522467":[async_test('html5lib_tests8.html a1fe2c2debb936fc1bf663f0d7228eb509522467'), "%3Cdiv%3Ex%3Cdiv%3E%3C/div%3Ey%3C/span%3Ez", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22yz%22"],"dbd09e012016b52703ab081360265d3bf96f3c76":[async_test('html5lib_tests8.html dbd09e012016b52703ab081360265d3bf96f3c76'), "%3Ctable%3E%3Cdiv%3Ex%3Cdiv%3E%3C/div%3Ex%3C/span%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%22xx%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"a57d838264ec0d79c8b0c3cb1feb5cb941c0084d":[async_test('html5lib_tests8.html a57d838264ec0d79c8b0c3cb1feb5cb941c0084d'), "x%3Ctable%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22xx%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"263ff1438ee785d081669eea0fa110cca1d0d590":[async_test('html5lib_tests8.html 263ff1438ee785d081669eea0fa110cca1d0d590'), "x%3Ctable%3E%3Ctable%3Ex", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%22x%22%0A%7C%20%20%20%20%20%3Ctable%3E"],"1ace730a87644923b11aa89e4e472cc5dd91edb7":[async_test('html5lib_tests8.html 1ace730a87644923b11aa89e4e472cc5dd91edb7'), "%3Cb%3Ea%3Cdiv%3E%3C/div%3E%3Cdiv%3E%3C/b%3Ey", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22a%22%0A%7C%20%20%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Cb%3E%0A%7C%20%20%20%20%20%20%20%22y%22"],"26454c08b0d791754bf2f94fbee62624cae5fa5c":[async_test('html5lib_tests8.html 26454c08b0d791754bf2f94fbee62624cae5fa5c'), "%3Ca%3E%3Cdiv%3E%3Cp%3E%3C/a%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Ca%3E%0A%7C%20%20%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ca%3E"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>HTML 5 Parser tests html5lib_webkit02.html</title>
|
||||
<meta name="timeout" content="long">
|
||||
<meta name="variant" content="?run_type=uri">
|
||||
<meta name="variant" content="?run_type=write">
|
||||
<meta name="variant" content="?run_type=write_single">
|
||||
</head>
|
||||
<body>
|
||||
<h1>html5lib Parser Test</h1>
|
||||
<div id="log"></div>
|
||||
<script src="common.js"></script>
|
||||
<script src="test.js"></script>
|
||||
<script src="template.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var num_iframes = 8;
|
||||
var order = ['f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6','326328ea805a2ebdde707e08567713f88a4cf8ab','05138397908cfdad69a3bfe5da5a06098320b504','2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9','4a256d7ef602c7c917c758e15981b9710f9b4130','98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4','209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f','cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6',];
|
||||
var tests = {
|
||||
"f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6":[async_test('html5lib_webkit02.html f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6'), "%3Cfoo%20bar%3Dqux/%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cfoo%3E%0A%7C%20%20%20%20%20%20%20bar%3D%22qux/%22"],"326328ea805a2ebdde707e08567713f88a4cf8ab":[async_test('html5lib_webkit02.html 326328ea805a2ebdde707e08567713f88a4cf8ab'), "%3Cp%20id%3D%22status%22%3E%3Cnoscript%3E%3Cstrong%3EA%3C/strong%3E%3C/noscript%3E%3Cspan%3EB%3C/span%3E%3C/p%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cp%3E%0A%7C%20%20%20%20%20%20%20id%3D%22status%22%0A%7C%20%20%20%20%20%20%20%3Cnoscript%3E%0A%7C%20%20%20%20%20%20%20%20%20%22%3Cstrong%3EA%3C/strong%3E%22%0A%7C%20%20%20%20%20%20%20%3Cspan%3E%0A%7C%20%20%20%20%20%20%20%20%20%22B%22"],"05138397908cfdad69a3bfe5da5a06098320b504":[async_test('html5lib_webkit02.html 05138397908cfdad69a3bfe5da5a06098320b504'), "%3Cdiv%3E%3Csarcasm%3E%3Cdiv%3E%3C/div%3E%3C/sarcasm%3E%3C/div%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Cdiv%3E%0A%7C%20%20%20%20%20%20%20%3Csarcasm%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Cdiv%3E"],"2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9":[async_test('html5lib_webkit02.html 2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9'), "%3Chtml%3E%3Cbody%3E%3Cimg%20src%3D%22%22%20border%3D%220%22%20alt%3D%22%3E%3Cdiv%3EA%3C/div%3E%3C/body%3E%3C/html%3E", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E"],"4a256d7ef602c7c917c758e15981b9710f9b4130":[async_test('html5lib_webkit02.html 4a256d7ef602c7c917c758e15981b9710f9b4130'), "%3Ctable%3E%3Ctd%3E%3C/tbody%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%22A%22%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E"],"98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4":[async_test('html5lib_webkit02.html 98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4'), "%3Ctable%3E%3Ctd%3E%3C/thead%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],"209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f":[async_test('html5lib_webkit02.html 209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f'), "%3Ctable%3E%3Ctd%3E%3C/tfoot%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Ctbody%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],"cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6":[async_test('html5lib_webkit02.html cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6'), "%3Ctable%3E%3Cthead%3E%3Ctd%3E%3C/tbody%3EA", "%23document%0A%7C%20%3Chtml%3E%0A%7C%20%20%20%3Chead%3E%0A%7C%20%20%20%3Cbody%3E%0A%7C%20%20%20%20%20%3Ctable%3E%0A%7C%20%20%20%20%20%20%20%3Cthead%3E%0A%7C%20%20%20%20%20%20%20%20%20%3Ctr%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%3Ctd%3E%0A%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%22A%22"],
|
||||
}
|
||||
init_tests(get_type());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>math in html: parsing</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>math in html: parsing</h1>
|
||||
|
||||
<div id="log" style="display:block"></div>
|
||||
|
||||
<div style="display:none">
|
||||
<div><math id="m1"><mtext/></math></div>
|
||||
<div id="d1"><math><mrow/><mi/></math></div>
|
||||
<div id="d2"><math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math></div>
|
||||
<div id="d3">⟨⟩</div>
|
||||
<div id="d4">𝕂</div>
|
||||
<div id="d5"><math><semantics><mi>a</mi><annotation-xml><foo/><bar/></annotation-xml></semantics></math></div>
|
||||
<div id="d6"><math><semantics><mi>a</mi><annotation-xml encoding="text/html"><div></div></annotation-xml></semantics><mn/></math>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m1"),document.getElementsByTagName("math")[0]);
|
||||
},"The id attribute should be recognised on math elements");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d1").firstChild.nodeName,"math")
|
||||
},"The node name should be math");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d1").firstChild.namespaceURI ,"http://www.w3.org/1998/Math/MathML")
|
||||
},"math should be in MathML Namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d1").firstChild.childNodes.length ,2)
|
||||
},"Math has 2 children (empty tag syntax)");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d2").firstChild.childNodes.length ,1)
|
||||
},"Nested mrow elements should be parsed correctly");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d3").firstChild.nodeValue ,"\u27E8\u27E9")
|
||||
},"Testing rang and lang entity code points");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d4").firstChild.nodeValue ,"\uD835\uDD42")
|
||||
},"Testing Kopf (Plane 1) entity code point");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d5").firstChild.firstChild.childNodes[1].childNodes.length ,2)
|
||||
},"Empty element tags in annotation-xml parsed as per XML.");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d6").firstChild.childNodes.length ,2)
|
||||
},"html tags allowed in annotation-xml/@encoding='text/html'.");
|
||||
|
||||
</script>
|
132
tests/wpt/web-platform-tests/html/syntax/parsing/math-parse03.html
Executable file
132
tests/wpt/web-platform-tests/html/syntax/parsing/math-parse03.html
Executable file
|
@ -0,0 +1,132 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>math in html: parsing</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>math in html: parsing</h1>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<div>
|
||||
<div><MATH id="m1"><Mtext/></math></div>
|
||||
<div id="d1"><math><MI MATHVARIANT="BOLD" /></math></div>
|
||||
<div id="d2"><math><semantics DEFINITIONurl="www.example.org/FOO"><mi>a</mi><annotation-xml><foo/><bar/></annotation-xml></semantics></math></div>
|
||||
<div><math id="m3span-mtext"><mtext><Span>x</Span></mtext></math></div>
|
||||
<div><math id="m3span-mi"><mi><Span>x</Span></mi></math></div>
|
||||
<div><math id="m3span-mrow"><mi><Span>x</Span></mrow></math></div>
|
||||
<div><math id="m3p-mtext"><mtext><P>x</P></mtext></math></div>
|
||||
<div><math id="m3p-mi"><mi><P>x</P></mi></math></div>
|
||||
<div id="d3p-mrow"><math><mrow><P>x</P><mi>y</mi></mrow></math></div>
|
||||
<div><math id="m4"><mtext><Undefinedelement>x</Undefinedelement></mtext></math></div>
|
||||
<div><math id="m5"><mtext><mi>x</mi></mtext></math></div>
|
||||
<div><math><semantics><mi>x</mi>
|
||||
<annotation-xml><p id="p6default">x</p></annotation-xml>
|
||||
</semantics></math></div>
|
||||
<div><math><semantics><mi>x</mi>
|
||||
<annotation-xml encoding=text/html><p id="p6texthtml">x</p></annotation-xml>
|
||||
</semantics></math></div>
|
||||
<div><math><semantics><mi>x</mi>
|
||||
<annotation-xml encoding=TEXT/HTML><p id="p6uctexthtml">x</p></annotation-xml>
|
||||
</semantics></math></div>
|
||||
<div><math><semantics><mi>x</mi>
|
||||
<annotation-xml encoding=application/xhtml+xml><p id="p6applicationxhtmlxml">x</p></annotation-xml>
|
||||
</semantics></math></div>
|
||||
<div><math><semantics><mi>x</mi>
|
||||
<annotation-xml encoding=foo><p id="p6foo">x</p></annotation-xml>
|
||||
</semantics></math></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m1"),document.getElementsByTagName("math")[0]);
|
||||
},"MATH element name should be lowercased");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d1").firstChild.firstChild.nodeName,"mi");
|
||||
assert_equals(document.getElementById("d1").firstChild.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML");
|
||||
assert_true(document.getElementById("d1").firstChild.firstChild.hasAttribute("mathvariant"));
|
||||
assert_equals(document.getElementById("d1").firstChild.firstChild.getAttribute("mathvariant"),"BOLD")
|
||||
},"MI element name and mathvariant attribute name should be lowercased, attribute value unchanged");
|
||||
|
||||
test(function() {
|
||||
assert_true(document.getElementById("d2").firstChild.firstChild.hasAttribute("definitionURL"));
|
||||
assert_equals(document.getElementById("d2").firstChild.firstChild.getAttribute("definitionURL"),"www.example.org/FOO")
|
||||
},"DEFINITIONurl attribute markup should produce a definitionURL attribute, attribute value unchanged");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m3span-mtext").firstChild.firstChild.nodeName,"SPAN");
|
||||
assert_equals(document.getElementById("m3span-mtext").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
|
||||
},"html Span in mtext produces SPAN nodename in XHTML namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m3span-mi").firstChild.firstChild.nodeName,"SPAN");
|
||||
assert_equals(document.getElementById("m3span-mi").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
|
||||
},"html Span in mi produces SPAN nodename in XHTML namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m3span-mrow").firstChild.firstChild.nodeName,"SPAN");
|
||||
assert_equals(document.getElementById("m3span-mrow").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
|
||||
},"html Span in mrow produces SPAN nodename in XHTML namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m3p-mtext").firstChild.firstChild.nodeName,"P");
|
||||
assert_equals(document.getElementById("m3p-mtext").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
|
||||
},"html P in mtext produces P nodename in XHTML namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m3p-mi").firstChild.firstChild.nodeName,"P");
|
||||
assert_equals(document.getElementById("m3p-mi").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
|
||||
},"html P in mi produces P nodename in XHTML namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d3p-mrow").childNodes.length ,3)
|
||||
},"html P in mrow terminates the math: mrow,P,MI children of div");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d3p-mrow").firstChild.childNodes.length ,1)
|
||||
},"html P in mrow terminates the math: mrow child of math");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d3p-mrow").firstChild.firstChild.childNodes.length ,0)
|
||||
},"html P in mrow terminates the math: mrow empty");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("d3p-mrow").childNodes[0].nodeName,"math");
|
||||
assert_equals(document.getElementById("d3p-mrow").childNodes[1].nodeName,"P");
|
||||
assert_equals(document.getElementById("d3p-mrow").childNodes[2].nodeName,"MI");
|
||||
},"html P in mrow terminates the math: math,P,MI children of div");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m4").firstChild.firstChild.nodeName,"UNDEFINEDELEMENT");
|
||||
assert_equals(document.getElementById("m4").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
|
||||
},"Undefinedelement in mtext produces UNDEFINEDELEMENT nodename in XHTML namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("m5").firstChild.firstChild.nodeName,"MI");
|
||||
assert_equals(document.getElementById("m5").firstChild.firstChild.namespaceURI,"http://www.w3.org/1999/xhtml")
|
||||
},"mi in mtext produces MI nodename in XHTML namespace");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("p6default").parentNode.nodeName,"DIV")
|
||||
},"p in annotation-xml moves to be child of DIV");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("p6texthtml").parentNode.nodeName,"annotation-xml")
|
||||
},"p in annotation-xml encoding=text/html stays as child of annotation-xml");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("p6uctexthtml").parentNode.nodeName,"annotation-xml")
|
||||
},"p in annotation-xml encoding=TEXT/HTML stays as child of annotation-xml");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("p6applicationxhtmlxml").parentNode.nodeName,"annotation-xml")
|
||||
},"p in annotation-xml encoding=application/xhtml+xml stays as child of annotation-xml");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("p6foo").parentNode.nodeName,"DIV")
|
||||
},"p in annotation-xml encoding=foo moves to be child of DIV");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Tests for known named character references</title>
|
||||
<meta name=viewport content="width=device-width">
|
||||
<!-- Alternative output: http://mathias.html5.org/tests/html/named-character-references/ -->
|
||||
<div id=log></div>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=named-character-references-data.js></script>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
function pad(string, totalCharacters) {
|
||||
return totalCharacters < string.length ? string : (Array(totalCharacters + 1).join('0') + string).slice(-totalCharacters);
|
||||
}
|
||||
|
||||
var dummy = document.createElement('p');
|
||||
|
||||
Object.keys(data).forEach(function(entity) {
|
||||
var object = data[entity];
|
||||
dummy.innerHTML = entity;
|
||||
test(
|
||||
function() {
|
||||
assert_equals(
|
||||
dummy.textContent,
|
||||
object.characters
|
||||
);
|
||||
},
|
||||
entity + ' should match ' + object.codepoints.map(function(codePoint) {
|
||||
return 'U+' + pad(codePoint.toString(16).toUpperCase(), 5);
|
||||
}).join(' ')
|
||||
);
|
||||
});
|
||||
|
||||
}());
|
||||
</script>
|
214
tests/wpt/web-platform-tests/html/syntax/parsing/template.js
Normal file
214
tests/wpt/web-platform-tests/html/syntax/parsing/template.js
Normal file
|
@ -0,0 +1,214 @@
|
|||
/*
|
||||
* Template code
|
||||
*
|
||||
* A template is just a javascript structure. An element is represented as:
|
||||
*
|
||||
* [tag_name, {attr_name:attr_value}, child1, child2]
|
||||
*
|
||||
* the children can either be strings (which act like text nodes), other templates or
|
||||
* functions (see below)
|
||||
*
|
||||
* A text node is represented as
|
||||
*
|
||||
* ["{text}", value]
|
||||
*
|
||||
* String values have a simple substitution syntax; ${foo} represents a variable foo.
|
||||
*
|
||||
* It is possible to embed logic in templates by using a function in a place where a
|
||||
* node would usually go. The function must either return part of a template or null.
|
||||
*
|
||||
* In cases where a set of nodes are required as output rather than a single node
|
||||
* with children it is possible to just use a list
|
||||
* [node1, node2, node3]
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* render(template, substitutions) - take a template and an object mapping
|
||||
* variable names to parameters and return either a DOM node or a list of DOM nodes
|
||||
*
|
||||
* substitute(template, substitutions) - take a template and variable mapping object,
|
||||
* make the variable substitutions and return the substituted template
|
||||
*
|
||||
*/
|
||||
|
||||
function is_single_node(template)
|
||||
{
|
||||
return typeof template[0] === "string";
|
||||
}
|
||||
|
||||
function substitute(template, substitutions)
|
||||
{
|
||||
if (typeof template === "function") {
|
||||
var replacement = template(substitutions);
|
||||
if (replacement)
|
||||
{
|
||||
var rv = substitute(replacement, substitutions);
|
||||
return rv;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (is_single_node(template))
|
||||
{
|
||||
return substitute_single(template, substitutions);
|
||||
}
|
||||
else
|
||||
{
|
||||
return filter(map(template, function(x) {
|
||||
return substitute(x, substitutions);
|
||||
}), function(x) {return x !== null;});
|
||||
}
|
||||
}
|
||||
expose(substitute, "template.substitute");
|
||||
|
||||
function substitute_single(template, substitutions)
|
||||
{
|
||||
var substitution_re = /\${([^ }]*)}/g;
|
||||
|
||||
function do_substitution(input) {
|
||||
var components = input.split(substitution_re);
|
||||
var rv = [];
|
||||
for (var i=0; i<components.length; i+=2)
|
||||
{
|
||||
rv.push(components[i]);
|
||||
if (components[i+1])
|
||||
{
|
||||
rv.push(substitutions[components[i+1]]);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
var rv = [];
|
||||
rv.push(do_substitution(String(template[0])).join(""));
|
||||
|
||||
if (template[0] === "{text}") {
|
||||
substitute_children(template.slice(1), rv);
|
||||
} else {
|
||||
substitute_attrs(template[1], rv);
|
||||
substitute_children(template.slice(2), rv);
|
||||
}
|
||||
|
||||
function substitute_attrs(attrs, rv)
|
||||
{
|
||||
rv[1] = {};
|
||||
for (name in template[1])
|
||||
{
|
||||
if (attrs.hasOwnProperty(name))
|
||||
{
|
||||
var new_name = do_substitution(name).join("");
|
||||
var new_value = do_substitution(attrs[name]).join("");
|
||||
rv[1][new_name] = new_value;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function substitute_children(children, rv)
|
||||
{
|
||||
for (var i=0; i<children.length; i++)
|
||||
{
|
||||
if (children[i] instanceof Object) {
|
||||
var replacement = substitute(children[i], substitutions);
|
||||
if (replacement !== null)
|
||||
{
|
||||
if (is_single_node(replacement))
|
||||
{
|
||||
rv.push(replacement);
|
||||
}
|
||||
else
|
||||
{
|
||||
extend(rv, replacement);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
extend(rv, do_substitution(String(children[i])));
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
function make_dom_single(template)
|
||||
{
|
||||
if (template[0] === "{text}")
|
||||
{
|
||||
var element = document.createTextNode("");
|
||||
for (var i=1; i<template.length; i++)
|
||||
{
|
||||
element.data += template[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var element = document.createElement(template[0]);
|
||||
for (name in template[1]) {
|
||||
if (template[1].hasOwnProperty(name))
|
||||
{
|
||||
element.setAttribute(name, template[1][name]);
|
||||
}
|
||||
}
|
||||
for (var i=2; i<template.length; i++)
|
||||
{
|
||||
if (template[i] instanceof Object)
|
||||
{
|
||||
var sub_element = make_dom(template[i]);
|
||||
element.appendChild(sub_element);
|
||||
}
|
||||
else
|
||||
{
|
||||
var text_node = document.createTextNode(template[i]);
|
||||
element.appendChild(text_node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function make_dom(template, substitutions)
|
||||
{
|
||||
if (is_single_node(template))
|
||||
{
|
||||
return make_dom_single(template);
|
||||
}
|
||||
else
|
||||
{
|
||||
return map(template, function(x) {
|
||||
return make_dom_single(x);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function render(template, substitutions)
|
||||
{
|
||||
return make_dom(substitute(template, substitutions));
|
||||
}
|
||||
expose(render, "template.render");
|
||||
|
||||
function expose(object, name)
|
||||
{
|
||||
var components = name.split(".");
|
||||
var target = window;
|
||||
for (var i=0; i<components.length - 1; i++)
|
||||
{
|
||||
if (!(components[i] in target))
|
||||
{
|
||||
target[components[i]] = {};
|
||||
}
|
||||
target = target[components[i]];
|
||||
}
|
||||
target[components[components.length - 1]] = object;
|
||||
}
|
||||
|
||||
function extend(array, items)
|
||||
{
|
||||
Array.prototype.push.apply(array, items);
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: Template is a foster parent element</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="The last template element with either no table element is below it, or a table element immediately below it, in the stack of open elements is the foster parent element (NOT the template's parent!)">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#foster-parent-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '' +
|
||||
'<div id="tmplParent">' +
|
||||
'<template id="tmpl1">' +
|
||||
'<table id="tbl">' +
|
||||
'<tr><td>Cell 1</td></tr>' +
|
||||
// Misplaced <div>. It should be foster parented
|
||||
'<div id="orphanDiv">Orphan div content</div>' +
|
||||
'<tr><td>Cell 2</td></tr>' +
|
||||
'</table>' +
|
||||
'</template>' +
|
||||
'</div>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
var div = template.content.querySelector('#orphanDiv');
|
||||
|
||||
assert_equals(div.parentNode, template.content, 'Wrong foster parent element');
|
||||
|
||||
}, 'Template is a foster parent element. Test <table> immediately below <template>');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '' +
|
||||
'<div id="tmplParent">' +
|
||||
'<template id="tmpl1">' +
|
||||
'<tr><td>Cell 1</td></tr>' +
|
||||
// Misplaced <div>. It should be foster parented
|
||||
'<div id="orphanDiv">Orphan div content</div>' +
|
||||
'<tr><td>Cell 2</td></tr>' +
|
||||
'</template>' +
|
||||
'</div>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
var div = template.content.querySelector('#orphanDiv');
|
||||
|
||||
assert_equals(div.parentNode, template.content, 'Wrong foster parent element');
|
||||
|
||||
}, 'Template is a foster parent element. Test <template> element without <table>');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: Template is not a foster parent element</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="When template element shouldn't be a foster parent then regular rules of foster parenting should be applied">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#foster-parent-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '' +
|
||||
'<div id="tmplParent">' +
|
||||
'<template id="tmpl1">' +
|
||||
'<div id="fosterParent">' +
|
||||
'<table id="tbl">' +
|
||||
'<tr><td>Cell 1</td></tr>' +
|
||||
// Misplaced <div>. It should be foster parented
|
||||
'<div id="orphanDiv">Orphan div content</div>' +
|
||||
'<tr><td>Cell 2</td></tr>' +
|
||||
'</table>' +
|
||||
'</div>' +
|
||||
'</template>' +
|
||||
'</div>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
var fosterParent = template.content.querySelector('#fosterParent');
|
||||
var div = template.content.querySelector('#orphanDiv');
|
||||
|
||||
assert_equals(div.parentNode, fosterParent, 'Wrong foster parent element');
|
||||
|
||||
}, 'Template is not a foster parent element. '
|
||||
+ 'Test the case when <template> is higher in stack of open elements');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '' +
|
||||
'<div id="fosterParent">' +
|
||||
'<table id="tbl">' +
|
||||
'<tr><td><template id="tmpl1">Template content</template></td></tr>' +
|
||||
// Misplaced <div>. It should be foster parented
|
||||
'<div id="orphanDiv">Orphan div content</div>' +
|
||||
'<tr><td>Cell 2</td></tr>' +
|
||||
'</table>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
var t = doc.querySelector('#tmpl1');
|
||||
var fosterParent = doc.querySelector('#fosterParent');
|
||||
var div = doc.querySelector('#orphanDiv');
|
||||
|
||||
assert_equals(div.parentNode, fosterParent, 'Wrong foster parent element');
|
||||
|
||||
}, 'Template is not a foster parent element. '
|
||||
+ 'Test the case when <template> is lower in stack of open elements');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,137 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: 'In body' insertion mode: when template end tag is met, implied end tags should be generated</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
|
||||
<meta name="assert" content="'In body' insertion mode: when template end tag is met, implied end tags should be generated">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
//No end </td></tr></table> tags. Should be added implicitly
|
||||
doc.body.innerHTML = '<template id="tpl">'
|
||||
+ '<table id="tbl"><tr id="tr"><td id="td"></template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(doc.querySelector('#tbl'), null, 'Table element should not be available');
|
||||
assert_equals(doc.querySelector('#tr'), null, 'TR element should not be available');
|
||||
assert_equals(doc.querySelector('#td'), null, 'TD element should not be available');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#tbl'), null,
|
||||
'Template should contain table element');
|
||||
assert_not_equals(template.content.querySelector('#tr'), null,
|
||||
'Template should contain TR element');
|
||||
assert_not_equals(template.content.querySelector('#td'), null,
|
||||
'Template should contain TD element');
|
||||
|
||||
}, 'Generating of implied end tags. Test table elements');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
//No end </div> tag. Should be added implicitly
|
||||
doc.body.innerHTML = '<template id="tpl"><div id="dv">Div content</template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#dv'), null,
|
||||
'Template should contain DIV element');
|
||||
|
||||
}, 'Generating of implied end tags. Test div element');
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
//No end </div> tag. Should be added implicitly after text content
|
||||
doc.body.innerHTML = '<template id="tpl">Template text<div id="dv">Div content</template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
|
||||
|
||||
var div = template.content.querySelector('#dv');
|
||||
|
||||
assert_not_equals( div, null, 'Template should contain DIV element');
|
||||
assert_equals(div.innerText, 'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test some text and DIV element');
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
// Wrong end tag. Correct end tag must be added implicitly, wrong one ignored
|
||||
doc.body.innerHTML = '<template id="tpl"><div id="dv">Div content</span></template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Wrong number of template\'s children');
|
||||
|
||||
assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#dv'), null,
|
||||
'Template should contain DIV element');
|
||||
assert_equals(template.content.querySelector('#dv').innerText,
|
||||
'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test wrong end tag');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-table-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_not_equals(template.content.querySelector('table'), null,
|
||||
'Template should contain table element');
|
||||
assert_not_equals(template.content.querySelector('tr'), null,
|
||||
'Template should contain TR element');
|
||||
assert_not_equals(template.content.querySelector('td'), null,
|
||||
'Template should contain TD element');
|
||||
|
||||
}, 'Generating of implied end tags. Test table elements. Loading of HTML document from a file');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-div-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
var div = template.content.querySelector('div');
|
||||
assert_not_equals(div, null, 'Template should contain div element');
|
||||
assert_equals(div.innerText, 'Hello, template\n ', 'Invalid div contents');
|
||||
|
||||
}, 'Generating of implied end tags. Test div element. Loading of HTML document from a file');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,133 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: In body insertion mode: parser should ignore BODY token</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="assert" content="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
/*
|
||||
* According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
|
||||
* when parser is in "template content" mode and meets <body> tag it should be switched to
|
||||
* "in body" insertion mode.
|
||||
* According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition
|
||||
* this token (BODY) should be ignored
|
||||
*/
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<body></body>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain BODY element');
|
||||
|
||||
}, 'Ignore BODY token. Test empty BODY element assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<body><div>Some content</div></body>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Wrong number of template content children');
|
||||
assert_equals(template.content.firstChild.nodeName, 'DIV',
|
||||
'Template should contain children of ignored BODY element');
|
||||
|
||||
}, 'Ignore BODY token. Test not empty BODY element assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<body><div <div id="div1">Some content</div></body><div id="div2">Some valid content</div>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Wrong number of template content children');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain children of the ignored BODY element');
|
||||
assert_not_equals(template.content.querySelector('#div2'), null,
|
||||
'Template should contain valid element');
|
||||
|
||||
}, 'Ignore BODY token. '
|
||||
+ 'Test BODY element and some valid element after BODY tag assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<div id="div1">Some valid content</div><body><div id="div2">Some content</div></body>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Template cannot contain BODY element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
assert_not_equals(template.content.querySelector('#div2'), null,
|
||||
'Template should contain children of the ignored BODY element');
|
||||
|
||||
}, 'Ignore BODY token. '
|
||||
+ 'Test BODY element and some valid element before BODY tag assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<template id="t2"><body><span>Body!<span></body></template>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template should contain nested template');
|
||||
assert_not_equals(template.content.querySelector('#t2'), null,
|
||||
'Template should contain nested element');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('#t2');
|
||||
|
||||
assert_equals(nestedTemplate.content.childNodes.length, 1,
|
||||
'Template cannot contain BODY element');
|
||||
assert_equals(nestedTemplate.content.firstChild.nodeName, 'SPAN',
|
||||
'Template cannot contain BODY element');
|
||||
|
||||
}, 'Ignore BODY token. '
|
||||
+ 'Test template with not empty BODY element inside assigned to another '
|
||||
+ 'template\'s innerHTML');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-body.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain BODY element');
|
||||
|
||||
}, 'Ignore BODY token. '
|
||||
+ 'Test loading a HTML file with BODY tag inside template');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,126 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: In body insertion mode: parser should ignore FRAMESET token</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="assert" content="If parser is in 'in body' insertion mode and meets HTML token it should be ignored">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
/*
|
||||
* According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
|
||||
* when parser is in "template content" mode and meets <frameset> tag it should be switched to
|
||||
* "in body" insertion mode.
|
||||
* According to https://html.spec.whatwg.org/multipage/#parsing-main-inbody
|
||||
* this token (FRAMESET) should be ignored
|
||||
*/
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<frameset cols="25%,*,25%">'
|
||||
+ '<frame src="frame_a.htm">'
|
||||
+ '<frame src="frame_b.htm">' + '<frame src="frame_c.htm">'
|
||||
+ '</frameset>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain FRAMESET element');
|
||||
|
||||
}, 'Ignore frameset token. Test FRAMESET element assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<div id="div1">Some text</div>'
|
||||
+ '<frameset cols="25%,*,25%">'
|
||||
+ '<frame src="frame_a.htm">'
|
||||
+ '<frame src="frame_b.htm">'
|
||||
+ '<frame src="frame_c.htm">'
|
||||
+ '</frameset>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template cannot contain FRAMESET element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
|
||||
}, 'Ignore frameset token. '
|
||||
+ 'Test FRAMESET element and some valid element before it, assigned '
|
||||
+ 'to the template\'s innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<frameset cols="25%,*,25%">'
|
||||
+ '<frame src="frame_a.htm">'
|
||||
+ '<frame src="frame_b.htm">'
|
||||
+ '<frame src="frame_c.htm">'
|
||||
+ '</frameset><div id="div1">Some text</div>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template cannot contain FRAMESET element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
|
||||
}, 'Ignore frameset token. '
|
||||
+ 'Test FRAMESET element and some valid element after it, assigned '
|
||||
+ 'to the template\'s innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<template id="t2">'
|
||||
+ '<frameset cols="25%,*,25%">'
|
||||
+ '<frame src="frame_a.htm">'
|
||||
+ '<frame src="frame_b.htm">'
|
||||
+ '<frame src="frame_c.htm">'
|
||||
+ '</frameset></template>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template should contain nested template');
|
||||
assert_not_equals(template.content.querySelector('#t2'), null,
|
||||
'Template should contain nested element');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('#t2');
|
||||
|
||||
assert_equals(nestedTemplate.content.childNodes.length, 0,
|
||||
'Template cannot contain FRAMESET element');
|
||||
|
||||
}, 'Ignore frameset token. '
|
||||
+ 'Test FRAMESET tag inside template tag assigned to another template\'s innerHTML');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-frameset.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain FRAMESET element');
|
||||
}, 'Ignore frameset token. Test loading a HTML file with FRAMESET tag inside template');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,130 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: In body insertion mode: parser should ignore HEAD token</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="assert" content="If parser is in 'in body' insertion mode and meets HEAD token it should be ignored">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
/*
|
||||
* According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
|
||||
* when parser is in "template content" mode and meets <head> tag it should be switched to
|
||||
* "in body" insertion mode.
|
||||
* According to https://html.spec.whatwg.org/multipage/#parsing-main-inbody
|
||||
* this token (HEAD) should be ignored
|
||||
*/
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<head></head>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain HEAD element');
|
||||
|
||||
}, 'Ignore HEAD token. Test empty HEAD element assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<head><title>test</title></head>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Wrong number of template content children');
|
||||
assert_equals(template.content.firstChild.nodeName, 'TITLE',
|
||||
'Template should contain children of ignored HEAD element');
|
||||
|
||||
}, 'Ignore HEAD token. Test not empty HEAD element assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<div id="div1">Some text</div><head><title>test</title></head>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Wrong number of template content children');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
assert_equals(template.content.lastChild.tagName, 'TITLE',
|
||||
'Template should contain children of ignored HEAD element');
|
||||
|
||||
}, 'Ignore HEAD token. '
|
||||
+ 'Test HEAD element and some valid element before it, assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<head><title>test</title></head><div id="div1">Some text</div>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Wrong number of template content children');
|
||||
assert_equals(template.content.firstChild.tagName, 'TITLE',
|
||||
'Template should contain children of ignored HEAD element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
|
||||
}, 'Ignore HEAD token. '
|
||||
+ 'Test HEAD element and some valid element after it, assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<template id="t2"><head><title>test</title></head></template>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template should contain nested template');
|
||||
assert_not_equals(template.content.querySelector('#t2'), null,
|
||||
'Template should contain nested element');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('#t2');
|
||||
|
||||
assert_equals(nestedTemplate.content.childNodes.length, 1,
|
||||
'Wrong number of template content children');
|
||||
assert_equals(nestedTemplate.content.firstChild.tagName, 'TITLE',
|
||||
'Template should contain children of ignored HEAD element');
|
||||
|
||||
}, 'Ignore HEAD token. '
|
||||
+ 'Test HEAD tag inside template tag assigned to another template\'s innerHTML');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-head.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain HEAD element');
|
||||
|
||||
}, 'Ignore HEAD token. Test loading a HTML file with HEAD tag inside template');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,159 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: In body insertion mode: parser should ignore HTML token</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="assert" content="If parser is in 'in body' insertion mode and meets HTML token it should be ignored">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
/*
|
||||
* According to http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-contents-insertion-mode
|
||||
* when parser is in "template content" mode and meets <html> tag it should be switched to
|
||||
* "in body" insertion mode.
|
||||
* According to https://html.spec.whatwg.org/multipage/#parsing-main-inbody
|
||||
* this token (HTML) should be ignored
|
||||
*/
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<html><body></body></html>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain HTML element');
|
||||
|
||||
}, 'Ignore HTML token. Test HTML element assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<div id="div1">Some text</div><html><body></body></html>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template cannot contain HTML element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
|
||||
}, 'Ignore HTML token.'
|
||||
+ 'Test HTML element and some valid element before it, assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<html><body></body></html><div id="div1">Some text</div>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template cannot contain HTML element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
|
||||
}, 'Ignore HTML token. '
|
||||
+ 'Test HEAD element and some valid element after it, assigned to template innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<template id="t2"><html><body></body></html></template>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template should contain nested template');
|
||||
assert_not_equals(template.content.querySelector('#t2'), null,
|
||||
'Template should contain nested element');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('#t2');
|
||||
|
||||
assert_equals(nestedTemplate.content.childNodes.length, 0,
|
||||
'Template cannot contain HTML element');
|
||||
|
||||
}, 'Ignore HTML token. '
|
||||
+ 'Test HTML tag inside template tag assigned to another template\'s innerHTML');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<html><div id="div1">Some text</div></html>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template cannot contain HTML element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain a valid element');
|
||||
|
||||
}, 'Ignore HTML token. Test some valid element inside HTML element');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<html><body><div id="div1">Some text</div><body></html>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Template cannot contain HTML element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid element');
|
||||
|
||||
}, 'Ignore HTML token. Test valid element inside HTML and BODY elements');
|
||||
|
||||
|
||||
test(function() {
|
||||
var doc = newHTMLDocument();
|
||||
var template = doc.createElement('template');
|
||||
|
||||
template.innerHTML = '<html><span id="span1">Span</span><body><div id="div1">Some text</div><body></html>';
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Template cannot contain HTML element');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Template should contain valid DIV element');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#span1'), null,
|
||||
'Template should contain valid SPAN element');
|
||||
|
||||
}, 'Ignore HTML token. Test valid element inside and between HTML and BODY elements');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-html.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template cannot contain HTML element');
|
||||
|
||||
}, 'Ignore HTML token. Test loading a HTML file with HTML tag inside template');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,98 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: In body insertion mode: Template contains a start tag whose tag name is body</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="If the stack of open elements has a template element in html scope then ignore <body> the token. (fragment or template contents case)">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '<template id="tmpl"><body></template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl');
|
||||
|
||||
assert_equals(template.content.childNodes.length, 0, 'Element must be ignored');
|
||||
|
||||
}, 'In body insertion mode: Template contains a start tag whose tag name is body.'
|
||||
+ 'Test <body> tag only');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '<template id="tmpl"><body>Body text content</body></template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl');
|
||||
|
||||
assert_equals(template.content.querySelector('body'), null,
|
||||
'<body> element must be ignored');
|
||||
assert_equals(template.content.childNodes.length, 1, 'Text shouldn\'t be ignored');
|
||||
assert_equals(template.content.firstChild.nodeType, Node.TEXT_NODE,
|
||||
'Text shouldn\'t be ignored');
|
||||
|
||||
}, 'In body insertion mode: Template contains a start tag whose tag name is body. '
|
||||
+ 'Test <body> tag containing some text');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '<template id="tmpl"><body>'
|
||||
+ '<div id="div1">DIV 1</div>'
|
||||
+ '<div id="div2">DIV 2</div>'
|
||||
+ '</body></template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl');
|
||||
|
||||
assert_equals(template.content.querySelector('body'), null,
|
||||
'<body> element must be ignored');
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Only body tag should be ignored');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Children of <body tag shouldn\'t be ignored');
|
||||
assert_not_equals(template.content.querySelector('#div2'), null,
|
||||
'Children of <body tag shouldn\'t be ignored');
|
||||
|
||||
}, 'In body insertion mode: Template contains a start tag whose tag name is body. '
|
||||
+ 'Test <body> tag containing some other elements');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '<template id="tmpl1"><template id="tmpl2"><body>'
|
||||
+ '<div id="div1">DIV 1</div>'
|
||||
+ '<div id="div2">DIV 2</div>'
|
||||
+ '</body></template></template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1').content.querySelector('#tmpl2');
|
||||
|
||||
assert_equals(template.content.querySelector('body'), null,
|
||||
'<body> element must be ignored');
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Only body tag should be ignored');
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Children of <body tag shouldn\'t be ignored');
|
||||
assert_not_equals(template.content.querySelector('#div2'), null,
|
||||
'Children of <body tag shouldn\'t be ignored');
|
||||
|
||||
}, 'In body insertion mode: Template contains a start tag whose tag name is body. '
|
||||
+ 'Test nested template tag containing <body> tag with some other elements');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: In body insertion mode: A start tag whose tag name is html</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="If HTML parser is in 'in body' insertion mode and meets HTML start tag, then for each attribute on the token, check to see if the attribute is already present on the top element of the stack of open elements. If it is not, add the attribute and its corresponding value to that element">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
// test <template><html class="htmlClass"></html></template><html id="htmlId" tabindex="5">
|
||||
// id attribute should be added to root <html> element
|
||||
// tabindex attribute should not be modified
|
||||
//class attribute should be ignored
|
||||
testInIFrame('../../resources/html-start-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
||||
var html = doc.documentElement;
|
||||
|
||||
assert_equals(html.getAttribute('tabindex'), '5', 'Attribute should be accessible');
|
||||
assert_equals(html.getAttribute('id'), 'htmlId',
|
||||
'Attribute \'id\' should be added and accessible');
|
||||
assert_false(html.hasAttribute('class'), 'Attribute \'class\' should be ignored');
|
||||
assert_equals(template.content.childNodes.length, 0, 'Template should not contain HTML element');
|
||||
|
||||
|
||||
}, 'In body insertion mode: html start tag should add only absent attributes');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,103 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: 'In body' insertion mode: Template end tag without start one. Element should be ignored</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
|
||||
<meta name="assert" content="If parser in 'in body' insertion mode meets template end tag and if the stack of open elements has no template element in html scope, then this is a parse error; ignore the token">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '</template>';
|
||||
|
||||
assert_equals(doc.body.childNodes.length, 0, 'Element must be ignored');
|
||||
|
||||
}, '</template> tag in HTML body without start one should be ignored');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '<template id="tmpl"></template></template>';
|
||||
|
||||
assert_equals(doc.body.childNodes.length, 1, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Element should present it document body');
|
||||
|
||||
}, '</template> tag in HTML body without start one should be ignored. '
|
||||
+ 'Test valid <template> element and </template> tag after it');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '</template><template id="tmpl"></template>';
|
||||
|
||||
assert_equals(doc.body.childNodes.length, 1, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Element should present it document body');
|
||||
|
||||
}, '</template> tag in HTML body without start one should be ignored. '
|
||||
+ 'Test valid <template> element and </template> tag before it');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '</template><template id="tmpl"></template><title></title>';
|
||||
|
||||
assert_equals(doc.body.childNodes.length, 2, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Valid element should present it document body');
|
||||
assert_not_equals(doc.querySelector('title'), null,
|
||||
'Valid title element should present it document body');
|
||||
|
||||
}, '</template> tag in HTML body without start one should be ignored. '
|
||||
+ 'Test valid <template> element, <title> element and </template> tag before them');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '<template id="tmpl"></template><title></title></template>';
|
||||
|
||||
assert_equals(doc.body.childNodes.length, 2, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Valid element should present it document body');
|
||||
assert_not_equals(doc.querySelector('title'), null,
|
||||
'Valid title element should present it document body');
|
||||
|
||||
}, '</template> tag in HTML body without start one should be ignored. '
|
||||
+ 'Test valid <template> element, <title> element and </template> tag after them');
|
||||
|
||||
|
||||
testInIFrame('../../resources/end-template-tag-in-body.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
assert_equals(doc.body.querySelector('template'), null,
|
||||
'</template> must be ignored');
|
||||
assert_not_equals(doc.body.querySelector('div'), null,
|
||||
'Valid element should present it document body');
|
||||
|
||||
}, '</template> tag in HTML body without start one should be ignored. '
|
||||
+ 'Test HTML document loaded from file');
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: additions to 'in frameset' insertion mode</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="If parser is in 'in frameset' insertion mode and meets frameset end tag then if the stack of open elements has a template element in html scope then this is a parse error; ignore the token">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
testInIFrame('../../resources/frameset-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var frameset = doc.querySelector('frameset');
|
||||
assert_equals(frameset.children.length, 1, 'Wrong number of frameset children elements');
|
||||
|
||||
var template = frameset.querySelector('template');
|
||||
assert_equals(template.tagName, 'TEMPLATE', 'FRAMESET should contain template element');
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Template content should be empty');
|
||||
|
||||
}, '</frameset> tag should be ignored if there\'s TEMPLATE element in '
|
||||
+ 'the stack of open elements');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,138 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: When template end tag is met, implied end tags should be generated</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
|
||||
<meta name="assert" content="When template end tag is met, implied end tags should be generated">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
//No end </td></tr></table> tags. Should be added implicitly
|
||||
doc.head.innerHTML = '<template id="tpl">'
|
||||
+ '<table id="tbl"><tr id="tr"><td id="td"></template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(doc.querySelector('#tbl'), null, 'Table element should not be available');
|
||||
assert_equals(doc.querySelector('#tr'), null, 'TR element should not be available');
|
||||
assert_equals(doc.querySelector('#td'), null, 'TD element should not be available');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#tbl'), null,
|
||||
'Template should contain table element');
|
||||
assert_not_equals(template.content.querySelector('#tr'), null,
|
||||
'Template should contain TR element');
|
||||
assert_not_equals(template.content.querySelector('#td'), null,
|
||||
'Template should contain TD element');
|
||||
|
||||
}, 'Generating of implied end tags. Test table elements');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
//No end </div> tag. Should be added implicitly
|
||||
doc.head.innerHTML = '<template id="tpl"><div id="dv">Div content</template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#dv'), null,
|
||||
'Template should contain DIV element');
|
||||
|
||||
}, 'Generating of implied end tags. Test DIV element');
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
//No end </div> tag. Should be added implicitly after text content
|
||||
doc.head.innerHTML = '<template id="tpl">Template text<div id="dv">Div content</template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
|
||||
|
||||
var div = template.content.querySelector('#dv');
|
||||
|
||||
assert_not_equals( div, null, 'Template should contain DIV element');
|
||||
assert_equals(div.innerText, 'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test some text and DIV element');
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
// Wrong end tag. Correct end tag must be added implicitly, wrong one ignored
|
||||
doc.head.innerHTML = '<template id="tpl"><div id="dv">Div content</span></template>';
|
||||
|
||||
var template = doc.querySelector('#tpl');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
assert_equals(template.content.childNodes.length, 1,
|
||||
'Wrong number of template\'s children');
|
||||
|
||||
assert_equals(doc.querySelector('#dv'), null, 'DIV element should not be available');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#dv'), null,
|
||||
'Template should contain DIV element');
|
||||
assert_equals(template.content.querySelector('#dv').innerText,
|
||||
'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test wrong end tag');
|
||||
|
||||
|
||||
testInIFrame('../../resources/head-template-contents-table-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.head.querySelector('template');
|
||||
|
||||
assert_not_equals(template, null,
|
||||
'Template element must be parsed');
|
||||
|
||||
assert_not_equals(template.content.querySelector('table'), null,
|
||||
'Template should contain table element');
|
||||
assert_not_equals(template.content.querySelector('tr'), null,
|
||||
'Template should contain TR element');
|
||||
assert_not_equals(template.content.querySelector('td'), null,
|
||||
'Template should contain TD element');
|
||||
|
||||
}, 'Generating of implied end tags. Test table elements. Load HTML document from file');
|
||||
|
||||
|
||||
testInIFrame('../../resources/head-template-contents-div-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.head.querySelector('template');
|
||||
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
|
||||
var div = template.content.querySelector('div');
|
||||
assert_not_equals(div, null, 'Template should contain div element');
|
||||
assert_equals(div.innerText, 'Hello, template\n ', 'Invalid div contents');
|
||||
|
||||
}, 'Generating of implied end tags. Test div element. Load HTML document from file');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,102 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: Template end tag without start one. Element should be ignored</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
|
||||
<meta name="assert" content="If parser in 'in head' insertion mode meets template end tag and if the stack of open elements has no template element in html scope, then this is a parse error; ignore the token">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.head.innerHTML = '</template>';
|
||||
|
||||
assert_equals(doc.head.childNodes.length, 0, 'Element must be ignored');
|
||||
|
||||
}, '</template> tag in HTML head without start one should be ignored');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.head.innerHTML = '<template id="tmpl"></template></template>';
|
||||
|
||||
assert_equals(doc.head.childNodes.length, 1, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Element should present it document head');
|
||||
|
||||
}, '</template> tag in HTML head without start one should be ignored. '
|
||||
+ 'Test valid <template> element and </template> tag after it');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.head.innerHTML = '</template><template id="tmpl"></template>';
|
||||
|
||||
assert_equals(doc.head.childNodes.length, 1, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Element should present it document head');
|
||||
|
||||
}, '</template> tag in HTML head without start one should be ignored. '
|
||||
+ 'Test valid <template> element and </template> tag before it');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.head.innerHTML = '</template><template id="tmpl"></template><title></title>';
|
||||
|
||||
assert_equals(doc.head.childNodes.length, 2, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Valid element should present it document head');
|
||||
assert_not_equals(doc.querySelector('title'), null,
|
||||
'Valid title element should present it document head');
|
||||
|
||||
}, '</template> tag in HTML head without start one should be ignored. '
|
||||
+ 'Test valid <template> element, <title> element and </template> tag before them');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.head.innerHTML = '<template id="tmpl"></template><title></title></template>';
|
||||
|
||||
assert_equals(doc.head.childNodes.length, 2, 'Element must be ignored');
|
||||
assert_not_equals(doc.querySelector('#tmpl'), null,
|
||||
'Valid element should present it document head');
|
||||
assert_not_equals(doc.querySelector('title'), null,
|
||||
'Valid title element should present it document head');
|
||||
|
||||
}, '</template> tag in HTML head without start one should be ignored. '
|
||||
+ 'Test valid <template> element, <title> element and </template> tag after them');
|
||||
|
||||
|
||||
testInIFrame('../../resources/end-template-tag-in-head.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
assert_equals(doc.head.querySelector('template'), null, '</template> must be ignored');
|
||||
assert_not_equals(doc.head.querySelector('title'), null,
|
||||
'Valid element should present it document head');
|
||||
|
||||
}, '</template> tag in HTML head without start one should be ignored. '
|
||||
+ 'Test HTML document loaded from file');
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: 'In table' insertion mode: ignore TABLE end tag</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="If parser is in 'in table' insertion mode and end tag table is met the ignore this token">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-table-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.body.innerHTML = '<table id="table">'
|
||||
+ '<template id="template">'
|
||||
+ '</table>'
|
||||
+ '</template>'
|
||||
+ '<tr><td></td></tr>'
|
||||
+ '</table>';
|
||||
|
||||
var table = doc.querySelector('#table');
|
||||
var template = table.querySelector('#template');
|
||||
|
||||
assert_equals(table.childNodes.length, 2, 'Wrong number of table children');
|
||||
assert_not_equals(template, null, 'Template element must be parsed');
|
||||
assert_equals(table.rows.length, 1, 'Wrong number of table rows');
|
||||
assert_equals(template.childNodes.length, 0, 'Wrong number of the template child nodes');
|
||||
assert_equals(template.content.childNodes.length, 0,
|
||||
'Wrong number of the template child nodes');
|
||||
|
||||
|
||||
}, 'In table insertion mode. Ignore </table> token');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,117 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: HTML parser appends child nodes only to the template contents node</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="assert" content="HTML parser must append template's child nodes only to the template contents node.">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#appending-to-a-template">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
doc.body.innerHTML = '<template id="tmpl1">' +
|
||||
'<div id="div1">This is div inside template</div>' +
|
||||
'<div id="div2">This is another div inside template</div>' +
|
||||
'</template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
assert_equals(template.childNodes.length, 0, 'Wrong number of template child nodes');
|
||||
assert_equals(template.content.childNodes.length, 2,
|
||||
'Wrong number of template content child nodes');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Element is absent in the template content');
|
||||
assert_not_equals(template.content.querySelector('#div2'), null,
|
||||
'Element is absent in the template content');
|
||||
|
||||
}, 'Template child nodes must be appended to template content node');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
doc.body.innerHTML = '<template id="tmpl1">' +
|
||||
'<div id="div1">This is div inside template</div>' +
|
||||
'<div id="div2">This is another div inside template</div>' +
|
||||
'<template id="tmpl2">' +
|
||||
'<div id="div3">This is div inside nested template</div>' +
|
||||
'<div id="div4">This is another div inside nested template</div>' +
|
||||
'</template>' +
|
||||
'</template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
assert_equals(template.childNodes.length, 0,
|
||||
'Wrong number of template child nodes');
|
||||
assert_equals(template.content.childNodes.length, 3,
|
||||
'Wrong number of template content child nodes');
|
||||
|
||||
assert_not_equals(template.content.querySelector('#div1'), null,
|
||||
'Element is absent in the template content');
|
||||
assert_not_equals(template.content.querySelector('#div2'), null,
|
||||
'Element is absent in the template content');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('#tmpl2');
|
||||
|
||||
assert_equals(nestedTemplate.childNodes.length, 0,
|
||||
'Wrong number of template child nodes');
|
||||
assert_equals(nestedTemplate.content.childNodes.length, 2,
|
||||
'Wrong number of nested template content child nodes');
|
||||
|
||||
assert_not_equals(nestedTemplate.content.querySelector('#div3'), null,
|
||||
'Element is absent in the template content');
|
||||
assert_not_equals(nestedTemplate.content.querySelector('#div4'), null,
|
||||
'Element is absent in the template content');
|
||||
|
||||
}, 'Template child nodes must be appended to template content. Test nested template');
|
||||
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
||||
assert_equals(template.childNodes.length, 0, 'Wrong number of template child nodes');
|
||||
|
||||
assert_not_equals(template.content.querySelector('div'), null,
|
||||
'Element is absent in the template content');
|
||||
|
||||
}, 'Template child nodes must be appended to template content node. '
|
||||
+ 'Load HTML document from a file');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-nested.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
||||
assert_equals(template.childNodes.length, 0, 'Wrong number of template child nodes');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('template');
|
||||
|
||||
assert_not_equals(nestedTemplate, null,
|
||||
'Element is absent in the template content');
|
||||
|
||||
assert_equals(nestedTemplate.childNodes.length, 0,
|
||||
'Wrong number of template child nodes');
|
||||
|
||||
assert_not_equals(nestedTemplate.content.querySelector('div'), null,
|
||||
'Element is absent in the template content');
|
||||
|
||||
}, 'Template child nodes must be appended to nested template content node. '
|
||||
+ 'Load HTML document from a file');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,183 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: Clearing stack back to a table body context</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="Clearing the stack back to a table body context must be aborted if the current node is template">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doTest(doc, tagToTest, templateInnerHTML, id, tagName, bodiesNum, footerIsNull,
|
||||
footerId, headerIsNull, headerId) {
|
||||
|
||||
doc.body.innerHTML = '' +
|
||||
'<table id="tbl">' +
|
||||
'<' + tagToTest + '>' +
|
||||
'<template id="tmpl1">' +
|
||||
// When parser meets <tr>, </tbody>, </tfoot>, </thead>, <caption>, <col>,
|
||||
// <colgroup>, <tbody>, <tfoot>, <thead>, </table>
|
||||
// stack must be cleared back to table body context. But <template> tag should
|
||||
// abort this
|
||||
templateInnerHTML +
|
||||
'</template>' +
|
||||
'<tr id="tr">' +
|
||||
'<td id="td">' +
|
||||
'</td>' +
|
||||
'</tr>' +
|
||||
'</' + tagToTest + '>' +
|
||||
'</table>';
|
||||
|
||||
var table = doc.querySelector('#tbl');
|
||||
var tr = doc.querySelector('#tr');
|
||||
var td = doc.querySelector('#td');
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
assert_equals(table.rows.length, 1, 'Wrong number of table rows');
|
||||
assert_equals(table.rows[0].cells.length, 1, 'Wrong number of table cells');
|
||||
if (id !== null) {
|
||||
assert_not_equals(template.content.querySelector('#' + id), null,
|
||||
'Element should present in the template content');
|
||||
}
|
||||
if (tagName !== null) {
|
||||
assert_equals(template.content.querySelector('#' + id).tagName, tagName,
|
||||
'Wrong element in the template content');
|
||||
}
|
||||
|
||||
assert_equals(table.caption, null, 'Table should have no caption');
|
||||
|
||||
if (bodiesNum) {
|
||||
assert_equals(table.tBodies.length, bodiesNum, 'Table should have '
|
||||
+ bodiesNum + ' body');
|
||||
}
|
||||
if (footerIsNull) {
|
||||
assert_equals(table.tFoot, null, 'Table should have no footer');
|
||||
}
|
||||
if (footerId) {
|
||||
assert_not_equals(table.tFoot.id, footerId,
|
||||
'Table should have no footer with id="' + footerId + '"');
|
||||
}
|
||||
if (headerIsNull) {
|
||||
assert_equals(table.tHead, null, 'Table should have no header');
|
||||
}
|
||||
if (headerId) {
|
||||
assert_not_equals(table.tHead.id, headerId,
|
||||
'Table should have no header with id="' + headerId + '"');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var doc = newHTMLDocument();
|
||||
var parameters = [
|
||||
['Clearing stack back to a table body context. Test <tr> in <tbody>',
|
||||
doc, 'tbody', '<tr id="tr1"><td>Cell content</td></tr>', 'tr1', 'TR'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tr> in <thead>',
|
||||
doc, 'thead', '<tr id="tr2"><td>Cell content</td></tr>', 'tr2', 'TR'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tr> in <tfoot>',
|
||||
doc, 'tfoot', '<tr id="tr3"><td>Cell content</td></tr>', 'tr3', 'TR'],
|
||||
|
||||
['Clearing stack back to a table body context. Test </tbody>',
|
||||
doc, 'tbody', '</tbody>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </thead>',
|
||||
doc, 'thead', '</thead>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </tfoot>',
|
||||
doc, 'tfoot', '</tfoot>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test <caption> in <tbody>',
|
||||
doc, 'tbody', '<caption id="caption1">Table Caption</caption>', 'caption1', 'CAPTION'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <caption> in <tfoot>',
|
||||
doc, 'tfoot', '<caption id="caption2">Table Caption</caption>', 'caption2', 'CAPTION'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <caption> in <thead>',
|
||||
doc, 'thead', '<caption id="caption3">Table Caption</caption>', 'caption3', 'CAPTION'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <col> in <tbody>',
|
||||
doc, 'tbody', '<col id="col1" width="150"/>', 'col1', 'COL'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <col> in <tfoot>',
|
||||
doc, 'tfoot', '<col id="col2" width="150"/>', 'col2', 'COL'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <col> in <thead>',
|
||||
doc, 'thead', '<col id="col3" width="150"/>', 'col3', 'COL'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <colgroup> in <tbody>',
|
||||
doc, 'tbody', '<colgroup id="colgroup1" width="150"/>', 'colgroup1', 'COLGROUP'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <colgroup> in <tfoot>',
|
||||
doc, 'tfoot', '<colgroup id="colgroup2" width="150"/>', 'colgroup2', 'COLGROUP'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <colgroup> in <thead>',
|
||||
doc, 'thead', '<colgroup id="colgroup3" width="150"/>', 'colgroup3', 'COLGROUP'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tbody> in <tbody>',
|
||||
doc, 'tbody', '<tbody id="tbody1"></tbody>', 'tbody1', 'TBODY', 1],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tbody> in <tfoot>',
|
||||
doc, 'tfoot', '<tbody id="tbody2"></tbody>', 'tbody2', 'TBODY', 0],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tbody> in <thead>',
|
||||
doc, 'thead', '<tbody id="tbody3"></tbody>', 'tbody3', 'TBODY', 0],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tfoot> in <tbody>',
|
||||
doc, 'tbody', '<tfoot id="tfoot1"></tfoot>', 'tfoot1', 'TFOOT', null, true],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tfoot> in <tfoot>',
|
||||
doc, 'tfoot', '<tfoot id="tfoot2"></tfoot>', 'tfoot2', 'TFOOT', null, false, 'tfoot2'],
|
||||
|
||||
['Clearing stack back to a table body context. Test <tfoot> in <thead>',
|
||||
doc, 'thead', '<tfoot id="tfoot3"></tfoot>', 'tfoot3', 'TFOOT', null, true],
|
||||
|
||||
['Clearing stack back to a table body context. Test <thead> in <tbody>',
|
||||
doc, 'tbody', '<thead id="thead1"></thead>', 'thead1', 'THEAD', null, false, null, true],
|
||||
|
||||
['Clearing stack back to a table body context. Test <thead> in <tfoot>',
|
||||
doc, 'tfoot', '<thead id="thead2"></thead>', 'thead2', 'THEAD', null, false, null, true],
|
||||
|
||||
['Clearing stack back to a table body context. Test <thead> in <thead>',
|
||||
doc, 'thead', '<thead id="thead3"></thead>', 'thead3', 'THEAD', null, false, null, false, 'thead3'],
|
||||
|
||||
['Clearing stack back to a table body context. Test </table> in <tbody>',
|
||||
doc, 'tbody', '</table>', null, null, null, false, null, true],
|
||||
|
||||
['Clearing stack back to a table body context. Test </table> in <tfoot>',
|
||||
doc, 'tfoot', '</table>', null, null, null, false, null, true],
|
||||
|
||||
['Clearing stack back to a table body context. Test </table> in <thead>',
|
||||
doc, 'thead', '</table>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </tbody> in <thead>',
|
||||
doc, 'thead', '</tbody>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </tbody> in <tfoot>',
|
||||
doc, 'tfoot', '</tbody>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </thead> in <tbody>',
|
||||
doc, 'tbody', '</thead>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </thead> in <tfoot>',
|
||||
doc, 'tfoot', '</thead>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </tfoot> in <thead>',
|
||||
doc, 'thead', '</tfoot>', null, null],
|
||||
|
||||
['Clearing stack back to a table body context. Test </tfoot> in <tbody>',
|
||||
doc, 'tbody', '</tfoot>', null, null]
|
||||
];
|
||||
|
||||
generate_tests(doTest, parameters, 'Clearing stack back to a table body context.');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: Clearing stack back to a table context</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="Clearing the stack back to a table context must be aborted if the current node is template">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doTest(doc, templateInnerHTML, id, tagName, bodiesNum, footerIsNull,
|
||||
headerIsNull) {
|
||||
|
||||
doc.body.innerHTML = '' +
|
||||
'<table id="tbl">' +
|
||||
'<template id="tmpl1">' +
|
||||
// When parser meets <caption>, <colgroup>, <tbody>, <tfoot>, <thead>, <col>
|
||||
// stack must be cleared back to table context.
|
||||
//But <template> tag should abort this process
|
||||
templateInnerHTML +
|
||||
'</template>' +
|
||||
'<tr id="tr">' +
|
||||
'<td id="td">' +
|
||||
'</td>' +
|
||||
'</tr>' +
|
||||
'</table>';
|
||||
|
||||
var table = doc.querySelector('#tbl');
|
||||
var tr = doc.querySelector('#tr');
|
||||
var td = doc.querySelector('#td');
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
assert_equals(table.rows.length, 1, 'Wrong number of table rows');
|
||||
assert_equals(table.rows[0].cells.length, 1, 'Wrong number of table cells');
|
||||
assert_equals(template.parentNode, table, 'Wrong template parent');
|
||||
assert_not_equals(template.content.querySelector('#' + id), null,
|
||||
'Element should present in the template content');
|
||||
assert_equals(doc.querySelector('#tbl').caption, null, 'Table should have no caption');
|
||||
assert_equals(template.content.querySelector('#' + id).tagName, tagName,
|
||||
'Wrong element in the template content');
|
||||
if (bodiesNum) {
|
||||
assert_equals(table.tBodies.length, bodiesNum, 'Table should have '
|
||||
+ bodiesNum + ' body');
|
||||
}
|
||||
if (footerIsNull) {
|
||||
assert_equals(table.tFoot, null, 'Table should have no footer');
|
||||
}
|
||||
if (headerIsNull) {
|
||||
assert_equals(table.tHead, null, 'Table should have no header');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var doc = newHTMLDocument();
|
||||
var parameters = [
|
||||
['Clearing stack back to a table context. Test <caption>',
|
||||
doc, '<caption id="caption1">Table caption</caption>', 'caption1', 'CAPTION'],
|
||||
|
||||
['Clearing stack back to a table context. Test <colgroup>',
|
||||
doc, '<colgroup id="colgroup1" width="100%"/>', 'colgroup1', 'COLGROUP'],
|
||||
|
||||
['Clearing stack back to a table context. Test <tbody>',
|
||||
doc, '<tbody id="tbody1"></tbody>', 'tbody1', 'TBODY', 1],
|
||||
|
||||
['Clearing stack back to a table context. Test <tfoot>',
|
||||
doc, '<tfoot id="tfoot1"></tfoot>', 'tfoot1', 'TFOOT', null, true],
|
||||
|
||||
['Clearing stack back to a table context. Test <thead>',
|
||||
doc, '<thead id="thead1"></thead>', 'thead1', 'THEAD', null, false, true],
|
||||
|
||||
['Clearing stack back to a table context. Test <col>',
|
||||
doc, '<col id="col1" width="100%"/>', 'col1', 'COL']
|
||||
];
|
||||
|
||||
generate_tests(doTest, parameters, 'Clearing stack back to a table body context.');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: Clearing stack back to a table row context</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="Clearing the stack back to a table row context must be aborted if the current node is template">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doTest(doc, templateInnerHTML, id, tagName, elementId) {
|
||||
|
||||
doc.body.innerHTML = '' +
|
||||
'<table id="tbl">' +
|
||||
'<tr id="tr">' +
|
||||
'<template id="tmpl1">' +
|
||||
// When parser meets <th>, <td>, </tr>, stack must be cleared
|
||||
// back to table row context.
|
||||
// But <template> tag should abort this
|
||||
templateInnerHTML +
|
||||
'</template>' +
|
||||
'<td id="td">' +
|
||||
'</td>' +
|
||||
'</tr>' +
|
||||
'</table>';
|
||||
|
||||
var table = doc.querySelector('#tbl');
|
||||
var tr = doc.querySelector('#tr');
|
||||
var td = doc.querySelector('#td');
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
assert_equals(table.rows.length, 1, 'Wrong number of table rows');
|
||||
assert_equals(table.rows[0].cells.length, 1, 'Wrong number of table cells');
|
||||
assert_equals(template.parentNode, tr, 'Wrong template parent');
|
||||
if (id !== null) {
|
||||
assert_not_equals(template.content.querySelector('#' + id), null,
|
||||
'Element should present in the template content');
|
||||
}
|
||||
if (tagName !== null) {
|
||||
assert_equals(template.content.querySelector('#' + id).tagName, tagName,
|
||||
'Wrong element in the template content');
|
||||
}
|
||||
if (elementId) {
|
||||
assert_equals(doc.querySelector('#' + elementId), null,
|
||||
'Table should have no element with ID ' + elementId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var doc = newHTMLDocument();
|
||||
var parameters = [
|
||||
['Clearing stack back to a table row context. Test <th>',
|
||||
doc, '<th id="th1">Table header</th>', 'th1', 'TH', 'th1'],
|
||||
|
||||
['Clearing stack back to a table row context. Test <td>',
|
||||
doc, '<td id="td1">Table cell</td>', 'td1', 'TD', 'td1'],
|
||||
|
||||
['Clearing stack back to a table row context. Test </tr>',
|
||||
doc, '</tr>', null, null]
|
||||
];
|
||||
|
||||
generate_tests(doTest, parameters, 'Clearing stack back to a table body context.');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,242 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Templates: ownerDocument property of the element in template</title>
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="assert" content="ownerDocument property of the element appended to template must be set to the template contents owner of the ownerDocument of the template element">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#creating-an-element-for-a-token">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
doc.body.innerHTML = '<div><template id="tmpl1"><div id="div">DIV</div></template></div>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
var div = template.content.querySelector('#div');
|
||||
|
||||
assert_equals(div.ownerDocument, template.content.ownerDocument,
|
||||
'Wrong ownerDocument of the element in template');
|
||||
|
||||
}, 'Test ownerDocument property of the element in a template. '
|
||||
+ 'Current DOCUMENT has no browsing context. Test template element inside the div');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
doc.body.innerHTML = '<template id="tmpl1"><div id="div">DIV</div></template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
var div = template.content.querySelector('#div');
|
||||
|
||||
assert_equals(div.ownerDocument, template.content.ownerDocument,
|
||||
'Wrong ownerDocument of the element in template');
|
||||
|
||||
}, 'Test ownerDocument property of the element in a template. '
|
||||
+ 'Current DOCUMENT has no browsing context. Test template element '
|
||||
+ 'in the root of the body');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
doc.head.innerHTML = '<template id="tmpl1"><div id="div">DIV</div></template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
var div = template.content.querySelector('#div');
|
||||
|
||||
assert_equals(div.ownerDocument, template.content.ownerDocument,
|
||||
'Wrong ownerDocument of the element in template');
|
||||
|
||||
}, 'Test ownerDocument property of the element in a template. '
|
||||
+ 'Current DOCUMENT has no browsing context. Test template element '
|
||||
+ 'in the root of the head');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
doc.open();
|
||||
doc.write('<frameset><template id="tmpl1"><div id="div">DIV</div></template></frameset>');
|
||||
doc.close();
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
var div = template.content.querySelector('#div');
|
||||
|
||||
assert_equals(div.ownerDocument, template.content.ownerDocument,
|
||||
'Wrong ownerDocument of the element in template');
|
||||
|
||||
}, 'Test ownerDocument property of the element in a template. '
|
||||
+ 'Current DOCUMENT has no browsing context. Test template element '
|
||||
+ 'in the root of the frameset');
|
||||
|
||||
|
||||
|
||||
test(function () {
|
||||
var doc = newHTMLDocument();
|
||||
doc.body.innerHTML = '<template id="tmpl1">'
|
||||
+ '<template id="tmpl2"><div id="div">DIV</div></template></template>';
|
||||
|
||||
var template = doc.querySelector('#tmpl1');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('#tmpl2');
|
||||
|
||||
assert_equals(nestedTemplate.ownerDocument, template.content.ownerDocument,
|
||||
'Wrong nested template owner document');
|
||||
|
||||
var div = nestedTemplate.content.querySelector('#div');
|
||||
|
||||
assert_equals(div.ownerDocument, nestedTemplate.content.ownerDocument,
|
||||
'Wrong div ownerDocument');
|
||||
|
||||
}, 'Test ownerDocument property of the element in a nested template');
|
||||
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
||||
var div = template.content.querySelector('div');
|
||||
|
||||
assert_equals(div.ownerDocument, template.content.ownerDocument,
|
||||
'Wrong ownerDocument of the element in template');
|
||||
|
||||
}, 'Test ownerDocument property of the element in a template. '
|
||||
+ 'Load HTML document from a file, current DOCUMENT has browsing context');
|
||||
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-nested.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
||||
var nestedTemplate = template.content.querySelector('template');
|
||||
|
||||
assert_equals(nestedTemplate.ownerDocument, template.content.ownerDocument,
|
||||
'Wrong nested template owner document');
|
||||
|
||||
var div = nestedTemplate.content.querySelector('div');
|
||||
|
||||
assert_equals(div.ownerDocument, nestedTemplate.content.ownerDocument,
|
||||
'Wrong div ownerDocument');
|
||||
|
||||
}, 'Test ownerDocument property of the element in a nested template. '
|
||||
+ 'Load HTML document from a file, current DOCUMENT has browsing context');
|
||||
|
||||
|
||||
|
||||
testInIFrame('../../resources/two-templates.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template1 = doc.querySelector('#template1');
|
||||
var div1 = template1.content.querySelector('div');
|
||||
var template2 = doc.querySelector('#template2');
|
||||
var div2 = template2.content.querySelector('div');
|
||||
|
||||
assert_equals(div1.ownerDocument, template1.content.ownerDocument,
|
||||
'Wrong ownerDocument of the element in template');
|
||||
assert_equals(div2.ownerDocument, template2.content.ownerDocument,
|
||||
'Wrong ownerDocument of the element in template');
|
||||
assert_equals(div1.ownerDocument, div2.ownerDocument,
|
||||
'Different elements in the same document should share the same template contents owner');
|
||||
|
||||
}, 'Test ownerDocument property of two elements in a template. '
|
||||
+ 'Load HTML document from a file, current DOCUMENT has browsing context');
|
||||
|
||||
|
||||
var parameters = [];
|
||||
|
||||
HTML5_ELEMENTS.forEach(function(value) {
|
||||
if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
|
||||
|
||||
var doc = newHTMLDocument();
|
||||
|
||||
if (isVoidElement(value)) {
|
||||
doc.body.innerHTML = '<template><' + value + '/></template>';
|
||||
} else {
|
||||
doc.body.innerHTML = '<template><' + value + '></' + value + '></template>';
|
||||
}
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
var element = template.content.querySelector(value);
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
parameters.push([
|
||||
'Test ownerDocument for the element ' + value + ' in the template',
|
||||
element,
|
||||
template
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
function compare_owners(element, template) {
|
||||
assert_equals(element.ownerDocument, template.content.ownerDocument)
|
||||
}
|
||||
|
||||
generate_tests(compare_owners, parameters,
|
||||
'Test ownerDocument property of all HTML5 elements in a template. '
|
||||
+ 'Current DOCUMENT has no browsing context.');
|
||||
|
||||
var context = newContext();
|
||||
parameters = [];
|
||||
|
||||
try {
|
||||
|
||||
HTML5_ELEMENTS.forEach(function(value) {
|
||||
|
||||
if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
|
||||
|
||||
var doc = newRenderedHTMLDocument(context);
|
||||
|
||||
if (isVoidElement(value)) {
|
||||
doc.body.innerHTML = '<template><' + value + '/></template>';
|
||||
} else {
|
||||
doc.body.innerHTML = '<template><' + value + '></' + value + '></template>';
|
||||
}
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
var element = template.content.querySelector(value);
|
||||
|
||||
doc.body.appendChild(template);
|
||||
|
||||
parameters.push([
|
||||
'Test ownerDocument for the element ' + value + ' in the template. '
|
||||
+ 'Document has browsing context',
|
||||
element,
|
||||
template
|
||||
]);
|
||||
}
|
||||
});
|
||||
generate_tests(compare_owners, parameters,
|
||||
'Test ownerDocument property of all HTML5 elements in a template. '
|
||||
+ 'Current DOCUMENT has browsing context.');
|
||||
|
||||
} finally {
|
||||
try {
|
||||
cleanContext(context);
|
||||
} catch (e) {
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
326
tests/wpt/web-platform-tests/html/syntax/parsing/test.js
Normal file
326
tests/wpt/web-platform-tests/html/syntax/parsing/test.js
Normal file
|
@ -0,0 +1,326 @@
|
|||
var namespaces = {
|
||||
"html":"http://www.w3.org/1999/xhtml",
|
||||
"mathml":"http://www.w3.org/1998/Math/MathML",
|
||||
"svg":"http://www.w3.org/2000/svg",
|
||||
"xlink":"http://www.w3.org/1999/xlink",
|
||||
"xml":"http://www.w3.org/XML/1998/namespace",
|
||||
"xmlns":"http://www.w3.org/2000/xmlns/"
|
||||
};
|
||||
|
||||
var prefixes = {};
|
||||
for (var prefix in namespaces) {
|
||||
if (namespaces.hasOwnProperty(prefix)) {
|
||||
prefixes[namespaces[prefix]] = prefix;
|
||||
}
|
||||
}
|
||||
prefixes[namespaces["mathml"]] = "math";
|
||||
|
||||
function format(format_string) {
|
||||
var insertions = Array.prototype.slice.call(arguments, 1);
|
||||
var regexp = /%s/g;
|
||||
var match_count = 0;
|
||||
var rv = format_string.replace(regexp, function(match) {
|
||||
var rv = insertions[match_count];
|
||||
match_count++;
|
||||
return rv;
|
||||
});
|
||||
return rv;
|
||||
}
|
||||
|
||||
function test_serializer(element) {
|
||||
element.normalize();
|
||||
var lines = [];
|
||||
function serialize_element(element, indent) {
|
||||
var indent_spaces = (new Array(indent)).join(" ");
|
||||
switch(element.nodeType) {
|
||||
case Node.DOCUMENT_TYPE_NODE:
|
||||
if (element.name) {
|
||||
if (element.publicId || element.systemId) {
|
||||
var publicId = element.publicId ? element.publicId : "";
|
||||
var systemId = element.systemId ? element.systemId : "";
|
||||
lines.push(format("|%s<!DOCTYPE %s \"%s\" \"%s\">", indent_spaces,
|
||||
element.name, publicId, systemId));
|
||||
} else {
|
||||
lines.push(format("|%s<!DOCTYPE %s>", indent_spaces,
|
||||
element.name));
|
||||
}
|
||||
} else {
|
||||
lines.push(format("|%s<!DOCTYPE >", indent_spaces));
|
||||
}
|
||||
break;
|
||||
case Node.DOCUMENT_NODE:
|
||||
lines.push("#document");
|
||||
break;
|
||||
case Node.DOCUMENT_FRAGMENT_NODE:
|
||||
lines.push("#document-fragment");
|
||||
break;
|
||||
case Node.COMMENT_NODE:
|
||||
lines.push(format("|%s<!-- %s -->", indent_spaces, element.nodeValue));
|
||||
break;
|
||||
case Node.TEXT_NODE:
|
||||
lines.push(format("|%s\"%s\"", indent_spaces, element.nodeValue));
|
||||
break;
|
||||
case Node.ELEMENT_NODE:
|
||||
if (element.getAttribute("data-skip") !== null) {
|
||||
return;
|
||||
}
|
||||
if (element.namespaceURI !== null && element.namespaceURI !== namespaces.html) {
|
||||
var name = format("%s %s", prefixes[element.namespaceURI],
|
||||
element.localName);
|
||||
} else {
|
||||
var name = element.localName;
|
||||
}
|
||||
lines.push(format("|%s<%s>", indent_spaces, name));
|
||||
|
||||
var attributes = Array.prototype.map.call(
|
||||
element.attributes,
|
||||
function(attr) {
|
||||
var name = (attr.namespaceURI ? prefixes[attr.namespaceURI] + " " : "") +
|
||||
attr.localName;
|
||||
return [name, attr.value];
|
||||
});
|
||||
attributes.sort(function (a, b) {
|
||||
var x = a[0];
|
||||
var y = b[0];
|
||||
if (x === y) {
|
||||
return 0;
|
||||
}
|
||||
return x > y ? 1 : -1;
|
||||
});
|
||||
|
||||
attributes.forEach(
|
||||
function(attr) {
|
||||
var indent_spaces = (new Array(indent + 2)).join(" ");
|
||||
lines.push(format("|%s%s=\"%s\"", indent_spaces, attr[0], attr[1]));
|
||||
}
|
||||
);
|
||||
break;
|
||||
}
|
||||
indent += 2;
|
||||
Array.prototype.forEach.call(element.childNodes,
|
||||
function(node) {
|
||||
serialize_element(node, indent);
|
||||
});
|
||||
}
|
||||
serialize_element(element, 0);
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
function parse_query() {
|
||||
var query = location.search.slice(1);
|
||||
var vars = query.split("&");
|
||||
var fields = vars.map(function (x) {
|
||||
var split = x.split("=");
|
||||
return [split[0], split.slice(1).join("=")];
|
||||
});
|
||||
return fields;
|
||||
}
|
||||
|
||||
function get_type() {
|
||||
var run_type = "uri";
|
||||
var fields = parse_query();
|
||||
fields.forEach(function(x) {
|
||||
if(x[0] == "run_type") {
|
||||
run_type = x[1];
|
||||
}
|
||||
});
|
||||
return run_type;
|
||||
};
|
||||
|
||||
var test_in_data_uri = get_test_func(function (iframe, uri_encoded_input) {
|
||||
iframe.src = "data:text/html;charset=utf8," + uri_encoded_input;
|
||||
});
|
||||
|
||||
var test_document_write = get_test_func(function(iframe, uri_encoded_input) {
|
||||
iframe.contentDocument.open();
|
||||
var input = decodeURIComponent(uri_encoded_input);
|
||||
iframe.contentDocument.write(input);
|
||||
iframe.contentDocument.close();
|
||||
});
|
||||
|
||||
var test_document_write_single = get_test_func(function(iframe, uri_encoded_input) {
|
||||
iframe.contentDocument.open();
|
||||
var input = decodeURIComponent(uri_encoded_input);
|
||||
for (var i=0; i< input.length; i++) {
|
||||
iframe.contentDocument.write(input[i]);
|
||||
}
|
||||
iframe.contentDocument.close();
|
||||
});
|
||||
|
||||
function get_test_func(inject_func) {
|
||||
function test_func(iframe, t, test_id, uri_encoded_input, escaped_expected) {
|
||||
var expected = decodeURIComponent(escaped_expected);
|
||||
current_tests[iframe.id] = {test_id:test_id,
|
||||
uri_encoded_input:uri_encoded_input,
|
||||
expected:expected,
|
||||
actual:null
|
||||
};
|
||||
|
||||
iframe.onload = function() {
|
||||
t.step(function() {
|
||||
iframe.onload = null;
|
||||
var serialized_dom = test_serializer(iframe.contentDocument);
|
||||
current_tests[iframe.id].actual = serialized_dom;
|
||||
assert_equals(serialized_dom, expected);
|
||||
t.done();
|
||||
}
|
||||
);
|
||||
};
|
||||
inject_func(iframe, uri_encoded_input);
|
||||
}
|
||||
return test_func;
|
||||
}
|
||||
|
||||
function test_fragment(iframe, t, test_id, uri_encoded_input, escaped_expected, container) {
|
||||
var input_string = decodeURIComponent(uri_encoded_input);
|
||||
var expected = decodeURIComponent(escaped_expected);
|
||||
current_tests[iframe.id] = {
|
||||
test_id:test_id,
|
||||
input:uri_encoded_input,
|
||||
expected:expected,
|
||||
actual:null,
|
||||
container:container
|
||||
};
|
||||
|
||||
var components = container.split(" ");
|
||||
var container_elem = null;
|
||||
if (components.length > 1) {
|
||||
var namespace = namespaces[components[0]];
|
||||
container_elem = document.createElementNS(namespace,
|
||||
components[0] + ":" +
|
||||
components[1]);
|
||||
} else {
|
||||
container_elem = document.createElement(container);
|
||||
}
|
||||
container_elem.innerHTML = input_string;
|
||||
var serialized_dom = test_serializer(container_elem);
|
||||
current_tests[iframe.id].actual = serialized_dom;
|
||||
serialized_dom = convert_innerHTML(serialized_dom);
|
||||
assert_equals(serialized_dom, expected);
|
||||
t.done();
|
||||
}
|
||||
|
||||
function convert_innerHTML(serialized_dom) {
|
||||
var lines = serialized_dom.split("\n");
|
||||
lines[0] = "#document";
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
function print_diffs(test_id, uri_encoded_input, expected, actual, container) {
|
||||
container = container ? container : null;
|
||||
if (actual) {
|
||||
var diffs = mark_diffs(expected, actual);
|
||||
var expected_text = diffs[0];
|
||||
var actual_text = diffs[1];
|
||||
} else {
|
||||
var expected_text = expected;
|
||||
var actual_text = "";
|
||||
}
|
||||
|
||||
var tmpl = ["div", {"id":"${test_id}"},
|
||||
["h2", {}, "${test_id}"],
|
||||
function(vars) {
|
||||
if (vars.container !== null) {
|
||||
return ["div", {"class":"container"},
|
||||
["h3", {}, "innerHTML Container"],
|
||||
["pre", {}, vars.container]];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
["div", {"id":"input_${test_id}"}, ["h3", {}, "Input"], ["pre", {},
|
||||
["code", {}, decodeURIComponent(uri_encoded_input)]]],
|
||||
["div", {"id":"expected_${test_id}"}, ["h3", {}, "Expected"],
|
||||
["pre", {}, ["code", {}, expected_text]]],
|
||||
["div", {"id":"actual_${test_id}"}, ["h3", {}, "Actual"],
|
||||
["pre", {}, ["code", {}, actual_text]]]
|
||||
];
|
||||
|
||||
var diff_dom = template.render(tmpl, {test_id:test_id, container:container});
|
||||
document.body.appendChild(diff_dom);
|
||||
}
|
||||
|
||||
var current_tests = {};
|
||||
var iframe_map = {};
|
||||
|
||||
function init_tests(test_type) {
|
||||
var test_func = null;
|
||||
var test_funcs = {
|
||||
"write":test_document_write,
|
||||
"write_single":test_document_write_single,
|
||||
"uri":test_in_data_uri,
|
||||
"innerHTML":test_fragment
|
||||
};
|
||||
var tests_started = 0;
|
||||
var tests_complete = 0;
|
||||
|
||||
setup(function() {
|
||||
test_func = test_funcs[test_type];
|
||||
|
||||
var fails = [];
|
||||
|
||||
add_result_callback(function(test) {
|
||||
tests_complete++;
|
||||
var iframe = document.getElementById(iframe_map[test.name]);
|
||||
if (test.status !== test.PASS) {
|
||||
fails.push(current_tests[iframe.id]);
|
||||
var new_iframe = document.createElement("iframe");
|
||||
new_iframe.style.display = "none";
|
||||
new_iframe.id = iframe.id;
|
||||
document.body.replaceChild(new_iframe, iframe);
|
||||
iframe = new_iframe;
|
||||
}
|
||||
if (tests_complete === order.length) {
|
||||
done();
|
||||
} else if (tests_started < order.length) {
|
||||
test_next(iframe);
|
||||
}
|
||||
});
|
||||
|
||||
add_completion_callback(function() {
|
||||
fails.forEach(function(t) {
|
||||
print_diffs(t.test_id, t.uri_encoded_input,
|
||||
t.expected, t.actual);
|
||||
});
|
||||
});
|
||||
|
||||
//Create the iframes we will use to test
|
||||
//in the innerHTML case these are not actually used
|
||||
//but it is convenient to reuse the same code
|
||||
for (var i=0; i<num_iframes; i++) {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.id = "iframe_" + i;
|
||||
iframe.style.display = "none";
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
},
|
||||
{explicit_done:true});
|
||||
|
||||
function test_next(iframe) {
|
||||
var test_id = order[tests_started];
|
||||
tests_started++;
|
||||
var x = tests[test_id];
|
||||
var t = x[0];
|
||||
iframe_map[t.name] = iframe.id;
|
||||
setTimeout(function() {
|
||||
t.step(function() {
|
||||
var string_uri_encoded_input = x[1];
|
||||
var string_escaped_expected = x[2];
|
||||
if (test_type === "innerHTML") {
|
||||
var container = x[3];
|
||||
}
|
||||
test_func(iframe, t, test_id, string_uri_encoded_input, string_escaped_expected,
|
||||
container);
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
|
||||
onload = function() {
|
||||
Array.prototype.forEach.call(document.getElementsByTagName("iframe"),
|
||||
function(iframe) {
|
||||
if (tests_started<order.length) {
|
||||
test_next(iframe);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>The end</title>
|
||||
<link rel=help href="https://html.spec.whatwg.org/multipage/#the-end">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(function() {
|
||||
document.addEventListener("DOMContentLoaded", this.step_func_done(function(e) {
|
||||
assert_equals(e.type, "DOMContentLoaded");
|
||||
assert_true(e.bubbles, "bubbles should be true");
|
||||
assert_false(e.cancelable, "cancelable should be false");
|
||||
assert_equals(e.target, document, "target should be document");
|
||||
assert_true(e.isTrusted, "isTrusted should be true");
|
||||
assert_class_string(e, "Event");
|
||||
}));
|
||||
}, "DOMContentLoaded");
|
||||
|
||||
async_test(function() {
|
||||
window.addEventListener("load", this.step_func_done(function(e) {
|
||||
assert_equals(e.type, "load");
|
||||
assert_false(e.bubbles, "bubbles should be false");
|
||||
assert_false(e.cancelable, "cancelable should be false");
|
||||
assert_equals(e.target, document, "target should be document");
|
||||
assert_true(e.isTrusted, "isTrusted should be true");
|
||||
assert_class_string(e, "Event");
|
||||
}));
|
||||
}, "load");
|
||||
|
||||
async_test(function() {
|
||||
var seen = false;
|
||||
document.addEventListener("DOMContentLoaded", this.step_func(function() {
|
||||
seen = true;
|
||||
}));
|
||||
window.addEventListener("load", this.step_func_done(function() {
|
||||
assert_true(seen, "DOMContentLoaded should be fired before load");
|
||||
}));
|
||||
}, "order");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue