Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height.html

Issue 1681013004: Make object-sizing-zero-intrinsic-width-height a javascript test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 &lt;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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698