diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface')
3 files changed, 94 insertions, 0 deletions
diff --git a/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/attributes/test-006.html b/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/attributes/test-006.html new file mode 100644 index 0000000000..bfbfde36e2 --- /dev/null +++ b/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/attributes/test-006.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> +<title>Shadow DOM Test: A_10_02_01_06</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-attributes"> +<meta name="assert" content="Extensions to Element Interface: shadowRoot of type ShadowRoot"> +<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> +test(function () { + + var d = newHTMLDocument(); + + var host = d.createElement('div'); + d.body.appendChild(host); + + assert_equals(host.shadowRoot, null, 'attribute shadowRoot must return null if no shadow tree is accesible'); + + +}, 'A_10_02_01_06_T01'); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/methods/test-001.html b/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/methods/test-001.html new file mode 100644 index 0000000000..c1c44980e1 --- /dev/null +++ b/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/methods/test-001.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<head> +<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: 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> +</head> +<body> +<div id="log"></div> +<script> +test(function () { + + var d = newHTMLDocument(); + + var host = d.createElement('div'); + d.body.appendChild(host); + + var s = host.attachShadow({mode: 'open'}); + + assert_true(s instanceof ShadowRoot, 'attachShadow() method should create new instance ' + + 'of ShadowRoot object'); + +}, 'A_10_02_02_01_T01'); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/methods/test-002.html b/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/methods/test-002.html new file mode 100644 index 0000000000..f7e1595a01 --- /dev/null +++ b/testing/web-platform/tests/shadow-dom/untriaged/elements-and-dom-objects/extensions-to-element-interface/methods/test-002.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> +<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: attachShadow method"> +<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(unit(function (ctx) { + + var d = newRenderedHTMLDocument(ctx); + + var host = d.createElement('div'); + d.body.appendChild(host); + + var span = d.createElement('span'); + span.innerHTML = 'Some text'; + host.appendChild(span); + + var s = host.attachShadow({mode: 'open'}); + + // span should become invisible as shadow root content + 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'); +</script> +</body> +</html> |