active-selection-056.html (1566B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Pseudo-Elements Test: active selection and 3 consecutive <br> elements</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-selectors"> 9 <link rel="match" href="../reference/ref-nothing-below.xht"> 10 11 <!-- 12 13 Issue 1018465: [CSS4-Pseudo] Active selection and hard wrap (or hard return) 14 line break: ::selection should not select <br> 15 https://bugs.chromium.org/p/chromium/issues/detail?id=1018465 16 17 --> 18 19 <meta name="assert" content="The <br> element is an empty element. Its background color can be painted but specifying its color should generate no rendering effect of any kind. Since the 'background-color' has been specified as 'transparent', then nothing should be painted or viewable in this test."> 20 21 <style> 22 div 23 { 24 font-size: 100px; 25 } 26 27 div::selection 28 { 29 background-color: transparent; 30 color: red; 31 } 32 </style> 33 34 <script> 35 function startTest() 36 { 37 var targetRange = document.createRange(); 38 /* We first create an empty range */ 39 targetRange.selectNodeContents(document.getElementById("test")); 40 /* Then we set the range boundaries to the children of div#test */ 41 window.getSelection().addRange(targetRange); 42 /* Finally, we now select such range of content */ 43 } 44 </script> 45 46 <body onload="startTest();"> 47 48 <p>Test passes if there is nothing below. 49 50 <div id="test"> <br><br><br> </div>