summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_clip-path_polygon.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/style/test/test_clip-path_polygon.html
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--layout/style/test/test_clip-path_polygon.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/layout/style/test/test_clip-path_polygon.html b/layout/style/test/test_clip-path_polygon.html
new file mode 100644
index 0000000000..3c77103ba2
--- /dev/null
+++ b/layout/style/test/test_clip-path_polygon.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+body {padding: 0;margin:0;}
+div {
+ width: 200px;
+ height: 200px;
+ position: fixed;
+ top: 50px;
+ left: 50px;
+ margin: 50px;
+ padding: 50px;
+ border: 50px solid red;
+ transform-origin: 0 0;
+ transform: translate(50px, 50px) scale(0.5);
+ background-color: green;
+ clip-path: polygon(0 0, 200px 0, 0 200px) content-box;
+}
+</style>
+<title>clip-path with polygon() hit test</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<div id="a"></div>
+<p style="margin-top: 110px">
+<script>
+var a = document.getElementById("a");
+isnot(a, document.elementFromPoint(199, 199), "a shouldn't be found");
+isnot(a, document.elementFromPoint(199, 250), "a shouldn't be found");
+isnot(a, document.elementFromPoint(250, 199), "a shouldn't be found");
+isnot(a, document.elementFromPoint(255, 255), "a shouldn't be found");
+isnot(a, document.elementFromPoint(301, 200), "a shouldn't be found");
+isnot(a, document.elementFromPoint(200, 301), "a shouldn't be found");
+is(a, document.elementFromPoint(200, 200), "a should be found");
+is(a, document.elementFromPoint(299, 200), "a should be found");
+is(a, document.elementFromPoint(200, 299), "a should be found");
+is(a, document.elementFromPoint(250, 250), "a should be found");
+</script>
+</html>