active-selection-053.html (1403B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Pseudo-Elements Test: active selection and invalid color value</title> 6 7 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> 8 <link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-cascade"> 9 <link rel="match" href="active-selection-051-ref.html"> 10 11 <meta content="invalid should" name="flags"> 12 <meta name="assert" content="In this test, 'color' has an invalid value which makes the declaration invalid; therefore, it is ignored. Therefore, the div::selection selector has neither color nor background-color specified. In such case, the UA should use the OS-default highlight colors for div::selection."> 13 14 <style> 15 div 16 { 17 color: transparent; 18 font-size: 300%; 19 } 20 21 div::selection 22 { 23 color: foo; 24 } 25 </style> 26 27 <script> 28 function startTest() 29 { 30 var targetRange = document.createRange(); 31 /* We first create an empty range */ 32 targetRange.selectNodeContents(document.getElementById("test")); 33 /* Then we set the range boundaries to the children of div#test */ 34 window.getSelection().addRange(targetRange); 35 /* Finally, we now select such range of content */ 36 } 37 </script> 38 39 <body onload="startTest();"> 40 41 <p>Test passes if "Selected Text" appears selected using the OS selection colors. 42 43 <div id="test">Selected Text</div>