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

Side by Side Diff: LayoutTests/fast/hidpi/resources/svg_canvas_helper.js

Issue 25105004: Use srcset's resource pixel density to determine intrinsic size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cleantests
Patch Set: Fixed crash+rebased Created 7 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 function printSizes(imageId, outputId) {
2 var image = document.getElementById(imageId);
3 image.addEventListener('load', function() {
4 var output = document.getElementById(outputId);
5 output.innerHTML = 'image stats: '
6 + 'size(' + image.width + ',' + image.height + '), '
7 + 'naturalSize(' + image.naturalWidth + ',' + image.naturalHeight + ')<b r/>'
8 + 'image codes: '
9 + image.outerHTML.replace(/</g, "&lt;").replace(/>/g, "&gt;");
10 });
11 }
12
13 function drawCanvas(imageId, canvasId, canvasWidth, canvasHeight) {
14 var image = document.getElementById(imageId);
15 var canvas = document.getElementById(canvasId);
16 canvas.width = canvasWidth;
17 canvas.height = canvasHeight;
18 var context = canvas.getContext('2d');
19 context.drawImage(image, 0, 0);
20 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/hidpi/resources/srcset-helper.js ('k') | LayoutTests/fast/hidpi/resources/svg_tests.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698