scroll-rounding.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. text-overflow:ellipsis;
  19. overflow:auto;
  20. width:100px;
  21. height:50px;
  22. border:1px solid black;
  23. white-space:pre;
  24. margin-left:90px;
  25. margin-bottom:20px;
  26. }
  27. .rtl {
  28. direction:rtl; margin-left:0;
  29. }
  30. .ltr {
  31. direction:ltr;
  32. }
  33. .t1 {width:100.1px;}
  34. .t2 {width:100.2px;}
  35. .t4 {width:100.4px;}
  36. s {position:absolute; background:black; z-index:1; }
  37. #mask1 {top:0; left:60px; width:70px; height:100%; }
  38. #mask2 {top:30px; left:0; width:100%; height:30px; }
  39. #mask3 {top:100px; left:0; width:100%; height:30px; }
  40. #mask4 {top:170px; left:0; width:100%; height:30px; }
  41. #mask5 {top:240px; left:0; width:100%; height:30px; }
  42. #mask6 {top:320px; left:0; width:100%; height:30px; }
  43. #mask7 {top:390px; left:0; width:100%; height:30px; }
  44. #mask8 {top:460px; left:0; width:100%; height:30px; }
  45. #mask9 {top:530px; left:0; width:100%; height:30px; }
  46. </style>
  47. <script>
  48. function scrolldivs() {
  49. var divs = document.getElementsByTagName('div');
  50. for (i = 0; i < divs.length; ++i) {
  51. if (window.getComputedStyle(divs[i]).direction == 'ltr')
  52. divs[i].scrollLeft = 99999999;
  53. else
  54. divs[i].scrollLeft = -99999999;
  55. }
  56. document.documentElement.removeAttribute('class');
  57. }
  58. </script>
  59. </head><body onload="scrolldivs()">
  60. <s id="mask1"></s>
  61. <s id="mask2"></s>
  62. <s id="mask3"></s>
  63. <s id="mask4"></s>
  64. <s id="mask5"></s>
  65. <s id="mask6"></s>
  66. <s id="mask7"></s>
  67. <s id="mask8"></s>
  68. <s id="mask9"></s>
  69. <div class="test">HelloKittyוסוכנויות</div>
  70. <div class="test rtl">HelloKittyוסוכנויות</div>
  71. <div class="test t1">HelloKittyוסוכנויות</div>
  72. <div class="test rtl t1">HelloKittyוסוכנויות</div>
  73. <div class="test t2">HelloKittyוסוכנויות</div>
  74. <div class="test rtl t2">HelloKittyוסוכנויות</div>
  75. <div class="test t4">HelloKittyוסוכנויות</div>
  76. <div class="test rtl t4">HelloKittyוסוכנויות</div>
  77. </body>
  78. </html>