diff options
Diffstat (limited to 'layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html')
-rw-r--r-- | layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html b/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html index 29a850e90..c58b9cfbd 100644 --- a/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html +++ b/layout/reftests/webcomponents/dynamic-insertion-point-distribution-2.html @@ -5,9 +5,13 @@ <body> <div id="host"></div> <script> - var host = document.getElementById("host"); - var root = host.createShadowRoot(); - root.innerHTML = "<span>a</span>"; + var host, root; + + function run() { + host = document.getElementById("host"); + root = host.createShadowRoot(); + root.innerHTML = "<span>a</span>"; + } function tweak() { var span = document.createElement("span"); @@ -20,7 +24,12 @@ document.documentElement.removeAttribute("class"); } - window.addEventListener("MozReftestInvalidate", tweak, false); + if (document.body.createShadowRoot) { + run(); + window.addEventListener("MozReftestInvalidate", tweak); + } else { + document.documentElement.className = ""; + } </script> </body> </html> |