file-selector-button-inherit.html (857B)
1 <!doctype html> 2 <title>CSS Pseudo Test: ::file-selector-button inherits from its originating element</title> 3 <link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#treelike"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <style> 7 input { background-color: green; } 8 input::file-selector-button { 9 color: green; 10 background-color: inherit; 11 } 12 </style> 13 <input id="inp" type="file"> 14 <script> 15 test(() => { 16 const style = getComputedStyle(inp, "::file-selector-button"); 17 assert_equals(style.color, "rgb(0, 128, 0)", "Check that ::file-selector-button is supported via color"); 18 assert_equals(style.backgroundColor, "rgb(0, 128, 0)", "::file-selector-button inheriting background-color"); 19 }, "::file-selector-button should inherit from its originating element"); 20 </script>