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

Unified Diff: LayoutTests/svg/custom/svg-image-container-size.html

Issue 889613002: Make sure a container size is always set for SVG images in <svg:image> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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: LayoutTests/svg/custom/svg-image-container-size.html
diff --git a/LayoutTests/svg/custom/svg-image-container-size.html b/LayoutTests/svg/custom/svg-image-container-size.html
new file mode 100644
index 0000000000000000000000000000000000000000..193b520cdb08b97fb38ede33dd3a3622dd8c1372
--- /dev/null
+++ b/LayoutTests/svg/custom/svg-image-container-size.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<script src=../../resources/run-after-display.js></script>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+function insertSVGImage() {
+ var image = document.createElementNS('http://www.w3.org/2000/svg', 'image');
+ image.setAttribute('width', 192);
+ image.setAttribute('height', 64);
+ image.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'resources/rgb.svg');
+ image.onload = function() {
+ runAfterDisplay(function() {
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ };
+ document.querySelector('g').appendChild(image);
+}
+
+function startTest() {
+ if (window.testRunner)
+ testRunner.displayAsyncThen(insertSVGImage);
+ else
+ requestAnimationFrame(insertSVGImage);
+}
+</script>
+<svg width="384" height="128" style="display: block">
+ <g transform="scale(2)"></g>
+</svg>
+<div>
+ <img src="resources/rgb.svg" onload="startTest()" style="width: 384px; height: 128px;">
+</div>

Powered by Google App Engine
This is Rietveld 408576698