diff options
Diffstat (limited to 'layout/reftests/webcomponents')
5 files changed, 47 insertions, 14 deletions
diff --git a/layout/reftests/webcomponents/cross-tree-selection-1.html b/layout/reftests/webcomponents/cross-tree-selection-1.html index 1e4f02747..01e7317f2 100644 --- a/layout/reftests/webcomponents/cross-tree-selection-1.html +++ b/layout/reftests/webcomponents/cross-tree-selection-1.html @@ -3,6 +3,11 @@ <head> <script> function tweak() { + if (!document.body.createShadowRoot) { + document.documentElement.className = ""; + return; + } + var host = document.getElementById("host"); var shadow = host.createShadowRoot(); diff --git a/layout/reftests/webcomponents/dynamic-insertion-point-distribution-1.html b/layout/reftests/webcomponents/dynamic-insertion-point-distribution-1.html index aefe84f25..8919a9c6a 100644 --- a/layout/reftests/webcomponents/dynamic-insertion-point-distribution-1.html +++ b/layout/reftests/webcomponents/dynamic-insertion-point-distribution-1.html @@ -7,9 +7,11 @@ <script> var host, root; - host = document.getElementById("host"); - root = host.attachShadow({mode: 'open'}); - root.innerHTML = 'a <slot></slot> c'; + function run() { + host = document.getElementById("host"); + root = host.createShadowRoot(); + root.innerHTML = 'a <content></content> c'; + } function tweak() { var span = document.createElement("span"); @@ -21,7 +23,12 @@ document.documentElement.removeAttribute("class"); } - window.addEventListener("MozReftestInvalidate", tweak); + if (document.body.createShadowRoot) { + run(); + window.addEventListener("MozReftestInvalidate", tweak, false); + } else { + document.documentElement.className = ""; + } </script> </body> </html> diff --git a/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html b/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html index d753af09c..c58b9cfbd 100644 --- a/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html +++ b/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html @@ -7,9 +7,11 @@ <script> var host, root; - host = document.getElementById("host"); - root = host.attachShadow({mode: 'open'}); - root.innerHTML = "<span>a</span>"; + function run() { + host = document.getElementById("host"); + root = host.createShadowRoot(); + root.innerHTML = "<span>a</span>"; + } function tweak() { var span = document.createElement("span"); @@ -22,7 +24,12 @@ document.documentElement.removeAttribute("class"); } - window.addEventListener("MozReftestInvalidate", tweak); + if (document.body.createShadowRoot) { + run(); + window.addEventListener("MozReftestInvalidate", tweak); + } else { + document.documentElement.className = ""; + } </script> </body> </html> diff --git a/layout/reftests/webcomponents/input-transition-1.html b/layout/reftests/webcomponents/input-transition-1.html index c11444d05..a4be5271b 100644 --- a/layout/reftests/webcomponents/input-transition-1.html +++ b/layout/reftests/webcomponents/input-transition-1.html @@ -7,9 +7,11 @@ <script> var host, root; - host = document.getElementById("host"); - root = host.attachShadow({mode: 'open'}); - root.innerHTML = '<style>input ~ div { background: red; transition: background 100ms; } input:checked ~ div { background: green; }</style><input id="one" type="checkbox"><div style="height: 50px; width: 50px;"></div>'; + function run() { + host = document.getElementById("host"); + root = host.createShadowRoot(); + root.innerHTML = '<style>input ~ div { background: red; transition: background 100ms; } input:checked ~ div { background: green; }</style><input id="one" type="checkbox"><div style="height: 50px; width: 50px;"></div>'; + } function tweak() { var el = root.getElementById("one"); @@ -19,7 +21,12 @@ }); } - window.addEventListener("MozReftestInvalidate", tweak); + if (document.body.createShadowRoot) { + run(); + window.addEventListener("MozReftestInvalidate", tweak); + } else { + document.documentElement.className = ""; + } </script> </body> </html> diff --git a/layout/reftests/webcomponents/update-dist-node-descendants-1.html b/layout/reftests/webcomponents/update-dist-node-descendants-1.html index 003c23394..3ba96594b 100644 --- a/layout/reftests/webcomponents/update-dist-node-descendants-1.html +++ b/layout/reftests/webcomponents/update-dist-node-descendants-1.html @@ -6,8 +6,10 @@ <div id="outer"><span id="distnode">text</span></div> <script> - var shadowRoot = document.getElementById('outer').attachShadow({mode: 'open'}); - shadowRoot.innerHTML = '<div><slot></slot></div>'; +function run() { + var shadowRoot = document.getElementById('outer').createShadowRoot(); + shadowRoot.innerHTML = '<div><content></content></div>'; +} function tweak() { var distNode = document.getElementById("distnode"); @@ -16,7 +18,12 @@ document.documentElement.removeAttribute("class"); } +if (document.body.createShadowRoot) { + run(); window.addEventListener("MozReftestInvalidate", tweak); +} else { + document.documentElement.className = ""; +} </script> </body> </html> |