testing/web-platform/tests/html/editing/dnd/events/006.xhtml
author ffxbld <ffxbld@mozilla.com>
Tue, 27 Sep 2022 16:27:33 +0000
changeset 636477 d1ae84015c22f2034435b47194fdced878072035
parent 388141 f95a678186b46649eee6cf8c6adbdf46c320f300
permissions -rw-r--r--
No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D158124

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Drag and drop of link to iframe</title>
<style type="text/css">
div
  {width:0;
  height:0;
  border:solid 50px silver;
  border-radius:50px;
  margin-left:auto;}
iframe
  {width:100%;
  height:500px;}
</style>
<script type="application/ecmascript">
var step = 1;
function start(event)
  {if(step++ == 1)
    {setColor('green silver silver silver');}
  else
    {step = 0;
    setColor('maroon');
    say('Dragstart should be first event to fire.')}
  }
function leavePage(event)
  {if(step++ > 1)
    {setColor('green green silver silver')}
  else
    {step = 0;
    setColor('maroon');
    say('Dragleave should fire after dragstart.')}
  }
function endDrag(event)
  {if(step++ > 2)
    {setColor('green')}
  else
    {step = 0;
    setColor('maroon');
    say('Dragend should fire after dragstart and dragleave.')}
  }
function say(it)
  {document.querySelector('pre').appendChild(document.createTextNode(it + '\n'))}
function setColor(c)
  {document.querySelector('div').setAttribute('style','border-color:' + c)}
</script>
</head>
<body ondragleave="leavePage(event)">
<p><a href="data:text/plain,1" ondragstart="start(event)" ondragend="endDrag(event)">Drag me</a></p>
<p>Drag link to the frame below and drop it there. Both circles should turn green once link is dropped into lower frame.</p>
<div/>
<pre/>
<iframe src="helper-drop-here-body-circle.xhtml">XHTML document</iframe>
</body>
</html>