summaryrefslogtreecommitdiffstats
path: root/layout/reftests/scoped-style/scoped-style-dynamic-001.html
blob: 08251ea81953f38b4ba4dc48d0bd2e630dd5ca61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<body onload="f()">
  <p>First</p>
  <p>Second</p>
  <p>Third</p>
  <script>
    function f() {
      var p = document.getElementsByTagName("p")[1];
      var style = document.createElement("style");
      style.setAttribute("scoped", "");
      style.textContent = "p { color: green }";
      p.appendChild(style);
    }
  </script>
</body>