Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / svg / foreignObject / fO-percentage-height-style.html
1 <!doctype html>
2 <script src="../../resources/js-test.js"></script>
3 <svg viewBox="0 0 250 250">
4   <foreignObject width="250" height="250">
5     <svg style="height:100%; background: blue">
6     </svg>
7   </foreignObject>
8 </svg>
9 <script>
10   description("Test use of percentages inside foreignObject");
11
12   var nestedSvg = document.querySelectorAll('svg')[1];
13   shouldBe("nestedSvg.offsetHeight", "250");
14
15   nestedSvg.style.height = "50%";
16   shouldBe("nestedSvg.offsetHeight", "125");
17
18   var foreignObject = nestedSvg.parentNode;
19   foreignObject.height.baseVal.value = 400;
20   shouldBe("nestedSvg.offsetHeight", "200");
21 </script>