paintedlayer-recycling-2.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>Starting to scroll the nested scrollbox shouldn't invalidate the fixed layer</title>
  5. <style>
  6. .content {
  7. box-sizing: border-box;
  8. width: 200px;
  9. height: 200px;
  10. border: 1px solid black;
  11. }
  12. .fixed {
  13. position: fixed;
  14. top: 20px;
  15. left: 240px;
  16. }
  17. .reftest-no-paint {
  18. border-color: lime;
  19. }
  20. .scrollable {
  21. overflow: auto;
  22. padding: 10px;
  23. }
  24. .scrolled {
  25. border: 1px solid gray;
  26. height: 400px;
  27. }
  28. body {
  29. margin: 0;
  30. padding: 20px;
  31. height: 3000px;
  32. }
  33. </style>
  34. <div class="scrollable content" id="aboutToScroll">
  35. <!--
  36. This scrollbox starts out without active scrolling and is going to become
  37. actively scrolled.
  38. -->
  39. <div class="scrolled"></div>
  40. </div>
  41. <div class="fixed reftest-no-paint content">
  42. <!--
  43. This fixed layer gets its own PaintedLayer above the rest.
  44. When the contents of .scrollable require their own PaintedLayer, that
  45. should not cause .fixed to change layers.
  46. -->
  47. </div>
  48. <script>
  49. function doTest() {
  50. document.querySelector("#aboutToScroll").scrollTop = 50 - document.querySelector("#aboutToScroll").scrollTop;
  51. document.documentElement.removeAttribute("class");
  52. }
  53. document.addEventListener("MozReftestInvalidate", doTest, false);
  54. </script>