Bug 1025724 - Add some shadow tree style tests. r=bz
authorCameron McCormack <cam@mcc.id.au>
Thu, 05 Apr 2018 15:41:10 +0800
changeset 412086 fd8b1659a4abee793269b487f3f362b75e91782f
parent 412085 83a2d9c67bb62fa3355ea7cc0541c8c296190a40
child 412087 47406f36e6ab0f69141d3b2f006e494d4c9f03a0
push id33784
push usernerli@mozilla.com
push dateFri, 06 Apr 2018 21:54:36 +0000
treeherdermozilla-central@0e0ec6c01e25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1025724
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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>