Index: LayoutTests/svg/custom/inline-svg-use-available-width.html |
diff --git a/LayoutTests/svg/custom/inline-svg-use-available-width.html b/LayoutTests/svg/custom/inline-svg-use-available-width.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f2ec6f55408c4a3b81f6f38f7f8ad1af7b452792 |
--- /dev/null |
+++ b/LayoutTests/svg/custom/inline-svg-use-available-width.html |
@@ -0,0 +1,41 @@ |
+<!doctype html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<style> |
+ .rel { |
+ position: relative; |
+ width: 400px; |
+ height: 200px; |
+ } |
+ .abs { |
+ position: absolute; |
+ left: 100px; |
+ right: 100px; |
+ } |
+ .test { |
+ display: block; |
+ background: red; |
+ } |
+ .control { /* overlay to hide the red */ |
+ position: absolute; |
+ left: 100px; |
+ width: 200px; |
+ height: 200px; |
+ background-color: green; |
+ } |
+</style> |
+<div class="rel"> |
+ <div class="abs"> |
+ <svg class="test" viewBox="0 0 1 1"> |
+ </svg> |
+ </div> |
+ <div class="control"> |
+ </div> |
+</div> |
+<script> |
+ test(function() { |
+ var bounds = document.querySelector('.test').getBoundingClientRect(); |
+ assert_equals(bounds.width, 200); |
+ assert_equals(bounds.height, 200); |
+ }, "Use available width and use intrinsic ratio to compute height"); |
+</script> |