aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/content/test_getBoundingClientRect.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/content/test_getBoundingClientRect.html')
-rw-r--r--src/test/content/test_getBoundingClientRect.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/content/test_getBoundingClientRect.html b/src/test/content/test_getBoundingClientRect.html
new file mode 100644
index 00000000000..4f25d97141c
--- /dev/null
+++ b/src/test/content/test_getBoundingClientRect.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<script src="harness.js"></script>
+<script>
+is_function(ClientRect, "ClientRect");
+is_function(ClientRectList, "ClientRectList");
+
+var elems = document.getElementsByTagName('div');
+var rect = elems[0].getBoundingClientRect();
+is_a(rect, ClientRect);
+
+geq(rect.top, 100);
+geq(rect.bottom, 200);
+geq(rect.left, 100);
+geq(rect.right, 200);
+
+is(rect.width, 100);
+is(rect.height, 100);
+is(rect.width, rect.right - rect.left);
+is(rect.height, rect.bottom - rect.top);
+
+finish();
+</script>
+<style>
+div {
+ margin-top: 100px;
+ margin-left: 100px;
+ width: 100px;
+ height: 100px;
+}
+</style>
+</head>
+<body>
+ <div>my div</div>
+</body>
+</html>