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

Unified Diff: third_party/WebKit/LayoutTests/svg/custom/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change.html

Issue 2230963002: SVG Image intrinsic size should be used if css style size is 'auto' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename file Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/svg/custom/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change.html
diff --git a/third_party/WebKit/LayoutTests/svg/custom/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change.html b/third_party/WebKit/LayoutTests/svg/custom/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change.html
new file mode 100644
index 0000000000000000000000000000000000000000..e7281042ddcd946cb1351d35727e7a03c6c6cd33
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/custom/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<title>Test <svg:image>'s sizing with css size as auto, with dynamic image change</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg height="0">
+ <image width="200" height="200" xlink:href="resources/square-green-checker.png" style="width:auto; height:auto"/>
+</svg>
+<script>
+window.onload = function () {
+ async_test(function(t) {
fs 2016/08/19 08:59:45 Switch the order of these two lines, and use a ste
Shanmuga Pandi 2016/09/14 09:20:16 Done.
+ var image = document.getElementsByTagName('image')[0];
fs 2016/08/19 08:59:45 querySelector('image')
Shanmuga Pandi 2016/09/14 09:20:16 Done.
+ var rectBBox = image.getBBox();
+ assert_equals(rectBBox.width, 400);
+ assert_equals(rectBBox.height, 400);
+ image.setAttributeNS("http://www.w3.org/1999/xlink","href","data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'></svg>");
+ image.onload = t.step_func_done(function() {
+ var rectBBox = image.getBBox();
+ assert_equals(rectBBox.width, 100);
+ assert_equals(rectBBox.height, 100);
+ });
+ }, document.title + ' and box size should be ' + '100 100');
fs 2016/08/19 08:59:45 I think you can go with the default testname here.
Shanmuga Pandi 2016/09/14 09:20:16 Done.
+};
+</script>

Powered by Google App Engine
This is Rietveld 408576698