contain-size-select-elem-005.html (2104B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Test: 'contain: size' on select objects should cause them to be sized as if they have no contents.</title> 6 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 7 <link rel="help" href="https://drafts.csswg.org/css-contain/#containment-size"> 8 <link rel="match" href="contain-size-select-elem-005-ref.html"> 9 <style> 10 select { 11 contain: size; 12 color: transparent; 13 /* We make scrollbars transparent because some <option> elements can cause 14 overflow, which can cause scrollbars to be active in the test and 15 inactive in the reference. But the test only cares about the sizing. */ 16 scrollbar-color: transparent transparent; 17 } 18 .fsMedium { 19 /* custom styling for some select elements, which is allowed to influence 20 their size (in the same way that it influences the size of an empty 21 select element): */ 22 font-size: 10px; 23 } 24 .fsSmall { 25 /* custom styling for some option elements (which would make their parent 26 select elem shorter, except for the fact that it's size-contained): */ 27 font-size: 6px; 28 } 29 </style> 30 </head> 31 <body> 32 <!-- No contents: --> 33 <select multiple ></select> 34 <select multiple size="1" ></select> 35 <select multiple class="fsMedium"></select> 36 37 <!-- Empty option: --> 38 <select multiple ><option></option></select> 39 <select multiple size="1" ><option></option></select> 40 <select multiple class="fsMedium"><option></option></select> 41 42 <br><br> 43 44 <!-- Nonempty option: --> 45 <select multiple ><option>X</option></select> 46 <select multiple size="1" ><option>X</option></select> 47 <select multiple class="fsMedium"><option>X</option></select> 48 49 <!-- Nonempty option with custom font-size: --> 50 <select multiple ><option class="fsSmall">X</option></select> 51 <select multiple size="1" ><option class="fsSmall">X</option></select> 52 <select multiple class="fsMedium"><option class="fsSmall">X</option></select> 53 </body> 54 </html>