tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

text-tselect-02-f-isvalid.html (4053B)


      1 <!DOCTYPE html>
      2 <html lang='en'>
      3 <head>
      4 <title>text-tselect-02-f-manual.svg</title>
      5 <meta charset='utf-8'>
      6 </head>
      7 <body>
      8 <h1>Source SVG: text-tselect-02-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-02-f.svg,v $</title>
     23  <defs>
     24    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
     25      <font-face-src>
     26        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
     27      </font-face-src>
     28    </font-face>
     29  </defs>
     30  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
     31    <defs>
     32      <script>
     33        var startIndex = 0;
     34        var numChars = 9;
     35 
     36        function doSelection(indexDelta, numCharsDelta)
     37        {
     38        try
     39        {
     40        document.getElementById('text').selectSubString(startIndex+indexDelta, numChars+numCharsDelta);
     41        }
     42        catch(e)
     43        {
     44        if(e.code == DOMException.INDEX_SIZE_ERR)
     45        {
     46        // If there was an error, re-select the last range
     47        document.getElementById('text').selectSubString(startIndex, numChars);
     48        return;
     49        }
     50        }
     51 
     52        startIndex += indexDelta;
     53        numChars += numCharsDelta;
     54 
     55        document.getElementById('info').firstChild.data = "StartIndex: " + startIndex + ". NumChars: " + numChars;
     56        }
     57      </script>
     58    </defs>
     59 
     60    <g transform="translate(0,60)">
     61      <text id="info" font-size="16" x="10" y="70">StartIndex: 0 NumChars: 0</text>
     62 
     63      <text id="text" font-size="48" y="128" x="10">
     64        abc אבג 123 דהו def
     65      </text>
     66 
     67      <g id="buttons">
     68        <rect x="10" y="160" width="100" height="20" fill="blue" onclick="doSelection(1,0);"/>
     69        <text x="60" y="175" text-anchor="middle" font-size="16" fill="white" pointer-events="none">startIndex++</text>
     70 
     71        <rect x="120" y="160" width="100" height="20" fill="blue" onclick="doSelection(-1,0);"/>
     72        <text x="170" y="175" text-anchor="middle" font-size="16" fill="white" pointer-events="none">startIndex--</text>
     73 
     74        <rect x="230" y="160" width="100" height="20" fill="blue" onclick="doSelection(0,1);"/>
     75        <text x="280" y="175" text-anchor="middle" font-size="16" fill="white" pointer-events="none">numChars++</text>
     76 
     77        <rect x="340" y="160" width="100" height="20" fill="blue" onclick="doSelection(0,-1);"/>
     78        <text x="390" y="175" text-anchor="middle" font-size="16" fill="white" pointer-events="none">numChars--</text>
     79      </g>
     80    </g>
     81  </g>
     82  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
     83    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</text>
     84  </g>
     85  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
     86  <!-- comment out this watermark once the test is approved -->
     87  <!--<g id="draft-watermark">
     88    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
     89    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
     90      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
     91  </g>-->
     92 </svg>
     93 </body>
     94 </html>