testing/web-platform/tests/html/editing/dnd/the-datatransfer-interface/effectAllowed-manual.html
author Mozilla Releng Treescript <release+treescript@mozilla.org>
Thu, 19 May 2022 06:57:01 +0000
changeset 618144 e602ffeedb64dca5837700381558bdc070f4a7b3
parent 387191 8cbc5032b043c6760561521af4492bd0edb491d0
permissions -rw-r--r--
no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD el -> edacbc72f9c702472e006c7229d01e89ac68a0a0 es-AR -> ca52c046fef480523988cdf8b2c316b4084b496c he -> e7c0b94abeb7ee044af286e4ebd622ada0804c2e hye -> fb27399463e03658d760751802e4c655e9a1f787 ia -> 63dea35c49da07c0d7f3ab2f77e2e0682868a737 ka -> 0f521d52f508aa416fda2178642ef9ce0b3bc417 nb-NO -> a453d24c602fd86656e5c1488dff8ab24ac31765 nl -> 77e9f18a051887619223c2f41af62f91a8ce8a86 oc -> 106f94e19e078d7449c9191176eab1c2d99174f4 pt-BR -> affa7ab77d516392d7a5d41d4cd75c19db2ba65c rm -> f8ebda3f7a4c0aa71b312e4b28f14c8ca08c5fca tg -> 2d54aae5a06ed5c4e12bbd18fd54b78b5d5ae1b6

<!doctype html>
<html>
    <head>
        <title>HTML5 Drag and Drop: Set a value to effectAllowed attribute</title>
        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
        <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
        <link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/>
        <meta name="assert" content="Set a value to effectAllowed attribute"/>
        <script src="../resources/dragdrop_support.js" type="text/javascript"></script>
        <script type="text/javascript">
            var TARGETEVENT1, TARGETEVENT2, TARGET1, TARGET2;

            function DragstartEvent(evt)
            {
                if ((TARGET1 == evt.target) && (TARGETEVENT1 == evt.type))
                {
                    evt.dataTransfer.effectAllowed = "move";
                }
            }
            function DragenterEvent(evt)
            {
                if ((TARGET2 == evt.target) && (TARGETEVENT2 == evt.type))
                {
                    if("move" == evt.dataTransfer.effectAllowed)
                    {
                        LogTestResult("PASS");
                    }
                    else
                    {
                        LogTestResult("FAIL");
                    }
                }
            }

            TARGETEVENT1 = "dragstart";
            TARGETEVENT2 = "dragenter";

            window.onload = function()
            {
                TARGET1 = document.getElementById("target1");
                TARGET2 = document.getElementById("target2");
                AddEventListenersForElement(TARGETEVENT1, DragstartEvent, false, TARGET1);
                AddEventListenersForElement(TARGETEVENT2, DragenterEvent, false, TARGET2);
            }
        </script>
    </head>
    <body>
        <pre>Description: Set a value to effectAllowed attribute</pre>
        <table id='testtable' border='1'>
            <tr>
                <td>Test Result</td>
                <td>Test Assertion</td>
            </tr>
            <tr>
                <td id='test_result'>Manual</td>
                <td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
                <div id="manualsteps">
                    Steps:
                    <ol>
                        <li> Drag the blue image and enter the green box
                    </ol>
                </div>
            </td>
            </tr>
        </table>
        <p>
        http://dev.w3.org/html5/spec/dnd.html#datatransfer
        </p>
        <p>
        On setting, if the new value is one of "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", or "uninitialized", then the attribute's current value must be set to the new value.
        </p>
        <img src="/images/blue.png" style="width:200px; height:100px" draggable="true" id="target1"/>
        <br /><br />
        <input type="text" id="target2" style="border:2px green solid; width:200px; height:50px"></input>
    </body>
</html>