| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>This tests that Element.scroll* return integral values.</title> |
| <style> |
| div { |
| position: fixed; |
| width: 30px; |
| height: 30px; |
| border: 1px solid red; |
| overflow: scroll; |
| } |
| </style> |
| </head> |
| <body> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var container = document.body; |
| for (i = 0; i < 15; ++i) { |
| for (j = 0; j < 15; ++j) { |
| var e = document.createElement("div"); |
| e.style.top = (30 * i) + "px"; |
| e.style.left = (30 * j) + "px"; |
| e.innerHTML = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "; |
| container.appendChild(e); |
| } |
| } |
| |
| var result = ""; |
| var adjustment = 0; |
| var divs = document.getElementsByTagName("div"); |
| for (i = 0; i < divs.length; ++i) { |
| var element = divs[i]; |
| element.scrollTop = adjustment; |
| element.scrollLeft = adjustment; |
| result += "scrollTop:" + element.scrollTop.toFixed(2) + "scrollLeft:" + element.scrollLeft.toFixed(2) + "<br>"; |
| adjustment += 0.1; |
| } |
| document.body.innerHTML = result; |
| </script> |
| </body> |
| </html> |