active-selection-031.html (1999B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Pseudo-Elements Test: active selection and vertical writing-modes</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-styling"> 9 <link rel="match" href="reference/active-selection-031-ref.html"> 10 11 12 <link rel="stylesheet" href="support/highlights.css"> 13 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 14 <style> 15 .highlight_reftest { 16 overflow: hidden; 17 width: 300px; 18 height: 325px; 19 } 20 div > div 21 { 22 color: red; 23 float: left; 24 font: 25px/1 Ahem; 25 margin-left: 16px; 26 } 27 28 div.vrl 29 { 30 writing-mode: vertical-rl; 31 } 32 33 div.vlr 34 { 35 writing-mode: vertical-lr; 36 } 37 38 div.mixed 39 { 40 text-orientation: mixed; 41 } 42 43 div.sideways 44 { 45 text-orientation: sideways; 46 } 47 48 div.upright 49 { 50 text-orientation: upright; 51 } 52 53 div::selection 54 { 55 background-color: yellow; 56 color: green; 57 } 58 </style> 59 60 <script> 61 function startTest() 62 { 63 var targetRange = document.createRange(); 64 /* We first create an empty range */ 65 66 targetRange.selectNodeContents(document.getElementById("test")); 67 /* Then we set the range boundaries to the contents of div#test */ 68 69 window.getSelection().addRange(targetRange); 70 /* Finally, we now add such range of content into a selection */ 71 } 72 </script> 73 74 <body onload="startTest();"> 75 76 <p>Test passes if each glyph of the 6 "Selected Text" is green and if there is <strong>no red</strong>. 77 78 <div id="test" class="highlight_reftest"> 79 80 <div class="vrl mixed">Selected Text</div> 81 82 <div class="vrl sideways">Selected Text</div> 83 84 <div class="vrl upright">Selected Text</div> 85 86 <div class="vlr mixed">Selected Text</div> 87 88 <div class="vlr sideways">Selected Text</div> 89 90 <div class="vlr upright">Selected Text</div> 91 92 </div>