summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/shadow/svg-style-in-shadow-tree.xhtml
blob: 6a84e228547469aec74747e7b33fcde999a02092 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
rect {
  fill: red;
};
</style>
</head>
<body>
<div id='container'>
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
  <rect x="0" y="0" width="200" height="200"></rect>
  <g is="x-rect"></g>
</svg>
</div>
<script type="text/javascript">
<![CDATA[
document.registerElement("x-rect", {
  extends: "g",
  prototype: {
    __proto__: SVGRectElement.prototype,
    createdCallback: function() {
      this.createShadowRoot();
      this.shadowRoot.innerHTML =
        '<style>rect { fill: blue; }</style><rect width="100" height="100" x="0" y="0"></rect>';
    }
  }
});
]]>
</script>
</body>
</html>