pull-background-6.html (1639B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <meta charset="utf-8"> 4 <title>Scrollboxes with uniform backgrounds should pull that color into their contents, even if these contents are wider than the uniform area behind the scrollbox</title> 5 <!-- 6 Very similar to pull-background-1.html, but with a .scrolled element that is 7 wider than the scrollbox. 8 --> 9 10 <style> 11 12 div { 13 min-height: 50px; 14 box-model: border-box; 15 } 16 17 .first, .second { 18 border: 1px solid blue; 19 margin: 50px 0; 20 } 21 22 .border { 23 border: 1px solid black; 24 } 25 26 .scrollable { 27 height: auto; 28 overflow: auto; 29 } 30 31 .scrollarea { 32 width: 5000px; 33 border: none; 34 padding: 10px 0 20px; 35 height: auto; 36 } 37 38 .scrolled { 39 margin-left: 220px; 40 width: 2000px; 41 height: 100px; 42 border-color: red; 43 } 44 45 body { 46 margin: 0; 47 padding: 0 100px; 48 height: 3000px; 49 } 50 51 </style> 52 53 <div class="first" reftest-assigned-layer="page-background"> 54 <!-- 55 This is just a regular box, it should end up in the page background layer. 56 --> 57 </div> 58 59 <div class="scrollable border"> 60 <div class="scrollarea"> 61 <div class="scrolled border reftest-opaque-layer"> 62 <!-- 63 The background of .scrollable is uniform and opaque, 64 .scrolled should be able to pull up that background color and become 65 opaque itself. 66 --> 67 </div> 68 </div> 69 </div> 70 71 <div class="second" reftest-assigned-layer="page-background"> 72 <!-- 73 This should share a layer with .first and the page background. 74 --> 75 </div> 76 77 <script> 78 79 var scrollable = document.querySelector(".scrollable"); 80 81 // Make .scrollable start out with active scrolling. 82 scrollable.scrollLeft = 0; 83 scrollable.scrollLeft = 20; 84 85 </script>