| Index: LayoutTests/fast/dom/shadow/exposed-object-within-shadow.html
|
| diff --git a/LayoutTests/fast/dom/shadow/exposed-object-within-shadow.html b/LayoutTests/fast/dom/shadow/exposed-object-within-shadow.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6d641004092851224d5d15ca58dc66c3cf3cdaff
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/dom/shadow/exposed-object-within-shadow.html
|
| @@ -0,0 +1,113 @@
|
| +<!doctype html>
|
| +<html>
|
| +<head>
|
| +<script src="../../../resources/js-test.js"></script>
|
| +</head>
|
| +<body>
|
| +<object id="o1" name="obj1"><div></div></object>
|
| +<object id="o2" name="obj2"><param name="n"><div></div></param></object>
|
| +<script>
|
| +var obj;
|
| +var host;
|
| +var shadowRoot;
|
| +var child;
|
| +
|
| +function testAncestorObjectDivShadow() {
|
| + debug("Shadow DOM inside an <object> and a <div>");
|
| + obj = document.getElementById("o1");
|
| + host = obj.querySelector("div");
|
| + shadowRoot = host.createShadowRoot();
|
| +
|
| + child = document.createElement("object");
|
| + child.name = "obj1-child1";
|
| + shadowRoot.appendChild(child);
|
| +
|
| + // Inner <object> not visible for two reasons:
|
| + // <object> ancestor + shadow root in-between.
|
| + shouldBeFalse("child.name in document");
|
| + shouldBeFalse("child.name in window");
|
| +
|
| + // Should be able to see 'obj'..even with a descendant <object>, but hidden by shadow.
|
| + shouldBeTrue("obj.name in document");
|
| +}
|
| +
|
| +function testSiblingObjectShadow() {
|
| + debug("Shadow DOM attached to <div> with an <object> sibling (next).");
|
| + var div = document.createElement("div");
|
| + document.body.appendChild(div);
|
| + var div2 = document.createElement("div");
|
| + div.appendChild(div2);
|
| + obj = document.createElement("object");
|
| + obj.name = "obj3";
|
| + div2.appendChild(obj);
|
| + shadowRoot = div2.createShadowRoot();
|
| +
|
| + child = document.createElement("embed");
|
| + child.name = "embed1";
|
| + shadowRoot.appendChild(child);
|
| +
|
| + // <embed> not visible for two reasons:
|
| + // <object> ancestor + shadow root in-between.
|
| + shouldBeFalse("child.name in document");
|
| + shouldBeFalse("child.name in window");
|
| +
|
| + // Should be able to see 'obj'..even though it has an <embed> descendant.
|
| + shouldBeTrue("obj.name in document");
|
| +}
|
| +
|
| +function testSiblingShadowObject() {
|
| + debug("Shadow DOM attached to <div> with an <object> sibling (previous).");
|
| + var div = document.createElement("div");
|
| + document.body.appendChild(div);
|
| + var div2 = document.createElement("div");
|
| + div.appendChild(div2);
|
| + obj = document.createElement("object");
|
| + obj.name = "obj4";
|
| + div2.appendChild(obj);
|
| + shadowRoot = div2.createShadowRoot();
|
| +
|
| + child = document.createElement("embed");
|
| + child.name = "embed1";
|
| + shadowRoot.appendChild(child);
|
| +
|
| + // <embed> not visible for two reasons:
|
| + // <object> ancestor + shadow root in-between.
|
| + shouldBeFalse("child.name in document");
|
| + shouldBeFalse("child.name in window");
|
| +
|
| + // Should be able to see 'obj'..even though it has an <embed> descendant.
|
| + shouldBeTrue("obj.name in document");
|
| +}
|
| +
|
| +function testAncestorObjectParamShadow() {
|
| + debug("Shadow DOM attached to <div> inside a <param> inside an <object>.");
|
| + obj = document.getElementById("o2");
|
| +
|
| + // Should be able to see 'obj' initially.
|
| + shouldBeTrue("obj.name in document");
|
| +
|
| + host = obj.querySelector("div");
|
| + shadowRoot = host.createShadowRoot();
|
| +
|
| + child = document.createElement("embed");
|
| + child.name = "embed1";
|
| + shadowRoot.appendChild(child);
|
| +
|
| + // <embed> not visible for two reasons:
|
| + // <object> ancestor + shadow root in-between.
|
| + shouldBeFalse("child.name in document");
|
| + shouldBeFalse("child.name in window");
|
| +
|
| + // Should still be able to see 'obj'
|
| + shouldBeTrue("obj.name in document");
|
| +}
|
| +
|
| +testAncestorObjectDivShadow();
|
| +testSiblingObjectShadow();
|
| +testSiblingShadowObject();
|
| +testAncestorObjectParamShadow();
|
| +</script>
|
| +</body>
|
| +</html>
|
| +
|
| +
|
|
|