| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta name='viewport' content='initial-scale=1'> |
| <script> |
| function imageOverlaysAsText() |
| { |
| const result = []; |
| for (const image of Array.from(document.images)) { |
| const root = internals.shadowRoot(image); |
| if (!root) |
| continue; |
| |
| const overlay = root.getElementById("image-overlay"); |
| if (!overlay) |
| continue; |
| |
| result.push(overlay.textContent); |
| } |
| return result; |
| } |
| |
| function appendImage(imageSource) |
| { |
| const image = document.createElement("img"); |
| image.src = imageSource; |
| document.body.appendChild(image); |
| } |
| |
| async function appendAndLoadSubframe(source) |
| { |
| const frame = document.createElement("iframe"); |
| frame.src = source; |
| await new Promise(resolve => { |
| frame.addEventListener("load", resolve); |
| document.body.appendChild(frame); |
| }); |
| } |
| |
| function hideAllImages() |
| { |
| Array.from(document.images).forEach(image => image.style.setProperty("display", "none")); |
| } |
| |
| function showAllImages() |
| { |
| Array.from(document.images).forEach(image => image.style.removeProperty("display")); |
| } |
| </script> |
| </head> |
| <body style='margin: 0px;'> |
| <p>large-red-square.png</p> |
| <img src="large-red-square.png"> |
| <p>sunset-in-cupertino-200px.png</p> |
| <img src="sunset-in-cupertino-200px.png"> |
| <p>test.jpg</p> |
| <img src="test.jpg"> |
| <p>400x400-green.png</p> |
| <img src="400x400-green.png"> |
| <p>sunset-in-cupertino-100px.tiff</p> |
| <img src="sunset-in-cupertino-100px.tiff"> |
| </body> |
| </html> |