scroll-button-hover.html (1394B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Test: ::scroll-button changes on hover via :hover</title> 4 <link rel="help" href="https://drafts.csswg.org/css-overflow-5/#scroll-buttons"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/resources/testdriver.js"></script> 8 <script src="/resources/testdriver-actions.js"></script> 9 <script src="/resources/testdriver-vendor.js"></script> 10 <style> 11 body { 12 margin: 0; 13 } 14 15 #scroller { 16 width: 600px; 17 height: 300px; 18 overflow: auto; 19 white-space: nowrap; 20 } 21 22 #scroller div { 23 background: green; 24 display: inline-block; 25 width: 600px; 26 height: 270px; 27 } 28 29 #scroller::scroll-button(inline-end) { 30 content: ">"; 31 width: 100px; 32 height: 100px; 33 position: absolute; 34 top: 0; 35 left: 0; 36 background-color: green; 37 display: inline-block; 38 } 39 40 #scroller::scroll-button(inline-end):hover { 41 background-color: blue; 42 } 43 </style> 44 <div id="scroller"> 45 <div id="target"></div> 46 <div></div> 47 </div> 48 <script> 49 promise_test(async t => { 50 actions_promise = new test_driver.Actions() 51 .pointerMove(15, 15) 52 .send(); 53 await actions_promise; 54 assert_equals(getComputedStyle(scroller, "::scroll-button(inline-end)").backgroundColor, "rgb(0, 0, 255)", "::scroll-button changes on hover via :hover"); 55 }); 56 </script>