Index: third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height.html |
diff --git a/third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height.html b/third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height.html |
index c50f6b282be7f5cec41bad86f9e45b75ea3f4345..6632396776bce14dca808a9c4bcd8c75ea1721fc 100644 |
--- a/third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height.html |
+++ b/third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height.html |
@@ -1,36 +1,36 @@ |
<!DOCTYPE html> |
-<html> |
-<style> |
-object { |
- background: red; |
-} |
-</style> |
-<body style="margin: 0px; padding: 0px;"> |
- <!--There should not be any red rectangle visible. --> |
- <object data="data:image/svg+xml, |
+<title>SVG in <object> with zero intrinsic size</title> |
+<script src=../../resources/testharness.js></script> |
+<script src=../../resources/testharnessreport.js></script> |
+<object data-expected="0x0" data="data:image/svg+xml, |
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='0' height='0'> |
<rect width='50' height='50' fill='red'/> |
- </svg> |
- "></object> |
- <object data="data:image/svg+xml, |
+ </svg>"></object> |
+<object data-expected="50x0" data="data:image/svg+xml, |
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='50' height='0'> |
<rect width='50' height='50' fill='red'/> |
- </svg> |
- "></object> |
- <object data="data:image/svg+xml, |
+ </svg>"></object> |
+<object data-expected="0x50" data="data:image/svg+xml, |
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='0' height='50'> |
<rect width='50' height='50' fill='red'/> |
- </svg> |
- "></object> |
- <object data="data:image/svg+xml, |
+ </svg>"></object> |
+<object data-expected="0x150" data="data:image/svg+xml, |
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='0'> |
<rect width='50' height='50' fill='red'/> |
- </svg> |
- "></object> |
- <object data="data:image/svg+xml, |
+ </svg>"></object> |
+<object data-expected="300x0" data="data:image/svg+xml, |
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='0'> |
<rect width='50' height='50' fill='red'/> |
- </svg> |
- "></object> |
-</body> |
-</html> |
+ </svg>"></object> |
+<script> |
+Array.prototype.forEach.call(document.querySelectorAll('object'), function(element) { |
+ var t = async_test(document.title + " - " + element.dataset.expected); |
+ element.onload = function() { |
+ requestAnimationFrame(t.step_func(function() { |
+ var clientRect = element.getBoundingClientRect(); |
+ assert_equals(clientRect.width + "x" + clientRect.height, element.dataset.expected); |
+ t.done(); |
+ })); |
+ } |
+}); |
+</script> |