diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/editing/dnd/canvas/007.html | |
parent | Initial commit. (diff) | |
download | firefox-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/007.html')
-rw-r--r-- | testing/web-platform/tests/html/editing/dnd/canvas/007.html | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/editing/dnd/canvas/007.html b/testing/web-platform/tests/html/editing/dnd/canvas/007.html new file mode 100644 index 0000000000..d0ff4f64ba --- /dev/null +++ b/testing/web-platform/tests/html/editing/dnd/canvas/007.html @@ -0,0 +1,42 @@ +<!doctype html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="../resources/test-helper.js"></script> +<head> +<title>Drag and drop between iframes: dropping block element onto canvas</title> +<style type="text/css"> +iframe + {width:300px; + height:200px; + border-style:none;} +</style> +</head> +<body> +<p><iframe src="helper-drag-me-green-box.xhtml">Green box</iframe></p> +<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p> +<p><iframe src="helper-drop-here-canvas.xhtml" id="iframe-2">Canvas</iframe></p> +<script> +async function test(){ + await new Promise(loaded => window.addEventListener("load", loaded)); + const iframe = document.querySelector('iframe'); + const iframeTwo = document.getElementById('iframe-2'); + const innerDoc = iframe.contentDocument || iframe.contentWindow.document; + const div = innerDoc.querySelector('div'); + const innerDocTwo = iframeTwo.contentDocument || iframe.contentWindow.document; + const canvas = innerDocTwo.querySelector('canvas'); + function onDropCallBack(event) { + let style = window.getComputedStyle(canvas); + let currentColor = "rgba(0, 0, 0, 0)"; + assert_equals(style.getPropertyValue("background-color"), currentColor); + return true; + } + + dragDropTest(iframe, canvas, onDropCallBack, 'Dragging the iframe to the bottom iframe should turn it green', iframeTwo); +} +test(); +</script> +</body> +</html> |