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

Unified Diff: LayoutTests/svg/as-image/svg-as-image-intrinsic-size.html

Issue 308643002: Teach SVGImage::containerSize() to deduce intrinsic values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@remove-text-zoom-factor
Patch Set: Lower timeout and use expandedIntSize Created 6 years, 6 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 | « LayoutTests/svg/as-image/resources/link.svg ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/as-image/svg-as-image-intrinsic-size.html
diff --git a/LayoutTests/svg/as-image/svg-as-image-intrinsic-size.html b/LayoutTests/svg/as-image/svg-as-image-intrinsic-size.html
new file mode 100644
index 0000000000000000000000000000000000000000..09d8a993b975ebde364315f256387b3667d92536
--- /dev/null
+++ b/LayoutTests/svg/as-image/svg-as-image-intrinsic-size.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>Test that intrinsic height can be resolved</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' viewBox='0 180 150 220' style='background:blue'></svg>">
+<img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' height='440' viewBox='0 180 150 220' style='background:purple'></svg>">
+<script>
+ var imgs = document.getElementsByTagName('img');
+ function waitForComplete(img, i) {
+ if (img.complete) {
+ assert_equals(img.width, 300);
+ assert_equals(img.height, 440);
+ this.done();
+ } else {
+ setTimeout(t.step_func(waitForComplete.bind(this, img, i + 1)), 1);
+ }
+ }
+
+ var t1 = async_test("Test that intrinsic height can be calculated from intrinsic width and intrinsic ratio");
+ t1.step(waitForComplete.bind(t1, imgs[0], 0));
+
+ var t2 = async_test("Test that intrinsic width can be calculated from intrinsic height and intrinsic ratio");
+ t2.step(waitForComplete.bind(t2, imgs[1], 0));
+</script>
« no previous file with comments | « LayoutTests/svg/as-image/resources/link.svg ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698