mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
Update web-platform-tests to revision e03a9b1341ae9bdb1e4fa03765257b84d26fe2f1
This commit is contained in:
parent
7d05c76d18
commit
20a833eb75
5167 changed files with 4696 additions and 297370 deletions
0
tests/wpt/web-platform-tests/html/editing/dnd/the-datatransfer-interface/dndTransferCases-manual.html
Executable file → Normal file
0
tests/wpt/web-platform-tests/html/editing/dnd/the-datatransfer-interface/dndTransferCases-manual.html
Executable file → Normal file
|
@ -0,0 +1,76 @@
|
|||
<!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>
|
|
@ -0,0 +1,81 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML5 Drag and Drop: files attribute returns a FileList</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="files attribute returns a FileList"/>
|
||||
<script src="../resources/dragdrop_support.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var EVENT, TARGET;
|
||||
|
||||
function DropEvent(evt)
|
||||
{
|
||||
if ((TARGET == evt.target) && (EVENT == evt.type))
|
||||
{
|
||||
var files = evt.dataTransfer.files;
|
||||
if(('[object FileList]' == files))
|
||||
{
|
||||
LogTestResult("PASS");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogTestResult("FAIL");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogTestResult("FAIL");
|
||||
}
|
||||
}
|
||||
|
||||
function DragenterEvent(evt)
|
||||
{
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
function DragoverEvent(evt)
|
||||
{
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
EVENT = "drop";
|
||||
|
||||
window.onload = function()
|
||||
{
|
||||
TARGET = document.getElementById("target");
|
||||
AddEventListenersForElement(EVENT, DropEvent, false, TARGET);
|
||||
AddEventListenersForElement("dragenter", DragenterEvent, false, TARGET);
|
||||
AddEventListenersForElement("dragover", DragoverEvent, false, TARGET);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<pre>Description: files attribute returns a FileList</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 a file and drop it in the green box
|
||||
</ol>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
http://dev.w3.org/html5/spec/dnd.html#datatransfer
|
||||
</p>
|
||||
<p>
|
||||
The files attribute must return a live FileList sequence consisting of File objects representing the files.
|
||||
</p>
|
||||
<textarea type="text" id="target" style="border:2px green solid; width:200px; height:50px"></textarea>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,78 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML5 Drag and Drop: Add an item to the drag data store item list whose data is the string given by setData method's second argument</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="Add an item to the drag data store item list whose data is the string given by setData method's second argument"/>
|
||||
<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.setData("text", "SetText");
|
||||
}
|
||||
}
|
||||
function DropEvent(evt)
|
||||
{
|
||||
if ((TARGET2 == evt.target) && (TARGETEVENT2 == evt.type))
|
||||
{
|
||||
if("SetText" == evt.dataTransfer.getData("text"))
|
||||
{
|
||||
LogTestResult("PASS");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogTestResult("FAIL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TARGETEVENT1 = "dragstart";
|
||||
TARGETEVENT2 = "drop";
|
||||
|
||||
window.onload = function()
|
||||
{
|
||||
TARGET1 = document.getElementById("target1");
|
||||
TARGET2 = document.getElementById("target2");
|
||||
AddEventListenersForElement(TARGETEVENT1, DragstartEvent, false, TARGET1);
|
||||
AddEventListenersForElement(TARGETEVENT2, DropEvent, false, TARGET2);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<pre>Description: Add an item to the drag data store item list whose data is the string given by setData method's second argument</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 drop it in the green box
|
||||
</ol>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
http://dev.w3.org/html5/spec/dnd.html#datatransfer
|
||||
</p>
|
||||
<p>
|
||||
If format equals "text", change it to "text/plain".
|
||||
Remove the item in the drag data store item list whose kind is Plain Unicode string and whose type string is equal to format, if there is one.
|
||||
Add an item to the drag data store item list whose kind is Plain Unicode string, whose type string is equal to format, and whose data is the string given by the method's second argument.
|
||||
</p>
|
||||
<img src="/images/blue.png" style="width:200px; height:100px" draggable="customValue2" id="target1"/>
|
||||
<br /><br />
|
||||
<input type="text" id="target2" style="border:2px green solid; width:200px; height:50px"></input>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,72 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML5 Drag and Drop: types attribute returns a DOMStringList</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="types attribute returns a DOMStringList"/>
|
||||
<script src="../resources/dragdrop_support.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var EVENT, TARGET;
|
||||
|
||||
function DropEvent(evt)
|
||||
{
|
||||
if ((TARGET == evt.target) && (EVENT == evt.type))
|
||||
{
|
||||
var types = evt.dataTransfer.types;
|
||||
if(('[object DOMStringList]' == types))
|
||||
{
|
||||
LogTestResult("PASS");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogTestResult("FAIL");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogTestResult("FAIL");
|
||||
}
|
||||
}
|
||||
|
||||
EVENT = "drop";
|
||||
|
||||
window.onload = function()
|
||||
{
|
||||
TARGET = document.getElementById("target");
|
||||
AddEventListenersForElement(EVENT, DropEvent, false, TARGET);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<pre>Description: types attribute returns a DOMStringList</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> Select the text inside the red box
|
||||
<li> Drag and drop it in the green box
|
||||
</ol>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
http://dev.w3.org/html5/spec/dnd.html#datatransfer
|
||||
</p>
|
||||
<p>
|
||||
The types attribute must return a live DOMStringList.
|
||||
</p>
|
||||
<div style="border:2px red solid; width:200px; height:50px">SampleText</div>
|
||||
<br /><br />
|
||||
<input type="text" id="target" style="border:2px green solid; width:200px; height:50px"></input>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue