| OLD | NEW |
| (Empty) |
| 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(); | |
| 8 } | |
| 9 | |
| 10 onload = function() { | |
| 11 var newWindow = window.open('resources/5000x5000.png', 'image', 'width=100,hei
ght=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').outerHT
ML | |
| 18 + '\nimage style: ' + newWindow.document.querySelector('img').getAttri
bute('style') | |
| 19 + '\nimage actual width: ' + newWindow.document.querySelector('img').o
ffsetWidth; | |
| 20 if (window.testRunner) | |
| 21 testRunner.notifyDone(); | |
| 22 }); | |
| 23 }; | |
| 24 } | |
| 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> | |
| OLD | NEW |