mirror of
https://github.com/servo/servo.git
synced 2025-09-16 09:58:23 +01:00
Update web-platform-tests to revision 20fa4a3a71ab7a2f75b4febbe2e98aeeaf022c2b
This commit is contained in:
parent
3d4416e1b0
commit
df8998356b
110 changed files with 1562 additions and 7048 deletions
|
@ -13,7 +13,7 @@ policies and contribution forms [3].
|
|||
<title>Shadow DOM Test: A_10_02_02_01</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-aware-methods">
|
||||
<meta name="assert" content="Extensions to Element Interface: createShadowRoot method creates new instance of Shadow root object">
|
||||
<meta name="assert" content="Extensions to Element Interface: attachShadow method creates new instance of Shadow root object">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../../../html/resources/common.js"></script>
|
||||
|
@ -28,9 +28,9 @@ test(function () {
|
|||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_true(s instanceof ShadowRoot, 'createShadowRoot() method should create new instance ' +
|
||||
assert_true(s instanceof ShadowRoot, 'attachShadow() method should create new instance ' +
|
||||
'of ShadowRoot object');
|
||||
|
||||
}, 'A_10_02_02_01_T01');
|
||||
|
|
|
@ -13,7 +13,7 @@ policies and contribution forms [3].
|
|||
<title>Shadow DOM Test: A_10_02_02_02</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-aware-methods">
|
||||
<meta name="assert" content="Extensions to Element Interface: createShadowRoot method">
|
||||
<meta name="assert" content="Extensions to Element Interface: attachShadow method">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../../../html/resources/common.js"></script>
|
||||
|
@ -33,10 +33,10 @@ test(unit(function (ctx) {
|
|||
span.innerHTML = 'Some text';
|
||||
host.appendChild(span);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
// span should become invisible as shadow root content
|
||||
assert_equals(span.offsetTop, 0, 'createShadowRoot() method should establish ' +
|
||||
assert_equals(span.offsetTop, 0, 'attachShadow() method should establish ' +
|
||||
'the context object as the shadow host of the ShadowRoot object');
|
||||
|
||||
}), 'A_10_02_02_02_T01');
|
||||
|
|
|
@ -28,7 +28,7 @@ t.step(unit(function(ctx) {
|
|||
var doc = newRenderedHTMLDocument(ctx);
|
||||
var host = doc.createElement('div');
|
||||
|
||||
var shadowRoot = host.createShadowRoot();
|
||||
var shadowRoot = host.attachShadow({mode: 'open'});
|
||||
var child = doc.createElement('div');
|
||||
|
||||
doc.body.appendChild(host);
|
||||
|
|
|
@ -29,7 +29,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(s.activeElement, null, 'activeElement attribute of the ShadowRoot must return null if there\'s no focused element');
|
||||
|
||||
|
@ -42,7 +42,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp = d.createElement('input');
|
||||
d.body.appendChild(inp);
|
||||
|
@ -60,7 +60,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp = d.createElement('input');
|
||||
d.body.appendChild(inp);
|
||||
|
|
|
@ -29,7 +29,7 @@ test(unit(function (ctx) {
|
|||
var host = d.createElement('div');
|
||||
host.setAttribute('id', 'shRoot');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp = d.createElement('input');
|
||||
inp.setAttribute('type', 'text');
|
||||
|
|
|
@ -28,7 +28,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var span = d.createElement('span');
|
||||
span.innerHTML = 'Some text';
|
||||
|
|
|
@ -28,7 +28,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var span = d.createElement('span');
|
||||
span.innerHTML = 'Some text';
|
||||
|
@ -48,7 +48,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var span = d.createElement('span');
|
||||
span.setAttribute('id', 'spanId');
|
||||
|
|
|
@ -28,7 +28,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_true(s.styleSheets != null, 'ShadowRoot styleSheets attribute shouldn\'t be null');
|
||||
assert_equals(s.styleSheets.length, 0, 'attribute must return the shadow root style sheets only');
|
||||
|
@ -42,7 +42,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var style = d.createElement('style');
|
||||
s.appendChild(style);
|
||||
|
|
|
@ -28,7 +28,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(s.nodeType, 11, 'The nodeType attribute of a ShadowRoot ' +
|
||||
'instance must return DOCUMENT_FRAGMENT_NODE');
|
||||
|
|
|
@ -28,7 +28,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(s.nodeName, '#document-fragment', 'The nodeName attribute of a ShadowRoot instance ' +
|
||||
'must return "#document-fragment".');
|
||||
|
|
|
@ -28,7 +28,7 @@ test(function () {
|
|||
var el = d.createElement('div');
|
||||
d.body.appendChild(el);
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
var s = el.attachShadow({mode: 'open'});
|
||||
|
||||
var child = d.createElement('span');
|
||||
child.setAttribute('id', 'span_id');
|
||||
|
@ -50,7 +50,7 @@ test(function () {
|
|||
var el = d.createElement('div');
|
||||
d.body.appendChild(el);
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
var s = el.attachShadow({mode: 'open'});
|
||||
|
||||
assert_true(s.getElementById('span_id') == null, ' ShadowRoot getElementById() ' +
|
||||
'method should return null if matching element not found');
|
||||
|
|
|
@ -27,7 +27,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var span = d.createElement('span');
|
||||
span.innerHTML = 'Some text';
|
||||
|
|
|
@ -44,7 +44,7 @@ test(function () {
|
|||
|
||||
var el = d.createElement('div');
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
var s = el.attachShadow({mode: 'open'});
|
||||
d.body.appendChild(el);
|
||||
|
||||
if (typeof(s) == 'undefined' || typeof (s.elementFromPoint(1, 1)) != 'object') {
|
||||
|
|
|
@ -28,7 +28,7 @@ test(function () {
|
|||
var el = d.createElement('div');
|
||||
d.body.appendChild(el);
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
var s = el.attachShadow({mode: 'open'});
|
||||
|
||||
var span = d.createElement('span');
|
||||
span.innerHTML = 'Some text';
|
||||
|
@ -47,7 +47,7 @@ test(function () {
|
|||
var el = d.createElement('div');
|
||||
d.body.appendChild(el);
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
var s = el.attachShadow({mode: 'open'});
|
||||
|
||||
var span = d.createElement('span');
|
||||
span.innerHTML = 'Some text';
|
||||
|
|
|
@ -12,8 +12,8 @@ policies and contribution forms [3].
|
|||
<head>
|
||||
<title>Shadow DOM Test: A_10_01_02_09</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-root-methods">
|
||||
<meta name="assert" content="ShadowRoot Object: Invoking the cloneNode() method on a ShadowRoot instance must always throw a DATA_CLONE_ERR exception.">
|
||||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
|
||||
<meta name="assert" content="If context object is a shadow root, throw a NotSupportedError exception.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../../../html/resources/common.js"></script>
|
||||
|
@ -24,17 +24,17 @@ policies and contribution forms [3].
|
|||
<script>
|
||||
test(unit(function (ctx) {
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
try {
|
||||
s.cloneNode();
|
||||
assert_true(false, 'Invoking the cloneNode() method on a ShadowRoot instance must always ' +
|
||||
'throw a DATA_CLONE_ERR exception.');
|
||||
'throw a NotSupportedError (code 9) exception.');
|
||||
} catch (e) {
|
||||
assert_equals(e.code, 25, 'Wrong exceprion type');
|
||||
assert_equals(e.code, 9, 'Wrong exception type');
|
||||
assert_equals(e.name, 'NotSupportedError', 'Wrong exception name');
|
||||
}
|
||||
}), 'A_10_01_02_09_T01');
|
||||
</script>
|
||||
|
|
|
@ -33,7 +33,7 @@ A_05_05_03_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
s.id = 'shadow';
|
||||
|
||||
var input1 = d.createElement('input');
|
||||
|
|
|
@ -35,7 +35,7 @@ A_05_01_01_T1.step(function () {
|
|||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
var div2 = d.createElement('div');
|
||||
s.appendChild(div2);
|
||||
|
@ -77,7 +77,7 @@ A_05_01_01_T2.step(function () {
|
|||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
var div2 = d.createElement('div');
|
||||
s.appendChild(div2);
|
||||
|
|
|
@ -37,11 +37,11 @@ A_05_01_03_T01.step(unit(function (ctx) {
|
|||
'</div>';
|
||||
|
||||
var ul = d.querySelector('#shadow-root');
|
||||
var s = ul.createShadowRoot();
|
||||
var s = ul.attachShadow({mode: 'open'});
|
||||
|
||||
//make shadow subtree
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '<content select=".shadow"><span id="flbk">Fallback item</span></content>';
|
||||
div.innerHTML = '<slot name="shadow"><span id="flbk">Fallback item</span></slot>';
|
||||
s.appendChild(div);
|
||||
|
||||
d.body.addEventListener('click', A_05_01_03_T01.step_func(function (event) {
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_01_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_02_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_03_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_04_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_05_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_06_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_07_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_08_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_04_09_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
|
|
@ -38,7 +38,7 @@ A_05_03_01_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
@ -78,7 +78,7 @@ A_05_03_01_T02.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
@ -121,7 +121,7 @@ A_05_03_01_T03.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
@ -161,7 +161,7 @@ A_05_03_01_T04.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
|
@ -202,34 +202,34 @@ A_05_03_01_T05.step(unit(function (ctx) {
|
|||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
inp1.setAttribute('type', 'checkbox');
|
||||
inp1.setAttribute('class', 'clazz1');
|
||||
inp1.setAttribute('slot', 'slot1');
|
||||
host.appendChild(inp1);
|
||||
|
||||
var inp2 = d.createElement('input');
|
||||
inp2.setAttribute('id', 'inp2');
|
||||
inp2.setAttribute('type', 'checkbox');
|
||||
inp2.setAttribute('class', 'clazz2');
|
||||
inp2.setAttribute('slot', 'slot2');
|
||||
host.appendChild(inp2);
|
||||
|
||||
var inp3 = d.createElement('input');
|
||||
inp3.setAttribute('id', 'inp3');
|
||||
inp3.setAttribute('type', 'checkbox');
|
||||
inp3.setAttribute('class', 'clazz1');
|
||||
inp3.setAttribute('slot', 'slot1');
|
||||
host.appendChild(inp3);
|
||||
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var shadowDiv = document.createElement('div');
|
||||
shadowDiv.innerHTML = '<content select=".clazz1"></content>';
|
||||
shadowDiv.innerHTML = '<slot name="slot1"></slot>';
|
||||
s.appendChild(shadowDiv);
|
||||
|
||||
//element outside the shadow tree
|
||||
var inp4 = d.createElement('input');
|
||||
inp4.setAttribute('id', 'inp4');
|
||||
inp4.setAttribute('type', 'checkbox');
|
||||
inp4.setAttribute('class', 'clazz1');
|
||||
inp4.setAttribute('slot', 'slot1');
|
||||
d.body.appendChild(inp4);
|
||||
|
||||
inp1.focus();
|
||||
|
@ -268,34 +268,34 @@ A_05_03_01_T06.step(unit(function (ctx) {
|
|||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('id', 'inp1');
|
||||
inp1.setAttribute('type', 'checkbox');
|
||||
inp1.setAttribute('class', 'clazz1');
|
||||
inp1.setAttribute('slot', 'slot1');
|
||||
host.appendChild(inp1);
|
||||
|
||||
var inp2 = d.createElement('input');
|
||||
inp2.setAttribute('id', 'inp2');
|
||||
inp2.setAttribute('type', 'checkbox');
|
||||
inp2.setAttribute('class', 'clazz2');
|
||||
inp2.setAttribute('slot', 'slot2');
|
||||
host.appendChild(inp2);
|
||||
|
||||
var inp3 = d.createElement('input');
|
||||
inp3.setAttribute('id', 'inp3');
|
||||
inp3.setAttribute('type', 'checkbox');
|
||||
inp3.setAttribute('class', 'clazz1');
|
||||
inp3.setAttribute('slot', 'slot1');
|
||||
host.appendChild(inp3);
|
||||
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var shadowDiv = document.createElement('div');
|
||||
shadowDiv.innerHTML = '<content select=".clazz1"></content>';
|
||||
shadowDiv.innerHTML = '<slot name="slot1"></slot>';
|
||||
s.appendChild(shadowDiv);
|
||||
|
||||
//element outside the shadow tree
|
||||
var inp4 = d.createElement('input');
|
||||
inp4.setAttribute('id', 'inp4');
|
||||
inp4.setAttribute('type', 'checkbox');
|
||||
inp4.setAttribute('class', 'clazz1');
|
||||
inp4.setAttribute('slot', 'slot1');
|
||||
d.body.appendChild(inp4);
|
||||
|
||||
inp4.focus();
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_02_01_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div1 = d.createElement('div');
|
||||
div1.setAttribute('style', 'height:40px; width:100%');
|
||||
|
|
|
@ -34,7 +34,7 @@ A_05_02_02_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div1 = d.createElement('div');
|
||||
div1.setAttribute('style', 'height:100%; width:100%');
|
||||
|
|
|
@ -12,8 +12,8 @@ policies and contribution forms [3].
|
|||
<head>
|
||||
<title>Shadow DOM Test: A_05_02_03</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-201305214#retargeting-related-target">
|
||||
<meta name="assert" content="Retargeting relatedTarget:Event listeners must not be invoked on a node for which the target and relatedTarget are the same.">
|
||||
<link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#event-relatedtarget-retargeting">
|
||||
<meta name="assert" content="The value of the Event object's relatedTarget attribute must be the result of the retargeting algorithm with the event's currentTarget and relatedTarget as input. The result is called a relative related target.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../../html/resources/common.js"></script>
|
||||
|
@ -34,27 +34,19 @@ A_05_02_03_T01.step(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div1 = d.createElement('div');
|
||||
div1.setAttribute('style', 'height:100%; width:100%');
|
||||
div1.setAttribute('id', 'div1');
|
||||
s.appendChild(div1);
|
||||
|
||||
var div2 = d.createElement('div');
|
||||
div2.setAttribute('style', 'height:100%; width:100%');
|
||||
div2.setAttribute('id', 'div2');
|
||||
s.appendChild(div2);
|
||||
|
||||
s.addEventListener('mouseover', A_05_02_03_T01.step_func(function(event) {
|
||||
assert_true(false, 'Event listeners shouldn\'t be invoked if target and relatedTarget are the same');
|
||||
host.addEventListener('mouseover', A_05_02_03_T01.step_func(function(event) {
|
||||
assert_unreached('Event listeners shouldn\'t be invoked if relative target and relative related target are the same');
|
||||
}), false);
|
||||
|
||||
|
||||
var evt = document.createEvent("MouseEvents");
|
||||
evt.initMouseEvent("mouseover", true, false, window,
|
||||
0, 10, 10, 10, 10, false, false, false, false, 0, div1);
|
||||
|
||||
var evt = new MouseEvent("mouseover",
|
||||
{ relatedTarget: div1, relatedTargetScoped: true });
|
||||
div1.dispatchEvent(evt);
|
||||
|
||||
A_05_02_03_T01.done();
|
||||
|
|
|
@ -36,7 +36,7 @@ A_05_00_01_T1.step(function () {
|
|||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
var div2 = d.createElement('div');
|
||||
s.appendChild(div2);
|
||||
|
|
|
@ -1,232 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_09_00_01</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#html-elements-and-their-shadow-trees">
|
||||
<meta name="assert" content="HTML Elements and Their Shadow Trees: If the element can have fallback content, UA should allow the shadow tree to contain at least one insertion point.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../html/resources/common.js"></script>
|
||||
<script src="../../resources/shadow-dom-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
//test iframe
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('iframe');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'Iframe should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T01');
|
||||
|
||||
|
||||
//test object
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('object');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'object should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T02');
|
||||
|
||||
|
||||
//test video
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('video');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'video should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T03');
|
||||
|
||||
|
||||
//test audio
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('audio');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'audio should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T04');
|
||||
|
||||
|
||||
//test canvas
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('canvas');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'canvas should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T05');
|
||||
|
||||
|
||||
//test map
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
var img = d.createElement('img');
|
||||
img.setAttribute('usemap', '#theMap');
|
||||
img.setAttribute('width', '20px');
|
||||
img.setAttribute('height', '20px');
|
||||
d.body.appendChild(img);
|
||||
|
||||
|
||||
// create element
|
||||
var el = d.createElement('map');
|
||||
el.setAttribute('name', 'theMap');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'map should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T06');
|
||||
|
||||
|
||||
//test textarea
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('textarea');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'textarea should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T07');
|
||||
|
||||
|
||||
//test progress
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('progress');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'progress should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T08');
|
||||
|
||||
|
||||
//test meter
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('meter');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'meter should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_01_T09');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,82 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_09_00_02</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#html-elements-and-their-shadow-trees">
|
||||
<meta name="assert" content="HTML Elements and Their Shadow Trees: Elements that have no fallback content should allow the shadow tree to contain no insertion points or an insertion point that matches nothing">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../html/resources/common.js"></script>
|
||||
<script src="../../resources/shadow-dom-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
//test img
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('img');
|
||||
d.body.appendChild(el);
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
|
||||
s.innerHTML = '<content id="cont" select="#shadow"></content>';
|
||||
|
||||
assert_true(s.querySelector('#cont') != null, 'img should allow one insertion point ' +
|
||||
'that matches nothing');
|
||||
|
||||
}), 'A_09_00_02_T01');
|
||||
|
||||
|
||||
//test embed
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('embed');
|
||||
d.body.appendChild(el);
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
|
||||
s.innerHTML = '<content id="cont" select="#shadow"></content>';
|
||||
|
||||
assert_true(s.querySelector('#cont') != null, 'embed should allow one insertion point ' +
|
||||
'that matches nothing');
|
||||
|
||||
}), 'A_09_00_02_T02');
|
||||
|
||||
|
||||
//test embed
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('input');
|
||||
d.body.appendChild(el);
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
|
||||
s.innerHTML = '<content id="cont" select="#shadow"></content>';
|
||||
|
||||
assert_true(s.querySelector('#cont') != null, 'input should allow one insertion point ' +
|
||||
'that matches nothing');
|
||||
|
||||
}), 'A_09_00_02_T03');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,73 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_09_00_03</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#html-elements-and-their-shadow-trees">
|
||||
<meta name="assert" content="HTML Elements and Their Shadow Trees: Check that fieldset can contain at least two insertion points with matching criteria 'legend:first-of-type' and 'universal selector'">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../html/resources/common.js"></script>
|
||||
<script src="../../resources/shadow-dom-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
//test universal selector
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('fieldset');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'fieldset should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_03_T01');
|
||||
|
||||
|
||||
|
||||
//test legend:first-of-type
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('fieldset');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<legend>'
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'</legend>' +
|
||||
'<span id="flbk">Unlucky content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="legend:first-of-type"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, 'fieldset should allow insertion point ' +
|
||||
'with legend:first-of-type matching criteria');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_03_T02');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,48 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_09_00_04</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#html-elements-and-their-shadow-trees">
|
||||
<meta name="assert" content="HTML Elements and Their Shadow Trees: Check that details can contain at least two insertion points with matching criteria 'summary:first-of-type' and 'universal selector'">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../html/resources/common.js"></script>
|
||||
<script src="../../resources/shadow-dom-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
//test universal selector
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
// create element
|
||||
var el = d.createElement('details');
|
||||
el.setAttribute('open', 'open');
|
||||
d.body.appendChild(el);
|
||||
|
||||
el.innerHTML = '' +
|
||||
'<span id="shadow">This is a node that should be distributed</span>' +
|
||||
'<span id="flbk">This is a fallback content</span>';
|
||||
|
||||
var s = el.createShadowRoot();
|
||||
s.innerHTML = '<content select="#shadow"></content>';
|
||||
|
||||
assert_true(d.querySelector('#shadow').offsetTop > 0, '\'details\' should allow at least one insertion point');
|
||||
assert_equals(d.querySelector('#flbk').offsetTop, 0, 'Fallback content shouldn\'t be rendered');
|
||||
|
||||
}), 'A_09_00_04_T01');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -31,7 +31,7 @@ test(function () {
|
|||
|
||||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
|
||||
HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) {
|
||||
|
@ -56,7 +56,7 @@ test(function () {
|
|||
|
||||
var div = d.createElement('div');
|
||||
form.appendChild(div);
|
||||
s = div.createShadowRoot();
|
||||
s = div.attachShadow({mode: 'open'});
|
||||
|
||||
HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ test(function () {
|
|||
|
||||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
|
||||
HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) {
|
||||
|
@ -58,7 +58,7 @@ test(function () {
|
|||
|
||||
var div = d.createElement('div');
|
||||
form.appendChild(div);
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
HTML5_FORM_ASSOCIATED_ELEMENTS.forEach(function (tagName) {
|
||||
|
||||
|
@ -88,10 +88,11 @@ test(function () {
|
|||
|
||||
var el = d.createElement(tagName);
|
||||
el.setAttribute('id', tagName + '_id');
|
||||
el.setAttribute('slot', tagName + '_slot');
|
||||
div.appendChild(el);
|
||||
|
||||
var s = div.createShadowRoot();
|
||||
s.innerHTML = '<content select="' + tagName + '"></content>';
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
s.innerHTML = '<slot name="' + tagName + '_slot"></slot>';
|
||||
|
||||
assert_true(s.querySelector('#' + tagName + '_id') == null, 'Distributed form-associated element ' + tagName +
|
||||
' in shadow tree must not be accessible shadow tree accessors');
|
||||
|
|
|
@ -12,8 +12,8 @@ policies and contribution forms [3].
|
|||
<head>
|
||||
<title>Shadow DOM Test: A_08_02_03</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#inert-html-elements">
|
||||
<meta name="assert" content="HTML Elements in shadow trees: form should submit elements in shadow tree">
|
||||
<link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#inertness-of-html-elements-in-a-shadow-tree">
|
||||
<meta name="assert" content="HTML Elements in shadow trees: form should not submit elements in shadow tree">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../../html/resources/common.js"></script>
|
||||
|
@ -23,17 +23,18 @@ policies and contribution forms [3].
|
|||
<script>
|
||||
var A_08_02_03_T01 = async_test('A_08_02_03_T01', { timeout: 5000 });
|
||||
|
||||
A_08_02_03_T01.checkIframeContent = A_08_02_03_T01.step_func(function () {
|
||||
//remember value to check before cleaning the context (it'll destroy the iframe)
|
||||
var checkIframeContent = A_08_02_03_T01.step_func(function () {
|
||||
// remember value to check before cleaning the context (it'll destroy the iframe)
|
||||
var valueToCheck = A_08_02_03_T01.iframe.contentWindow.document.URL;
|
||||
cleanContext(A_08_02_03_T01.ctx);
|
||||
|
||||
assert_true(valueToCheck.indexOf('inp1=value1') > 0,
|
||||
'html form should submit all of its fields');
|
||||
|
||||
// Expected behavior is not quite clear. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=20320
|
||||
assert_true(valueToCheck.indexOf('inp2=value2') > 0,
|
||||
'html form should submit all of its fields including the shadow ones');
|
||||
// Form data crossing shadow boundary should not be submitted.
|
||||
// https://github.com/w3c/webcomponents/issues/65
|
||||
assert_equals(valueToCheck.indexOf('inp2=value2'), -1,
|
||||
'html form should not submit fields in the shadow tree');
|
||||
|
||||
A_08_02_03_T01.done();
|
||||
});
|
||||
|
@ -46,13 +47,12 @@ A_08_02_03_T01.step(function () {
|
|||
|
||||
//create iframe
|
||||
var iframe = document.createElement('iframe');
|
||||
A_08_02_03_T01.iframe = iframe;
|
||||
|
||||
iframe.src = '../../resources/blank.html';
|
||||
iframe.setAttribute('name', 'targetIframe');
|
||||
d.body.appendChild(iframe);
|
||||
|
||||
A_08_02_03_T01.iframe = iframe;
|
||||
|
||||
// create form
|
||||
var form = d.createElement('form');
|
||||
form.setAttribute('target', 'targetIframe');
|
||||
|
@ -60,11 +60,10 @@ A_08_02_03_T01.step(function () {
|
|||
form.setAttribute('action', '../../resources/blank.html');
|
||||
d.body.appendChild(form);
|
||||
|
||||
//create Shadow root
|
||||
// create shadow root
|
||||
var root = d.createElement('div');
|
||||
form.appendChild(root);
|
||||
var s = root.createShadowRoot();
|
||||
|
||||
var s = root.attachShadow({mode: 'open'});
|
||||
|
||||
var input1 = d.createElement('input');
|
||||
input1.setAttribute('type', 'text');
|
||||
|
@ -78,11 +77,11 @@ A_08_02_03_T01.step(function () {
|
|||
input2.setAttribute('value', 'value2');
|
||||
s.appendChild(input2);
|
||||
|
||||
//submit the form
|
||||
// submit the form
|
||||
form.submit();
|
||||
|
||||
// set timeout to give the iframe time to load content
|
||||
setTimeout('A_08_02_03_T01.checkIframeContent()', 2000);
|
||||
setTimeout(checkIframeContent, 2000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -58,7 +58,7 @@ A_08_01_01_T01.step(function () {
|
|||
//create Shadow root
|
||||
var root = d.createElement('div');
|
||||
d.body.appendChild(root);
|
||||
var s = root.createShadowRoot();
|
||||
var s = root.attachShadow({mode: 'open'});
|
||||
|
||||
// create base element, set iframe as a target
|
||||
var base = d.createElement('base');
|
||||
|
|
|
@ -32,7 +32,7 @@ test(unit(function (ctx) {
|
|||
//create Shadow root
|
||||
var root = d.createElement('div');
|
||||
d.body.appendChild(root);
|
||||
var s = root.createShadowRoot();
|
||||
var s = root.attachShadow({mode: 'open'});
|
||||
|
||||
s.appendChild(link);
|
||||
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_04_02_04</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#lower-boundary-encapsulation">
|
||||
<meta name="assert" content="Lower-boundary encapsulation: The distribution reoccurs whenever any variable affecting it is changed">
|
||||
<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>
|
||||
var A_04_02_04_T1 = async_test('A_04_02_04_T01');
|
||||
|
||||
A_04_02_04_T1.step(function () {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.src = '../../resources/bobs_page.html';
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
iframe.onload = A_04_02_04_T1.step_func(function () {
|
||||
try {
|
||||
var d = iframe.contentDocument;
|
||||
var ul = d.querySelector('ul.stories');
|
||||
var s = ul.createShadowRoot();
|
||||
|
||||
//make shadow subtree
|
||||
var subdiv1 = document.createElement('div');
|
||||
subdiv1.innerHTML = '<ul><content select=".shadow"></content></ul>';
|
||||
s.appendChild(subdiv1);
|
||||
|
||||
|
||||
//The order of <li> elements at this point should be the following:
|
||||
//li3, li6, li11, li12, 1i13, li14, li15. Other elements (li1, li2, li4, li5) invisible
|
||||
assert_true(d.querySelector('#li3').offsetTop < d.querySelector('#li6').offsetTop,
|
||||
'Point 1: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li6').offsetTop < d.querySelector('#li11').offsetTop,
|
||||
'Point 2: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li11').offsetTop < d.querySelector('#li12').offsetTop,
|
||||
'Point 3: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li12').offsetTop < d.querySelector('#li13').offsetTop,
|
||||
'Point 4: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li13').offsetTop < d.querySelector('#li14').offsetTop,
|
||||
'Point 5: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li14').offsetTop < d.querySelector('#li15').offsetTop,
|
||||
'Point 6: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
|
||||
assert_equals(d.querySelector('#li1').offsetTop, 0,
|
||||
'Point 7: Elements that don\'t mach insertion point criteria participate in distribution');
|
||||
assert_equals(d.querySelector('#li2').offsetTop, 0,
|
||||
'Point 8: Elements that don\'t mach insertion point criteria participate in distribution');
|
||||
assert_equals(d.querySelector('#li4').offsetTop, 0,
|
||||
'Point 9: Elements that don\'t mach insertion point criteria participate in distribution');
|
||||
assert_equals(d.querySelector('#li5').offsetTop, 0,
|
||||
'Point 10: Elements that don\'t mach insertion point criteria participate in distribution');
|
||||
|
||||
var li5 = d.querySelector('#li5');
|
||||
li5.className = 'shadow';
|
||||
|
||||
// When class name changed distribution must reoccur
|
||||
//The order of <li> elements should now be the following:
|
||||
//li3, li6, li5, li11, li12, 1i13, li14, li15. Invisible: li1, li2, li4
|
||||
assert_true(d.querySelector('#li3').offsetTop < d.querySelector('#li6').offsetTop,
|
||||
'Point 11: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li6').offsetTop < d.querySelector('#li5').offsetTop,
|
||||
'Point 12: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li5').offsetTop < d.querySelector('#li11').offsetTop,
|
||||
'Point 13: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li11').offsetTop < d.querySelector('#li12').offsetTop,
|
||||
'Point 14: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li12').offsetTop < d.querySelector('#li13').offsetTop,
|
||||
'Point 15: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li13').offsetTop < d.querySelector('#li14').offsetTop,
|
||||
'Point 16: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
assert_true(d.querySelector('#li14').offsetTop < d.querySelector('#li15').offsetTop,
|
||||
'Point 17: Elements that mach insertion point criteria don\'t participate in distribution');
|
||||
|
||||
assert_equals(d.querySelector('#li1').offsetTop, 0,
|
||||
'Point 18: Elements that don\'t mach insertion point criteria participate in distribution');
|
||||
assert_equals(d.querySelector('#li2').offsetTop, 0,
|
||||
'Point 19: Elements that don\'t mach insertion point criteria participate in distribution');
|
||||
assert_equals(d.querySelector('#li4').offsetTop, 0,
|
||||
'Point 20: Elements that don\'t mach insertion point criteria participate in distribution');
|
||||
} finally {
|
||||
iframe.parentNode.removeChild(iframe);
|
||||
}
|
||||
A_04_02_04_T1.done();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -21,9 +21,9 @@
|
|||
<div id='host'>
|
||||
</div>
|
||||
<script>
|
||||
var shadowRoot = document.getElementById('host').createShadowRoot();
|
||||
var shadowRoot = document.getElementById('host').attachShadow({mode: 'open'});
|
||||
shadowRoot.innerHTML = '<div id="sub" style="width: 100%;height:100%;"></div>';
|
||||
var nestedRoot = shadowRoot.getElementById('sub').createShadowRoot();
|
||||
var nestedRoot = shadowRoot.getElementById('sub').attachShadow({mode: 'open'});
|
||||
nestedRoot.innerHTML = '<div style="width:100%; height:100%;background-color: green;"></div>';
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -29,11 +29,11 @@ policies and contribution forms [3].
|
|||
<div class="pass">Orange.</div>
|
||||
</div>
|
||||
<script>
|
||||
var shadowRoot = host.createShadowRoot(host);
|
||||
shadowRoot.innerHTML = '<div id="host2">Hello a Shadow Root.<content></content><div>Banana.</div></div>';
|
||||
var shadowRoot = host.attachShadow({mode: 'open'});
|
||||
shadowRoot.innerHTML = '<div id="host2">Hello a Shadow Root.<slot></slot><div>Banana.</div></div>';
|
||||
var host2 = shadowRoot.getElementById("host2");
|
||||
var shadowRoot2 = host2.createShadowRoot(host2);
|
||||
shadowRoot2.innerHTML = '<div>Hello a Shadow Root2.</div><div><content></content></div>';
|
||||
var shadowRoot2 = host2.attachShadow({mode: 'open'});
|
||||
shadowRoot2.innerHTML = '<div>Hello a Shadow Root2.</div><div><slot></slot></div>';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -26,7 +26,7 @@ p { color: black; }
|
|||
<p>You should see green text saying "PASS" below.</p>
|
||||
<div id="host">FAIL</div>
|
||||
<script>
|
||||
var shadowRoot = window.host.createShadowRoot();
|
||||
var shadowRoot = window.host.attachShadow({mode: 'open'});
|
||||
shadowRoot.innerHTML =
|
||||
'<style>#pass { color: green; }</style>\n' +
|
||||
'<div id="pass">PASS</div>';
|
||||
|
|
|
@ -34,7 +34,7 @@ in this order.
|
|||
<div class="pass">C</div>
|
||||
</div>
|
||||
<script>
|
||||
var shadowRoot = window.host.createShadowRoot();
|
||||
var shadowRoot = window.host.attachShadow({mode: 'open'});
|
||||
|
||||
shadowRoot.innerHTML =
|
||||
'<style>\n' +
|
||||
|
@ -42,7 +42,7 @@ shadowRoot.innerHTML =
|
|||
'* { color: red; }\n' +
|
||||
'</style>' +
|
||||
'<div class="shadow-pass">A</div>\n' +
|
||||
'<content>FAIL</content>' +
|
||||
'<slot>FAIL</slot>' +
|
||||
'<div class="shadow-pass">D</div>';
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</span>
|
||||
<script>
|
||||
var parent = document.getElementById('parent');
|
||||
var shadow = parent.createShadowRoot();
|
||||
var shadow = parent.attachShadow({mode: 'open'});
|
||||
var child = document.createElement('span');
|
||||
child.textContent = "if NOT underlined, it is success.";
|
||||
shadow.appendChild(child);
|
||||
|
|
|
@ -199,7 +199,7 @@ test(function () {
|
|||
body.appendChild(pHost);
|
||||
doc.documentElement.appendChild(body);
|
||||
|
||||
var shadowRoot = body.createShadowRoot();
|
||||
var shadowRoot = body.attachShadow({mode: 'open'});
|
||||
var pShadow = doc.createElementNS(namespace, 'p');
|
||||
pShadow.className = "shadow";
|
||||
shadowRoot.appendChild(pShadow);
|
||||
|
@ -213,7 +213,7 @@ test(function () {
|
|||
test(function () {
|
||||
var doc = document.implementation.createHTMLDocument('');
|
||||
populateTestContentToHostDocument(doc);
|
||||
var shadowRoot = doc.documentElement.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
populateTestContentToShadowRoot(shadowRoot);
|
||||
|
||||
shadowRoot.querySelectorAll('p')[0].id = 'test-id';
|
||||
|
|
|
@ -27,11 +27,11 @@ policies and contribution forms [3].
|
|||
test(function () {
|
||||
var doc = document.implementation.createHTMLDocument('Test');
|
||||
doc.body.innerHTML = '<div>A<div>B</div>C<div><span>D</span></div>E</div>';
|
||||
var nodeIterator = doc.createNodeIterator(doc.documentElement,
|
||||
var nodeIterator = doc.createNodeIterator(doc.body,
|
||||
NodeFilter.SHOW_ELEMENT, null);
|
||||
var node;
|
||||
while (node = nodeIterator.nextNode()) {
|
||||
var shadowRoot = node.createShadowRoot();
|
||||
var shadowRoot = node.attachShadow({mode: 'open'});
|
||||
assert_equals(shadowRoot.ownerDocument, doc);
|
||||
}
|
||||
}, 'ownerDocument property of a shadow root should be the document of the ' +
|
||||
|
@ -50,7 +50,7 @@ test(function () {
|
|||
|
||||
for (var depth = 1; depth <= MAX_DEPTH; ++depth) {
|
||||
var host = doc.getElementById('depth-' + depth);
|
||||
var shadowRoot = host.createShadowRoot();
|
||||
var shadowRoot = host.attachShadow({mode: 'open'});
|
||||
assert_equals(shadowRoot.ownerDocument, doc,
|
||||
'ownerDocument mismatch for #depth-' + depth);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ test(function () {
|
|||
|
||||
test(function () {
|
||||
var doc = document.implementation.createHTMLDocument('Test');
|
||||
var shadowRoot = doc.body.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
var div = doc.createElement('div');
|
||||
shadowRoot.appendChild(div);
|
||||
assert_equals(div.ownerDocument, doc);
|
||||
|
@ -70,7 +70,7 @@ test(function () {
|
|||
test(function () {
|
||||
var doc1 = document.implementation.createHTMLDocument('Test 1');
|
||||
var doc2 = document.implementation.createHTMLDocument('Test 2');
|
||||
var shadowRoot = doc1.body.createShadowRoot();
|
||||
var shadowRoot = doc1.body.attachShadow({mode: 'open'});
|
||||
var div = doc2.createElement('div');
|
||||
shadowRoot.appendChild(div);
|
||||
assert_equals(div.ownerDocument, doc1);
|
||||
|
@ -81,7 +81,7 @@ test(function () {
|
|||
test(function () {
|
||||
var doc1 = document.implementation.createHTMLDocument('Test 1');
|
||||
var doc2 = document.implementation.createHTMLDocument('Test 2');
|
||||
var shadowRoot = doc1.body.createShadowRoot();
|
||||
var shadowRoot = doc1.body.attachShadow({mode: 'open'});
|
||||
doc2.body.innerHTML =
|
||||
'<div id="root">A<div>B</div>C<div><span>D</span></div>E</div>';
|
||||
shadowRoot.appendChild(doc2.getElementById('root'));
|
||||
|
@ -97,7 +97,7 @@ test(function () {
|
|||
test(function () {
|
||||
var doc1 = document.implementation.createHTMLDocument('Test 1');
|
||||
var doc2 = document.implementation.createHTMLDocument('Test 2');
|
||||
var shadowRoot = doc1.body.createShadowRoot();
|
||||
var shadowRoot = doc1.body.attachShadow({mode: 'open'});
|
||||
doc2.body.innerHTML = '<div id="parent"><div id="child"></div></div>';
|
||||
shadowRoot.appendChild(doc2.getElementById('child'));
|
||||
assert_equals(doc2.getElementById('parent').ownerDocument, doc2);
|
||||
|
|
|
@ -35,7 +35,7 @@ function createTestDocument() {
|
|||
pHost.className = 'test-class';
|
||||
pHost.id = 'test-id';
|
||||
doc.body.appendChild(pHost);
|
||||
var shadowRoot = doc.body.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
var pShadow = doc.createElement('p');
|
||||
pShadow.className = 'test-class';
|
||||
pShadow.id = 'test-id';
|
||||
|
|
|
@ -36,7 +36,7 @@ function createTestDocument() {
|
|||
pHost.className = 'test-class';
|
||||
pHost.id = 'test-id';
|
||||
doc.body.appendChild(pHost);
|
||||
var shadowRoot = doc.body.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
var pShadow = doc.createElement('p');
|
||||
pShadow.className = 'test-class';
|
||||
pShadow.id = 'test-id';
|
||||
|
|
|
@ -25,22 +25,22 @@ policies and contribution forms [3].
|
|||
<script>
|
||||
test(function () {
|
||||
var doc = document.implementation.createHTMLDocument('Test');
|
||||
var shadowRoot = doc.body.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
assert_equals(shadowRoot.parentNode, null);
|
||||
}, 'The parentNode attribute of a shadow root must always return null.');
|
||||
|
||||
test(function () {
|
||||
var doc = document.implementation.createHTMLDocument('Test');
|
||||
var shadowRoot = doc.body.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
assert_equals(shadowRoot.parentElement, null);
|
||||
}, 'The parentElement attribute of a shadow root must always return null.');
|
||||
|
||||
test(function () {
|
||||
var doc = document.implementation.createHTMLDocument('Test');
|
||||
var outerShadowRoot = doc.body.createShadowRoot();
|
||||
var outerShadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
var div = doc.createElement('div');
|
||||
outerShadowRoot.appendChild(div);
|
||||
var innerShadowRoot = div.createShadowRoot();
|
||||
var innerShadowRoot = div.attachShadow({mode: 'open'});
|
||||
assert_equals(innerShadowRoot.parentNode, null);
|
||||
},
|
||||
'The parentNode attribute of a shadow root must always return null, ' +
|
||||
|
@ -49,10 +49,10 @@ test(function () {
|
|||
|
||||
test(function () {
|
||||
var doc = document.implementation.createHTMLDocument('Test');
|
||||
var outerShadowRoot = doc.body.createShadowRoot();
|
||||
var outerShadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
var div = doc.createElement('div');
|
||||
outerShadowRoot.appendChild(div);
|
||||
var innerShadowRoot = div.createShadowRoot();
|
||||
var innerShadowRoot = div.attachShadow({mode: 'open'});
|
||||
assert_equals(innerShadowRoot.parentElement, null);
|
||||
},
|
||||
'The parentElement attribute of a shadow root must always return null, ' +
|
||||
|
|
|
@ -26,7 +26,7 @@ test(function () {
|
|||
var d = newHTMLDocument();
|
||||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
// node in shadow with id
|
||||
var input = d.createElement('input');
|
||||
|
@ -52,7 +52,7 @@ test(function () {
|
|||
var d = newHTMLDocument();
|
||||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
var form = d.createElement('form');
|
||||
form.setAttribute('id', 'form_id');
|
||||
|
|
|
@ -26,7 +26,7 @@ test(function () {
|
|||
var d = newHTMLDocument();
|
||||
var div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
|
||||
var input = d.createElement('input');
|
||||
input.setAttribute('type', 'text');
|
||||
|
@ -61,7 +61,7 @@ test(function () {
|
|||
div = d.createElement('div');
|
||||
d.body.appendChild(div);
|
||||
|
||||
var s = div.createShadowRoot();
|
||||
var s = div.attachShadow({mode: 'open'});
|
||||
s.appendChild(form);
|
||||
s.appendChild(el);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ test(unit(function (ctx) {
|
|||
//create Shadow root
|
||||
var root = d.createElement('div');
|
||||
d.body.appendChild(root);
|
||||
var s = root.createShadowRoot();
|
||||
var s = root.attachShadow({mode: 'open'});
|
||||
|
||||
s.appendChild(link);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ test(function () {
|
|||
try {
|
||||
host.style.display = 'none';
|
||||
document.body.appendChild(host);
|
||||
var shadowRoot = host.createShadowRoot();
|
||||
var shadowRoot = host.attachShadow({mode: 'open'});
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.style.display = 'none';
|
||||
iframe.name = 'test-name';
|
||||
|
|
|
@ -25,7 +25,7 @@ policies and contribution forms [3].
|
|||
<script>
|
||||
function testNameAttribute(elementName) {
|
||||
var doc = document.implementation.createHTMLDocument('Title');
|
||||
var shadowRoot = doc.body.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
var element = doc.createElement(elementName);
|
||||
element.name = 'test-name';
|
||||
shadowRoot.appendChild(element);
|
||||
|
|
|
@ -26,7 +26,7 @@ policies and contribution forms [3].
|
|||
<script>
|
||||
function testIDAttribute(elementName) {
|
||||
var doc = document.implementation.createHTMLDocument('Title');
|
||||
var shadowRoot = doc.body.createShadowRoot();
|
||||
var shadowRoot = doc.body.attachShadow({mode: 'open'});
|
||||
var element = doc.createElement(elementName);
|
||||
element.id = 'test-id';
|
||||
shadowRoot.appendChild(element);
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_06_01_01</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#css-variables">
|
||||
<meta name="assert" content="CSS variables: The shadow host styles being inherited by the children of the shadow root must also apply to CSS Variables.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../../html/resources/common.js"></script>
|
||||
<script src="../../../resources/shadow-dom-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
//TODO For now (November, 2012) CSS variables support is not implemented yet
|
||||
// so this test won't work. Treat it as a placeholder for now
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
d.head.innerHtml = '' +
|
||||
'<style>' +
|
||||
'body {font-size:10px;}' +
|
||||
'</style>';
|
||||
|
||||
d.body.innerHTML =
|
||||
'<ul id="shHost">' +
|
||||
'<li id="li1" class="shadow">1</li>' +
|
||||
'<li id="li2" class="shadow2">2</li>' +
|
||||
'<li id="li3" class="shadow">3</li>' +
|
||||
'<li id="li4">4</li>' +
|
||||
'<li id="li5" class="shadow">5</li>' +
|
||||
'<li id="li6" class="shadow2">6</li>' +
|
||||
'</ul>';
|
||||
|
||||
|
||||
var host = d.querySelector('#shHost');
|
||||
var s = host.createShadowRoot();
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML ='<ul><content select=".shadow"></content></ul>';
|
||||
s.appendChild(div);
|
||||
|
||||
var defHeight1 = d.querySelector('#li1').offsetHeight;
|
||||
var defHeight3 = d.querySelector('#li3').offsetHeight;
|
||||
var defHeight5 = d.querySelector('#li5').offsetHeight;
|
||||
|
||||
var style = d.createElement('style');
|
||||
style.innerHTML =':root {' +
|
||||
'var-text-size: 30px;' +
|
||||
'}' +
|
||||
'body {' +
|
||||
'font-size: var(text-size);' +
|
||||
'}';
|
||||
s.appendChild(style);
|
||||
|
||||
assert_true(d.querySelector('#li1').offsetHeight > defHeight1, 'Point 1: Element height should be changed');
|
||||
assert_true(d.querySelector('#li3').offsetHeight > defHeight3, 'Point 2: Element height should be changed');
|
||||
assert_true(d.querySelector('#li5').offsetHeight > defHeight5, 'Point 3: Element height should be changed');
|
||||
|
||||
}), 'A_06_01_01_T01');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -29,7 +29,7 @@ div {
|
|||
<div id="shadow-host"></div>
|
||||
<script>
|
||||
var shadowHost = document.getElementById('shadow-host');
|
||||
var shadowRoot = shadowHost.createShadowRoot();
|
||||
var shadowRoot = shadowHost.attachShadow({mode: 'open'});
|
||||
var style = document.createElement('style');
|
||||
style.innerHTML = 'div { background: red }';
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ test(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div1 = d.createElement('div');
|
||||
div1.innerHTML ='<span id="shd" class="invis">This is the shadow tree</span>';
|
||||
|
@ -67,7 +67,7 @@ test(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div1 = d.createElement('div');
|
||||
div1.innerHTML ='<span id="shd" class="invis">This is the shadow tree</span>';
|
||||
|
|
|
@ -28,7 +28,7 @@ test(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(s.styleSheets.length, 0, 'There should be no style sheets');
|
||||
}), 'A_06_00_03_T01');
|
||||
|
@ -41,7 +41,7 @@ test(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(s.styleSheets.length, 0, 'There should be no style sheets');
|
||||
}), 'A_06_00_03_T02');
|
||||
|
@ -54,7 +54,7 @@ test(unit(function (ctx) {
|
|||
var host = d.createElement('div');
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var style = d.createElement('style');
|
||||
style.textContent = 'div {width: 50%;}';
|
||||
|
|
|
@ -36,7 +36,7 @@ test(unit(function (ctx) {
|
|||
var host = d.querySelector('#sr');
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var style = d.createElement('style');
|
||||
style.innerHTML ='.invis {display:none}';
|
||||
|
|
|
@ -32,7 +32,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.querySelector('#shHost');
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML ='<span id="spn2">This is a shadow root child</span>';
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_06_00_11</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#styles">
|
||||
<meta name="assert" content="Styles:the styles of the shadow insertion point node are inherited by the child nodes of the shadow root of the shadow tree, distributed to this shadow insertion point">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../../html/resources/common.js"></script>
|
||||
<script src="../../resources/shadow-dom-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
// Test fails. See https://bugs.webkit.org/show_bug.cgi?id=103625
|
||||
test(unit(function (ctx) {
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
|
||||
//Old tree
|
||||
var s1 = host.createShadowRoot();
|
||||
|
||||
var div1 = d.createElement('div');
|
||||
div1.setAttribute('style', 'font-size: 10px');
|
||||
div1.innerHTML = '<span id="shd1">This is an old shadow tree</span>';
|
||||
s1.appendChild(div1);
|
||||
|
||||
var height1 = s1.querySelector('#shd1').offsetHeight;
|
||||
|
||||
assert_true(height1 > 0, 'Element height should be greater than zero');
|
||||
|
||||
//younger tree
|
||||
var s2 = host.createShadowRoot();
|
||||
var div2 = d.createElement('div');
|
||||
div2.innerHTML = '<shadow style="font-size:20px"></shadow>';
|
||||
s2.appendChild(div2);
|
||||
|
||||
assert_true(s1.querySelector('#shd1').offsetHeight > height1,
|
||||
'Shadow insertion point style must be aplied to the child nodes of ' +
|
||||
'the shadow host that are assigned to this insertion point');
|
||||
}), 'A_06_00_11_T01');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -27,7 +27,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp = d.createElement('input');
|
||||
inp.setAttribute('type', 'text');
|
||||
|
|
|
@ -28,7 +28,7 @@ test(unit(function (ctx) {
|
|||
var host = d.createElement('div');
|
||||
host.setAttribute('id', 'shRoot');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp = d.createElement('input');
|
||||
inp.setAttribute('type', 'text');
|
||||
|
|
|
@ -29,7 +29,7 @@ test(unit(function (ctx) {
|
|||
host.contentEditable = "true";
|
||||
d.body.appendChild(host);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(host.contentEditable, "true");
|
||||
assert_equals(s.contentEditable, undefined);
|
||||
|
@ -42,7 +42,7 @@ test(unit(function (ctx) {
|
|||
host.contentEditable = "false";
|
||||
d.body.appendChild(host);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(host.contentEditable, 'false');
|
||||
assert_equals(s.contentEditable, undefined);
|
||||
|
@ -55,7 +55,7 @@ test(unit(function (ctx) {
|
|||
d.body.appendChild(host);
|
||||
d.body.contentEditable = "true";
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
assert_equals(host.contentEditable, 'inherit');
|
||||
assert_equals(s.contentEditable, undefined);
|
||||
|
|
|
@ -40,7 +40,7 @@ A_07_02_01_T01.step(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('type', 'text');
|
||||
|
|
|
@ -47,7 +47,7 @@ A_07_02_02_T01.step(unit(function (ctx) {
|
|||
var chb2 = d.createElement('input');
|
||||
chb2.setAttribute('type', 'checkbox');
|
||||
chb2.setAttribute('id', 'chb2');
|
||||
chb2.setAttribute('class', 'shadow');
|
||||
chb2.setAttribute('slot', 'shadow');
|
||||
chb2.addEventListener('focus', A_07_02_02_T01.step_func(function(event) {
|
||||
assert_equals(counter++, 0, 'Point 1: wrong focus navigation order');
|
||||
expectations[1] = true;
|
||||
|
@ -58,7 +58,7 @@ A_07_02_02_T01.step(unit(function (ctx) {
|
|||
var chb3 = d.createElement('input');
|
||||
chb3.setAttribute('type', 'checkbox');
|
||||
chb3.setAttribute('id', 'chb3');
|
||||
chb3.setAttribute('class', 'shadow');
|
||||
chb3.setAttribute('slot', 'shadow');
|
||||
chb3.addEventListener('focus', A_07_02_02_T01.step_func(function(event) {
|
||||
assert_equals(counter++, 1, 'Point 2: wrong focus navigation order');
|
||||
expectations[2] = true;
|
||||
|
@ -66,10 +66,10 @@ A_07_02_02_T01.step(unit(function (ctx) {
|
|||
expectations[2] = false;
|
||||
host.appendChild(chb3);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML = '<content select=".shadow"></content>';
|
||||
div.innerHTML = '<slot name="shadow"></slot>';
|
||||
s.appendChild(div);
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
|
@ -154,7 +154,7 @@ A_07_02_02_T02.step(unit(function (ctx) {
|
|||
var chb2 = d.createElement('input');
|
||||
chb2.setAttribute('type', 'checkbox');
|
||||
chb2.setAttribute('id', 'chb2');
|
||||
chb2.setAttribute('class', 'shadow');
|
||||
chb2.setAttribute('slot', 'shadow');
|
||||
chb2.addEventListener('focus', A_07_02_02_T02.step_func(function(event) {
|
||||
assert_equals(counter++, 2, 'Point 3: wrong focus navigation order');
|
||||
expectations[1] = true;
|
||||
|
@ -165,7 +165,7 @@ A_07_02_02_T02.step(unit(function (ctx) {
|
|||
var chb3 = d.createElement('input');
|
||||
chb3.setAttribute('type', 'checkbox');
|
||||
chb3.setAttribute('id', 'chb3');
|
||||
chb3.setAttribute('class', 'shadow');
|
||||
chb3.setAttribute('slot', 'shadow');
|
||||
chb3.addEventListener('focus', A_07_02_02_T02.step_func(function(event) {
|
||||
assert_equals(counter++, 3, 'Point 4: wrong focus navigation order');
|
||||
expectations[2] = true;
|
||||
|
@ -173,10 +173,10 @@ A_07_02_02_T02.step(unit(function (ctx) {
|
|||
expectations[2] = false;
|
||||
host.appendChild(chb3);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML = '<content select=".shadow"></content>';
|
||||
div.innerHTML = '<slot name="shadow"></slot>';
|
||||
s.appendChild(div);
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
|
|
|
@ -47,7 +47,7 @@ A_07_02_03_T01.step(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('type', 'text');
|
||||
|
@ -149,7 +149,7 @@ A_07_02_03_T02.step(unit(function (ctx) {
|
|||
var chb2 = d.createElement('input');
|
||||
chb2.setAttribute('type', 'checkbox');
|
||||
chb2.setAttribute('id', 'chb2');
|
||||
chb2.setAttribute('class', 'shadow');
|
||||
chb2.setAttribute('slot', 'shadow');
|
||||
chb2.setAttribute('tabindex', '3');
|
||||
chb2.addEventListener('focus', A_07_02_03_T02.step_func(function(event) {
|
||||
assert_equals(counter++, 2, 'Point 2: wrong focus navigation order');
|
||||
|
@ -161,7 +161,7 @@ A_07_02_03_T02.step(unit(function (ctx) {
|
|||
var chb3 = d.createElement('input');
|
||||
chb3.setAttribute('type', 'checkbox');
|
||||
chb3.setAttribute('id', 'chb3');
|
||||
chb3.setAttribute('class', 'shadow');
|
||||
chb3.setAttribute('slot', 'shadow');
|
||||
chb3.setAttribute('tabindex', '2');
|
||||
chb3.addEventListener('focus', A_07_02_03_T02.step_func(function(event) {
|
||||
assert_equals(counter++, 1, 'Point 3: wrong focus navigation order');
|
||||
|
@ -170,10 +170,10 @@ A_07_02_03_T02.step(unit(function (ctx) {
|
|||
invoked[3] = false;
|
||||
host.appendChild(chb3);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML = '<content select=".shadow"></content>';
|
||||
div.innerHTML = '<slot name="shadow"></slot>';
|
||||
s.appendChild(div);
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
|
|
|
@ -49,7 +49,7 @@ A_07_02_04_T01.step(unit(function (ctx) {
|
|||
//make shadow host focusable
|
||||
host.setAttribute('tabindex', '3');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('type', 'text');
|
||||
|
@ -154,7 +154,7 @@ A_07_02_04_T02.step(unit(function (ctx) {
|
|||
var chb2 = d.createElement('input');
|
||||
chb2.setAttribute('type', 'checkbox');
|
||||
chb2.setAttribute('id', 'chb2');
|
||||
chb2.setAttribute('class', 'shadow');
|
||||
chb2.setAttribute('slot', 'shadow');
|
||||
chb2.setAttribute('tabindex', '3');
|
||||
chb2.addEventListener('focus', A_07_02_04_T02.step_func(function(event) {
|
||||
assert_equals(counter++, 4, 'Point 2: wrong focus navigation order');
|
||||
|
@ -166,7 +166,7 @@ A_07_02_04_T02.step(unit(function (ctx) {
|
|||
var chb3 = d.createElement('input');
|
||||
chb3.setAttribute('type', 'checkbox');
|
||||
chb3.setAttribute('id', 'chb3');
|
||||
chb3.setAttribute('class', 'shadow');
|
||||
chb3.setAttribute('slot', 'shadow');
|
||||
chb3.setAttribute('tabindex', '2');
|
||||
chb3.addEventListener('focus', A_07_02_04_T02.step_func(function(event) {
|
||||
assert_equals(counter++, 1, 'Point 3: wrong focus navigation order');
|
||||
|
@ -175,10 +175,10 @@ A_07_02_04_T02.step(unit(function (ctx) {
|
|||
invoked[3] = false;
|
||||
host.appendChild(chb3);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML = '<content select=".shadow"></content>';
|
||||
div.innerHTML = '<slot name="shadow"></slot>';
|
||||
s.appendChild(div);
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
|
@ -265,7 +265,7 @@ A_07_02_04_T03.step(unit(function (ctx) {
|
|||
var host = d.createElement('div');
|
||||
host.setAttribute('tabindex', '1');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('type', 'text');
|
||||
|
@ -357,7 +357,7 @@ A_07_02_04_T04.step(unit(function (ctx) {
|
|||
var host = d.createElement('div');
|
||||
host.setAttribute('tabindex', '3');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var inp1 = d.createElement('input');
|
||||
inp1.setAttribute('type', 'text');
|
||||
|
|
|
@ -27,7 +27,7 @@ test(unit(function (ctx) {
|
|||
|
||||
var host = d.createElement('div');
|
||||
d.body.appendChild(host);
|
||||
var s = host.createShadowRoot();
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
|
||||
var span = d.createElement('span');
|
||||
span.innerHTML = 'Some text';
|
||||
|
@ -57,10 +57,11 @@ test(unit(function (ctx) {
|
|||
|
||||
var span = d.createElement('span');
|
||||
span.innerHTML = 'Some text';
|
||||
span.setAttribute('slot', 'span');
|
||||
host.appendChild(span);
|
||||
|
||||
var s = host.createShadowRoot();
|
||||
s.innerHTML = '<content select="span"></content>';
|
||||
var s = host.attachShadow({mode: 'open'});
|
||||
s.innerHTML = '<slot name="span"></slot>';
|
||||
|
||||
var range = d.createRange();
|
||||
range.setStart(span.firstChild, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue