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