text-tselect-03-f-isvalid.html (4423B)
1 <!DOCTYPE html> 2 <html lang='en'> 3 <head> 4 <title>text-tselect-03-f-manual.svg</title> 5 <meta charset='utf-8'> 6 </head> 7 <body> 8 <h1>Source SVG: text-tselect-03-f-manual.svg</h1> 9 <svg version="1.1" baseProfile="full" onload="doSelection(0,0);" id="svg-root" 10 width="100%" height="100%" viewBox="0 0 480 360" 11 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 12 <!--======================================================================--> 13 <!--= SVG 1.1 2nd Edition Test Case =--> 14 <!--======================================================================--> 15 <!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =--> 16 <!--= Institute of Technology, European Research Consortium for =--> 17 <!--= Informatics and Mathematics (ERCIM), Keio University). =--> 18 <!--= All Rights Reserved. =--> 19 <!--= See http://www.w3.org/Consortium/Legal/. =--> 20 <!--======================================================================--> 21 22 <title id="test-title">$RCSfile: text-tselect-03-f.svg,v $</title> 23 <defs> 24 <style> 25 @font-face { 26 font-family: Ezra SIL SR; 27 src: url(woffs/EzraSILSR.woff) format("woff"); 28 } 29 </style> 30 <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> 31 <font-face-src> 32 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> 33 </font-face-src> 34 </font-face> 35 <font-face font-family="SVGHebrew" unicode-range="U+000D-FEFF"> 36 <font-face-src> 37 <font-face-uri xlink:href="../resources/Heb.svg#SVGHebrew"/> 38 </font-face-src> 39 </font-face> 40 </defs> 41 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 42 <defs> 43 <script> 44 var startIndex = 0; 45 var numChars = 9; 46 47 function doSelection(indexDelta, numCharsDelta) 48 { 49 try 50 { 51 document.getElementById('text').selectSubString(startIndex+indexDelta, numChars+numCharsDelta); 52 } 53 catch(e) 54 { 55 if(e.code == DOMException.INDEX_SIZE_ERR) 56 { 57 // If there was an error, re-select the last range 58 document.getElementById('text').selectSubString(startIndex, numChars); 59 return; 60 } 61 } 62 63 startIndex += indexDelta; 64 numChars += numCharsDelta; 65 66 document.getElementById('info').firstChild.data = "StartIndex: " + startIndex + ". NumChars: " + numChars; 67 } 68 </script> 69 </defs> 70 71 <g transform="translate(0,60)"> 72 <text id="info" font-size="16" x="10" y="70">StartIndex: 0 NumChars: 0</text> 73 74 <text id="text" font-size="48" y="128" x="10" font-family="SVGHebrew, 'Ezra SIL SR', serif"> 75 abc אבג 123 דהו def 76 </text> 77 78 <g id="buttons"> 79 <rect x="10" y="160" width="100" height="20" fill="blue" onclick="doSelection(1,0);"/> 80 <text x="60" y="175" text-anchor="middle" font-size="14" fill="white" pointer-events="none">startIndex++</text> 81 82 <rect x="120" y="160" width="100" height="20" fill="blue" onclick="doSelection(-1,0);"/> 83 <text x="170" y="175" text-anchor="middle" font-size="14" fill="white" pointer-events="none">startIndex--</text> 84 85 <rect x="230" y="160" width="100" height="20" fill="blue" onclick="doSelection(0,1);"/> 86 <text x="280" y="175" text-anchor="middle" font-size="14" fill="white" pointer-events="none">numChars++</text> 87 88 <rect x="340" y="160" width="100" height="20" fill="blue" onclick="doSelection(0,-1);"/> 89 <text x="390" y="175" text-anchor="middle" font-size="14" fill="white" pointer-events="none">numChars--</text> 90 </g> 91 </g> 92 </g> 93 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 94 <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.5 $</text> 95 </g> 96 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 97 <!-- comment out this watermark once the test is approved --> 98 <!--<g id="draft-watermark"> 99 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> 100 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" 101 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> 102 </g>--> 103 </svg> 104 </body> 105 </html>