summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml')
-rw-r--r--testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml42
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml b/testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml
new file mode 100644
index 0000000000..e2e3646c86
--- /dev/null
+++ b/testing/web-platform/tests/html/editing/dnd/canvas/013.xhtml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Drag and drop and horizontal scrolling: dropping block element onto canvas inside scrollable container</title>
+<style type="text/css">
+div[draggable]
+ {width:20px;
+ height:20px;
+ background-color:green;}
+p + div
+ {height:150px;
+ width:100px;
+ overflow-x:scroll;}
+canvas
+ {display:block;
+ margin-left:100px;}
+</style>
+<script type="application/ecmascript">
+function paint(color)
+ {var canvas = document.querySelector('canvas'),
+ c = canvas.getContext('2d');
+ c.fillStyle = color;
+ c.beginPath();
+ c.moveTo(0,0);
+ c.lineTo(100,0);
+ c.lineTo(100,100);
+ c.lineTo(0,100);
+ c.closePath();
+ c.fill();}
+function start(event)
+ {event.dataTransfer.effectAllowed = 'copy';
+ event.dataTransfer.setData('text/plain', 'green');}
+</script>
+</head>
+<body onload="paint('gray')">
+<div draggable="true" ondragstart="start(event)"/>
+<p>You should be able to drag green box above to the gray canvas at the right edge of scrollable container (dragging towards the right edge triggers scrolling). Canvas should be repainted to match dropped color.</p>
+<div>
+ <canvas width="100" height="100" ondragenter="event.preventDefault()" ondragover="return false" ondrop="paint(event.dataTransfer.getData('text/plain'))">Canvas</canvas>
+</div>
+</body>
+</html>