PageRenderTime 162ms CodeModel.GetById 15ms RepoModel.GetById 3ms app.codeStats 0ms

/third_party/blink/web_tests/wpt_internal/css/css-overflow/scrollbar-gutter-005.html

https://github.com/chromium/chromium
HTML | 128 lines | 107 code | 21 blank | 0 comment | 0 complexity | 6b51878b380e94ac4365388c9ddab9a0 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, Apache-2.0, BSD-3-Clause
  1. <!doctype html>
  2. <meta charset="utf-8">
  3. <title>CSS Overflow: test scrollbar-gutter: stable (classic scrollbars, vertical text)</title>
  4. <link rel="author" title="Felipe Erias Morandeira" href="mailto:felipeerias@gmail.com"/>
  5. <link rel="help" href="https://www.w3.org/TR/css-overflow-4/#scollbar-gutter-property"/>
  6. <meta name="assert" content="Test scrollbar-gutter: stable with custom classic scrollbars">
  7. <script src="/resources/testharness.js"></script>
  8. <script src="/resources/testharnessreport.js"></script>
  9. <script src="/css/support/parsing-testcommon.js"></script>
  10. <style>
  11. .container {
  12. scrollbar-gutter: stable;
  13. height: 200px;
  14. width: 200px;
  15. margin: 1px;
  16. padding: 0px;
  17. border: none;
  18. background: deepskyblue;
  19. }
  20. .content {
  21. height: 100%;
  22. width: 100%;
  23. background: lightsalmon;
  24. }
  25. /* ensure that we are using classic scrollbars with a known thickness */
  26. .classic::-webkit-scrollbar {
  27. width: 20px;
  28. height: 20px;
  29. }
  30. .classic::-webkit-scrollbar-track {
  31. background-color: hsla(0, 0%, 40%, 0.4);
  32. }
  33. .classic::-webkit-scrollbar-thumb {
  34. background-color: hsla(0, 0%, 20%, 0.8);
  35. border-radius: 10px;
  36. }
  37. /* writing mode */
  38. .vertical {
  39. writing-mode: vertical-rl;
  40. direction: ltr;
  41. overflow-y: auto;
  42. }
  43. /* overflow on the block direction */
  44. .vertical.auto { overflow-x: auto; }
  45. .vertical.scroll { overflow-x: scroll; }
  46. .vertical.visible { overflow: visible; }
  47. .vertical.hidden { overflow-x: hidden; }
  48. /* Note: not testing with overflow: clip; */
  49. </style>
  50. <script type="text/javascript">
  51. function performTest() {
  52. setup({explicit_done: true});
  53. // vertical
  54. test(function() {
  55. let container = document.getElementById('container_auto_v');
  56. let content = document.getElementById('content_auto_v');
  57. assert_equals(container.scrollHeight, 180, "auto/stable scrollHeight");
  58. assert_equals(container.clientHeight, 180, "auto/stable clientHeight");
  59. assert_equals(container.offsetTop, content.offsetTop, "auto/stable offsetTop");
  60. assert_equals(container.clientHeight, content.clientHeight, "auto/stable clientHeight");
  61. assert_not_equals(container.offsetHeight, content.offsetHeight, "auto/stable offsetHeight");
  62. }, "overflow auto, scrollbar-gutter stable, vertical-rl");
  63. test(function() {
  64. let container = document.getElementById('container_scroll_v');
  65. let content = document.getElementById('content_scroll_v');
  66. assert_equals(container.scrollHeight, 180, "scroll/stable scrollHeight");
  67. assert_equals(container.clientHeight, 180, "scroll/stable clientHeight");
  68. assert_equals(container.offsetTop, content.offsetTop, "scroll/stable offsetTop");
  69. assert_equals(container.clientHeight, content.clientHeight, "scroll/stable clientHeight");
  70. assert_not_equals(container.offsetHeight, content.offsetHeight, "scroll/stable offsetHeight");
  71. }, "overflow scroll, scrollbar-gutter stable, vertical-rl");
  72. test(function() {
  73. let container = document.getElementById('container_visible_v');
  74. let content = document.getElementById('content_visible_v');
  75. assert_equals(container.scrollHeight, 200, "visible/stable scrollHeight");
  76. assert_equals(container.clientHeight, 200, "visible/stable clientHeight");
  77. assert_equals(container.offsetTop, content.offsetTop, "visible/stable offsetTop");
  78. assert_equals(container.clientHeight, content.clientHeight, "visible/stable clientHeight");
  79. assert_equals(container.offsetHeight, content.offsetHeight, "visible/stable offsetHeight");
  80. }, "overflow visible, scrollbar-gutter stable, vertical-rl");
  81. test(function() {
  82. let container = document.getElementById('container_hidden_v');
  83. let content = document.getElementById('content_hidden_v');
  84. assert_equals(container.scrollHeight, 180, "hidden/stable scrollHeight");
  85. assert_equals(container.clientHeight, 180, "hidden/stable clientHeight");
  86. assert_equals(container.offsetTop, content.offsetTop, "hidden/stable offsetTop");
  87. assert_equals(container.clientHeight, content.clientHeight, "hidden/stable clientHeight");
  88. assert_not_equals(container.offsetHeight, content.offsetHeight, "hidden/stable offsetHeight");
  89. }, "overflow hidden, scrollbar-gutter stable, vertical-rl");
  90. done();
  91. }
  92. </script>
  93. <body onload="performTest()">
  94. Test scrollbar-gutter: stable, writing-mode: vertical-rl
  95. <div class="container classic vertical auto" id="container_auto_v">
  96. <div class="content" id="content_auto_v">overflowauto</div>
  97. </div>
  98. <div class="container classic vertical scroll" id="container_scroll_v">
  99. <div class="content" id="content_scroll_v">overflowscroll</div>
  100. </div>
  101. <div class="container classic vertical visible" id="container_visible_v">
  102. <div class="content" id="content_visible_v">overflowvisible</div>
  103. </div>
  104. <div class="container classic vertical hidden" id="container_hidden_v">
  105. <div class="content" id="content_hidden_v">overflowhidden</div>
  106. </div>
  107. </body>