| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>This tests that we can subpixel position textareas properly.</title> |
| <style> |
| textarea { |
| width: 9px; |
| height: 9px; |
| position: fixed; |
| margin: 0px; |
| padding: 0px; |
| border: 0.5px solid black; |
| } |
| |
| div { |
| width: 5px; |
| height: 5px; |
| position: fixed; |
| background: green; |
| } |
| </style> |
| </head> |
| <body> |
| <p id="container"></p> |
| <script> |
| var container = document.getElementById("container"); |
| adjustment = 0.2; |
| w=20; h=20; |
| for (i = 0; i < 15; ++i) { |
| adjustment+=0.1; |
| for (j = 0; j < 15; ++j) { |
| var e = document.createElement("textarea"); |
| var topLeftY = ((w + 10) * i + j * adjustment); |
| var topLeftX = ((w + 10) * j + i * adjustment); |
| e.style.top = topLeftY + "px"; |
| e.style.left = topLeftX + "px"; |
| e.style.width = w + "px"; |
| e.style.height = h + "px"; |
| container.appendChild(e); |
| |
| var cover = document.createElement("div"); |
| cover.style.top = (topLeftY + h - h/2 + 1) + "px"; |
| cover.style.left = (topLeftX + w - w/2 + 1) + "px"; |
| cover.style.width = w/2 + "px"; |
| cover.style.height = h/2 + "px"; |
| container.appendChild(cover); |
| |
| w+=0.1; |
| h+=0.1; |
| } |
| } |
| </script> |
| </body> |
| </html> |