Index: LayoutTests/svg/foreignObject/fO-percentage-height-style.html |
diff --git a/LayoutTests/svg/foreignObject/fO-percentage-height-style.html b/LayoutTests/svg/foreignObject/fO-percentage-height-style.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2397096eb0a5363637121e931179e6ce6e97924b |
--- /dev/null |
+++ b/LayoutTests/svg/foreignObject/fO-percentage-height-style.html |
@@ -0,0 +1,20 @@ |
+<!doctype html> |
+<script src="../../resources/js-test.js"></script> |
+<svg viewBox="0 0 250 250"> |
+ <title>Test use of percentages inside foreignObject</title> |
+ <foreignobject width="250" height="250"> |
+ <svg style="height:100%; background: blue"> |
+ </svg> |
+ </foreignObject> |
+</svg> |
+<script> |
+ var nestedSvg = document.querySelectorAll('svg')[1]; |
+ shouldBe("nestedSvg.offsetHeight", "250"); |
+ |
+ nestedSvg.style.height = "50%"; |
+ shouldBe("nestedSvg.offsetHeight", "125"); |
+ |
+ var foreignObject = nestedSvg.parentNode; |
+ foreignObject.height.baseVal.value = 400; |
+ shouldBe("nestedSvg.offsetHeight", "200"); |
+</script> |