Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | <html> |
michael@0 | 2 | <script> |
michael@0 | 3 | function sizeResizer() { |
michael@0 | 4 | // reference resizer |
michael@0 | 5 | var img = document.getElementsByTagName("img")[0]; |
michael@0 | 6 | // hidden textarea |
michael@0 | 7 | var textarea = document.getElementsByTagName("textarea")[0]; |
michael@0 | 8 | var width = 200 - textarea.clientWidth; |
michael@0 | 9 | var height = 200 - textarea.clientHeight; |
michael@0 | 10 | // (Leave test failing if a scrollbar is missing) |
michael@0 | 11 | if (width != 0 && height != 0) { |
michael@0 | 12 | img.style.width = width + "px"; |
michael@0 | 13 | img.style.left = textarea.clientWidth + "px"; |
michael@0 | 14 | img.style.height = height + "px"; |
michael@0 | 15 | img.style.top = textarea.clientHeight + "px"; |
michael@0 | 16 | } |
michael@0 | 17 | } |
michael@0 | 18 | </script> |
michael@0 | 19 | <body onload="sizeResizer()"> |
michael@0 | 20 | <textarea style="width: 200px; height: 200px; margin: 0; border: none; |
michael@0 | 21 | background: red; font-size: 400px;"> |
michael@0 | 22 | M |
michael@0 | 23 | </textarea> |
michael@0 | 24 | <div style="position: relative; top: -200px; |
michael@0 | 25 | width: 200px; height: 200px; margin: 0; border: none; |
michael@0 | 26 | background: lightgreen"> |
michael@0 | 27 | <img style="position: relative;" src="chrome://global/skin/icons/resizer.png"> |
michael@0 | 28 | </div> |
michael@0 | 29 | </body> |
michael@0 | 30 | </html> |