Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / images / huge-image-viewport-scale.html
blob4d4cfe81d505795ba1425fab1d609e0e318aa166
1 <!DOCTYPE html>
2 <script src="../../resources/run-after-layout-and-paint.js"></script>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.setCanOpenWindows();
7 testRunner.waitUntilDone();
10 onload = function() {
11 var newWindow = window.open('resources/5000x5000.png', 'image', 'width=100,height=150');
12 if (newWindow.internals)
13 newWindow.internals.settings.setViewportEnabled(true);
14 newWindow.onload = function() {
15 runAfterLayoutAndPaint(function() {
16 document.getElementById('output').textContent =
17 '\nviewport meta: ' + newWindow.document.querySelector('meta').outerHTML
18 + '\nimage style: ' + newWindow.document.querySelector('img').getAttribute('style')
19 + '\nimage actual width: ' + newWindow.document.querySelector('img').offsetWidth;
20 if (window.testRunner)
21 testRunner.notifyDone();
22 });
25 </script>
26 Tests huge image scaling when viewport is enabled. Requires DumpRenderTree.<br>
27 To manual test, open resources/5000x5000.png in a viewport-capable browser (e.g. on Android or enable viewport emulation in DevTools).<br>
28 Passes if the image shinks to fit the width.<br>
29 <pre id="output"></pre>