| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <script src="../../resources/run-after-layout-and-paint.js"></script> | 3 <script src="../../resources/run-after-layout-and-paint.js"></script> |
| 4 | 4 |
| 5 <style> | 5 <style> |
| 6 img, canvas { margin: 5px; width: 48% } | 6 img, canvas { margin: 5px; width: 48% } |
| 7 </style> | 7 </style> |
| 8 | 8 |
| 9 <body style="overflow: hidden"> | 9 <body style="overflow: hidden"> |
| 10 <!-- The _blue_ sector of the <img> image should be at 12 o'clock. --> | 10 <!-- The _blue_ sector of the <img> image should be at 12 o'clock. --> |
| 11 <img> | 11 <img> |
| 12 <!-- The red sector of the <canvas> image should be at 12 o'clock. --> | 12 <!-- The red sector of the <canvas> image should be at 12 o'clock. --> |
| 13 <canvas></canvas> | 13 <canvas></canvas> |
| 14 </body> | 14 </body> |
| 15 | 15 |
| 16 <script> | 16 <script> |
| 17 if (window.testRunner) { | 17 if (window.testRunner) { |
| 18 // The pixel result will be the drag image. The blue sector if the | 18 // The pixel result will be the drag image. The blue sector if the |
| 19 // drag image should be at 12 o'clock. | 19 // drag image should be at 12 o'clock. |
| 20 testRunner.dumpDragImage(); | 20 testRunner.dumpDragImage(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 window.onload = function() { | 23 window.onload = function() { |
| 24 if (window.internals) | |
| 25 internals.settings.setImageColorProfilesEnabled(true); | |
| 26 if (window.testRunner) | 24 if (window.testRunner) |
| 27 testRunner.waitUntilDone(); | 25 testRunner.waitUntilDone(); |
| 28 | 26 |
| 29 var image = document.querySelector('img'); | 27 var image = document.querySelector('img'); |
| 30 image.onload = function() { | 28 image.onload = function() { |
| 31 runAfterLayoutAndPaint(window.testRunner ? changeColorProfile : profileChang
ed); | 29 runAfterLayoutAndPaint(window.testRunner ? changeColorProfile : profileChang
ed); |
| 32 }; | 30 }; |
| 33 | 31 |
| 34 image.src = 'resources/red-at-12-oclock-with-color-profile.jpg'; | 32 image.src = 'resources/red-at-12-oclock-with-color-profile.jpg'; |
| 35 }; | 33 }; |
| 36 | 34 |
| 37 function changeColorProfile() { | 35 function changeColorProfile() { |
| 38 window.testRunner.setColorProfile('whacked', profileChanged); | 36 window.testRunner.setColorProfile('colorSpin', profileChanged); |
| 39 } | 37 } |
| 40 | 38 |
| 41 function profileChanged() { | 39 function profileChanged() { |
| 42 setTimeout(drawImagePatternToCanvas, 0); | 40 setTimeout(drawImagePatternToCanvas, 0); |
| 43 } | 41 } |
| 44 | 42 |
| 45 function drawImagePatternToCanvas() { | 43 function drawImagePatternToCanvas() { |
| 46 var canvas = document.querySelector('canvas'); | 44 var canvas = document.querySelector('canvas'); |
| 47 var ctx = canvas.getContext('2d'); | 45 var ctx = canvas.getContext('2d'); |
| 48 var pattern = ctx.createPattern(document.querySelector('img'), null); | 46 var pattern = ctx.createPattern(document.querySelector('img'), null); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 74 eventSender.mouseMoveTo(x + 100, y + 100); | 72 eventSender.mouseMoveTo(x + 100, y + 100); |
| 75 eventSender.mouseUp(); | 73 eventSender.mouseUp(); |
| 76 } | 74 } |
| 77 | 75 |
| 78 if (window.testRunner) | 76 if (window.testRunner) |
| 79 setTimeout(function() { window.testRunner.notifyDone() }, 100); | 77 setTimeout(function() { window.testRunner.notifyDone() }, 100); |
| 80 } | 78 } |
| 81 | 79 |
| 82 </script> | 80 </script> |
| 83 </html> | 81 </html> |
| OLD | NEW |