tor-browser

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

TextEvent.inputMode.drop.html (2157B)


      1 <!DOCTYPE html>
      2 <html>
      3    <head>
      4        <title id='desc'> TextEvent: inputMode with DOM_INPUT_METHOD_DROP </title>
      5        <script type="text/javascript">
      6            var PassTest = function()
      7            {
      8                document.getElementById("testresult").firstChild.data = "PASS";
      9            }
     10 
     11            var FailTest = function()
     12            {
     13                document.getElementById("testresult").firstChild.data = "FAIL";
     14            }
     15 
     16            var EVENT = "textInput";
     17            var TARGET;
     18 
     19            function TestEvent(evt)
     20            {
     21                TARGET.removeEventListener(EVENT, TestEvent, true);
     22 
     23                if ((0x03 == evt.inputMode) && ("Hello World" == evt.data))
     24                {
     25                    PassTest();
     26                }
     27                else
     28                {
     29                    FailTest();
     30                }
     31            }
     32 
     33            window.onload = function()
     34            {
     35                try
     36                {
     37                    TARGET = document.getElementById("target");
     38                    TARGET.addEventListener(EVENT, TestEvent, true);
     39                }
     40                catch(ex)
     41                {
     42                    FailTest();
     43                }
     44            }
     45        </script>
     46    </head>
     47    <body>
     48        <h3>DOM Events</h3>
     49        <h4>
     50            Test Description: TextEvent.inputMode is DOM_INPUT_METHOD_DROP (0x03)
     51            when the text string was inserted as part of a drag-and-drop operation.
     52        </h4>
     53 
     54        <span id="parent">
     55            <div contenteditable="true" style="border:solid 1px green; width:150px; height:20px">Hello World</div>
     56            <br/>
     57            <input id="target" type="text" />
     58        </span>
     59 
     60        <p id="manualsteps">
     61            Steps:
     62            <ol>
     63                <li> Select "Hello World" inside the green editbox
     64                <li> Drag-and-drop it ("Hello World") to the textbox below the green editbox
     65            </ol>
     66        </p>
     67        <p>Test passes if the word "PASS" appears below after following the above steps.</p>
     68        <div>Test result: </div>
     69        <div id='testresult'>FAIL</div>
     70    </body>
     71 </html>