mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 08:57:34 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,137 @@
|
|||
<!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="/html/resources/common.js"></script>
|
||||
</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.textContent, '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').textContent,
|
||||
'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test wrong end tag');
|
||||
|
||||
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/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('/html/semantics/scripting-1/the-template-element/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.textContent, '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,101 @@
|
|||
<!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="/html/resources/common.js"></script>
|
||||
</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('/html/semantics/scripting-1/the-template-element/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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue