summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/cssom-view/elementFromPoint-subpixel.html
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/css/cssom-view/elementFromPoint-subpixel.html
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/css/cssom-view/elementFromPoint-subpixel.html')
-rw-r--r--testing/web-platform/tests/css/cssom-view/elementFromPoint-subpixel.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/cssom-view/elementFromPoint-subpixel.html b/testing/web-platform/tests/css/cssom-view/elementFromPoint-subpixel.html
new file mode 100644
index 0000000000..ff67aa2e7f
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom-view/elementFromPoint-subpixel.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSSOM View - extensions to the Document interface</title>
+ <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
+ <link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-document-interface">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <style>
+ .container {
+ display: flex;
+ width: 500px;
+ height: 100px;
+ }
+
+ .map {
+ flex: 1 1 auto;
+ position: relative;
+ }
+
+ .box {
+ flex: 0 0 auto;
+ }
+
+ .child {
+ width: 183.66px;
+ }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <div class="map"></div>
+ <div class="box" id="box">
+ <div class="child"></div>
+ </div>
+ </div>
+
+ <script>
+ const box = document.getElementById('box');
+ const rect = box.getBoundingClientRect();
+
+ test(() => {
+ assert_equals(document.elementFromPoint(rect.x, rect.y), box);
+ }, 'Hit test top left corner of box');
+
+ test(() => {
+ assert_equals(document.elementFromPoint(rect.x + rect.width - 1, rect.y), box);
+ }, 'Hit test top right corner of box');
+
+ test(() => {
+ assert_equals(document.elementFromPoint(rect.x, rect.y + rect.height - 1), box);
+ }, 'Hit test bottom left corner of box');
+
+ test(() => {
+ assert_equals(document.elementFromPoint(rect.x + rect.width - 1, rect.y + rect.height - 1), box);
+ }, 'Hit test lower left corner of box');
+ </script>
+</body>
+</html>