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

Unified Diff: LayoutTests/svg/as-image/image-change-with-equal-sizes.html

Issue 23890043: Update image content rect on src changes even if intrinsic size matches (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | LayoutTests/svg/as-image/image-change-with-equal-sizes-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/as-image/image-change-with-equal-sizes.html
diff --git a/LayoutTests/svg/as-image/image-change-with-equal-sizes.html b/LayoutTests/svg/as-image/image-change-with-equal-sizes.html
new file mode 100644
index 0000000000000000000000000000000000000000..3b4b5a91b6d0f9be29a712262633f0da69f7eb48
--- /dev/null
+++ b/LayoutTests/svg/as-image/image-change-with-equal-sizes.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ crbug.com/269946: This test passes if there are two green squares with the same sizes.<br/>
+ <img id="image" width="100px" height="100px">
+ <img id="reference" width="100px" height="100px">
+
+ <script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ // base64 encoded SVG image of a 200x200 green square.
+ var greenSquare = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiPg0KICA8cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJncmVlbiIvPg0KPC9zdmc+DQo=';
+
+ document.getElementById('reference').src = greenSquare;
+ var image = document.getElementById('image');
+ image.src = greenSquare;
+
+ // Change the image to an external image with dimensions 200x200.
+ image.src = 'resources/200x200-blue-rect.svg';
+ image.onload = function() {
+ setTimeout(function() {
+ // Change the image back to a 200x200 green square and verify that
+ // the original dimensions are restored.
+ image.src = greenSquare;
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }
+ </script>
+</body>
+</html>
+
« no previous file with comments | « no previous file | LayoutTests/svg/as-image/image-change-with-equal-sizes-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698