Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: LayoutTests/fast/dom/shadow/exposed-object-within-shadow.html

Issue 75273004: Add 'exposed' objects and embeds to a document's named properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test exposedness and shadow DOM trees Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 &lt;object&gt; and a &lt;div&gt;");
+ 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 &lt;div&gt; with an &lt;object&gt; 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 &lt;div&gt; with an &lt;object&gt; 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 &lt;div&gt; inside a &lt;param&gt; inside an &lt;object&gt;.");
+ 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>
+
+

Powered by Google App Engine
This is Rietveld 408576698