-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The types attribute must return this DataTransfer object's types array
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
html/editing/dnd/the-datatransfer-interface/DataTransfer-types-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>DataTransferItem Test: types - files</title> | ||
<link rel="author" title="Intel" href="http://www.intel.com"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-types"/> | ||
<meta name="flags" content="interact"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<p><div id="div" style="border: 2px green solid; width: 200px; height: 200px;"></div></p> | ||
|
||
<h2>Test steps:</h2> | ||
<p>Drag a file enter the green box, then drop file out</p> | ||
|
||
<script> | ||
|
||
let div = document.getElementById("div"); | ||
|
||
setup({explicit_done: true}); | ||
setup({explicit_timeout: true}); | ||
|
||
on_event(div, "dragenter", evt => { | ||
let type = evt.dataTransfer.types[0]; | ||
test(() => { | ||
assert_equals(type, "Files"); | ||
}, "Check if one of the types will be the string 'Files' when drag a file"); | ||
done(); | ||
}); | ||
|
||
</script> |