Bug 1025724 - Add some shadow tree style tests. r?bz draft
authorCameron McCormack <cam@mcc.id.au>
Thu, 05 Apr 2018 15:41:10 +0800
changeset 777702 8e3a25a4a20f0f34a0afa3916b7e18981af70f5f
parent 777562 071ee904485e21e19ca08456d32bce6825b77a26
push id105267
push userbmo:cam@mcc.id.au
push dateThu, 05 Apr 2018 07:53:25 +0000
reviewersbz
bugs1025724
milestone61.0a1
Bug 1025724 - Add some shadow tree style tests. r?bz MozReview-Commit-ID: 3d9ewWoM8Mo
layout/reftests/webcomponents/reftest.list
layout/reftests/webcomponents/shadow-style-1-ref.html
layout/reftests/webcomponents/shadow-style-1.html
layout/reftests/webcomponents/shadow-style-2-ref.html
layout/reftests/webcomponents/shadow-style-2.html
layout/reftests/webcomponents/shadow-style-3-ref.html
layout/reftests/webcomponents/shadow-style-3.html
--- a/layout/reftests/webcomponents/reftest.list
+++ b/layout/reftests/webcomponents/reftest.list
@@ -16,8 +16,11 @@ pref(dom.webcomponents.shadowdom.enabled
 pref(dom.webcomponents.shadowdom.enabled,true) == style-sharing.html style-sharing-ref.html
 pref(dom.webcomponents.shadowdom.enabled,true) == style-sharing-across-shadow.html style-sharing-ref.html # bug 1412400
 pref(dom.webcomponents.shadowdom.enabled,true) == basic-slot-1.html basic-slot-1-ref.html
 pref(dom.webcomponents.shadowdom.enabled,true) == basic-slot-2.html basic-slot-2-ref.html
 pref(dom.webcomponents.shadowdom.enabled,true) == basic-slot-3.html basic-slot-3-ref.html
 pref(dom.webcomponents.shadowdom.enabled,true) == basic-slot-4.html basic-slot-3-ref.html
 pref(dom.webcomponents.shadowdom.enabled,true) == basic-slot-5.html basic-slot-5-ref.html
 pref(dom.webcomponents.shadowdom.enabled,true) == basic-slot-6.html basic-slot-6-ref.html
+pref(dom.webcomponents.shadowdom.enabled,true) == shadow-style-1.html shadow-style-1-ref.html
+pref(dom.webcomponents.shadowdom.enabled,true) == shadow-style-2.html shadow-style-2-ref.html
+pref(dom.webcomponents.shadowdom.enabled,true) == shadow-style-3.html shadow-style-3-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webcomponents/shadow-style-1-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="color: green">This should be green.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webcomponents/shadow-style-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+<style>
+body { color: red; }
+</style>
+<script>
+var div = document.createElement("div");
+var shadow = div.attachShadow({ mode: "open" });
+shadow.innerHTML = '<style>p { color: green; }</style><p>This should be green.</p>';
+document.body.appendChild(div);
+</script>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webcomponents/shadow-style-2-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="color: green">This should be green.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webcomponents/shadow-style-2.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<body>
+<style>
+body { color: red; }
+</style>
+<script>
+var div = document.createElement("div");
+var shadow = div.attachShadow({ mode: "open" });
+shadow.innerHTML = '<p>This should be green.</p>';
+document.body.appendChild(div);
+shadow.firstChild.offsetTop;
+var style = document.createElement("style");
+style.textContent = 'p { color: green; }';
+shadow.appendChild(style);
+</script>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webcomponents/shadow-style-3-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="color: green">This should be green.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webcomponents/shadow-style-3.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<body>
+<style>
+body { color: red; }
+</style>
+<script>
+var div = document.createElement("div");
+var shadow = div.attachShadow({ mode: "open" });
+var div2 = document.createElement("div");
+var shadow2 = div2.attachShadow({ mode: "open" });
+shadow2.innerHTML = '<style>p { color: green; }</style><p>This should be green.</p>';
+shadow.appendChild(div2);
+document.body.appendChild(div);
+</script>