scroll-rounding-ref.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE HTML>
  2. <!--
  3. Any copyright is dedicated to the Public Domain.
  4. http://creativecommons.org/licenses/publicdomain/
  5. Test: 1px scroll rounding at the end position
  6. -->
  7. <html class="reftest-wait"><head>
  8. <title>text-overflow: scroll rounding</title>
  9. <style type="text/css">
  10. @font-face {
  11. font-family: DejaVuSansMono;
  12. src: url(../fonts/DejaVuSansMono.woff);
  13. }
  14. html,body {
  15. color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
  16. }
  17. .test {
  18. overflow:auto;
  19. width:100px;
  20. height:50px;
  21. border:1px solid black;
  22. white-space:pre;
  23. margin-left:90px;
  24. margin-bottom:20px;
  25. }
  26. .rtl {
  27. direction:rtl; margin-left:0;
  28. }
  29. .ltr {
  30. direction:ltr;
  31. }
  32. .t1 {width:100.1px;}
  33. .t2 {width:100.2px;}
  34. .t4 {width:100.4px;}
  35. s {position:absolute; background:black; z-index:1; }
  36. #mask1 {top:0; left:60px; width:70px; height:100%; }
  37. #mask2 {top:30px; left:0; width:100%; height:30px; }
  38. #mask3 {top:100px; left:0; width:100%; height:30px; }
  39. #mask4 {top:170px; left:0; width:100%; height:30px; }
  40. #mask5 {top:240px; left:0; width:100%; height:30px; }
  41. #mask6 {top:320px; left:0; width:100%; height:30px; }
  42. #mask7 {top:390px; left:0; width:100%; height:30px; }
  43. #mask8 {top:460px; left:0; width:100%; height:30px; }
  44. #mask9 {top:530px; left:0; width:100%; height:30px; }
  45. </style>
  46. <script>
  47. function scrolldivs() {
  48. var divs = document.getElementsByTagName('div');
  49. for (i = 0; i < divs.length; ++i) {
  50. if (window.getComputedStyle(divs[i]).direction == 'ltr')
  51. divs[i].scrollLeft = 99999999;
  52. else
  53. divs[i].scrollLeft = -99999999;
  54. }
  55. document.documentElement.removeAttribute('class');
  56. }
  57. </script>
  58. </head><body onload="scrolldivs()">
  59. <s id="mask1"></s>
  60. <s id="mask2"></s>
  61. <s id="mask3"></s>
  62. <s id="mask4"></s>
  63. <s id="mask5"></s>
  64. <s id="mask6"></s>
  65. <s id="mask7"></s>
  66. <s id="mask8"></s>
  67. <s id="mask9"></s>
  68. <div class="test">HelloKittyוסוכנויות</div>
  69. <div class="test rtl">HelloKittyוסוכנויות</div>
  70. <div class="test t1">HelloKittyוסוכנויות</div>
  71. <div class="test rtl t1">HelloKittyוסוכנויות</div>
  72. <div class="test t2">HelloKittyוסוכנויות</div>
  73. <div class="test rtl t2">HelloKittyוסוכנויות</div>
  74. <div class="test t4">HelloKittyוסוכנויות</div>
  75. <div class="test rtl t4">HelloKittyוסוכנויות</div>
  76. </body>
  77. </html>