| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| body { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| </style> | |
| <script> | |
| // Create and attach the embed element. Called from the browser test with the | |
| // content_id. Optional embedId can be provided to give the embed an ID | |
| // attribute for later targeting. Set allowPinchZoom to add the corresponding | |
| // boolean attribute. | |
| function createEmbed(contentId, embedId, allowPinchZoom = false) { | |
| const embed = document.createElement('embed'); | |
| embed.setAttribute('data-content-id', contentId); | |
| embed.setAttribute('type', 'application/x-chromium-surface-embed'); | |
| if (allowPinchZoom) { | |
| embed.setAttribute('data-allow-pinch-zoom', ''); | |
| } | |
| embed.style.position = 'absolute'; | |
| embed.style.left = '10px'; | |
| const existingEmbeds = document.querySelectorAll('embed').length; | |
| embed.style.top = (10 + existingEmbeds * 110) + 'px'; | |
| embed.style.width = '100px'; | |
| embed.style.height = '100px'; | |
| if (embedId !== undefined) { | |
| embed.id = embedId; | |
| } | |
| document.body.appendChild(embed); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |