Index: sky/tests/layout/document-elementFromPoint.sky |
diff --git a/sky/tests/layout/document-elementFromPoint.sky b/sky/tests/layout/document-elementFromPoint.sky |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e4c12af9e2313e52940cf370d2a5743a09fb5513 |
--- /dev/null |
+++ b/sky/tests/layout/document-elementFromPoint.sky |
@@ -0,0 +1,26 @@ |
+<sky> |
+<import src="../resources/chai.sky" /> |
+<import src="../resources/mocha.sky" /> |
+<style> |
+foo { width: 100px; height: 100px; background: blue; } |
+bar { width: 100px; height: 100px; background: purple; } |
+</style> |
+<foo /><bar /> |
+<script> |
+describe("elementFromPoint", function() { |
+ it("should hit test", function() { |
+ // FIXME: We should have much better hit-testing coverage, at least: |
+ // inline content (both sections of a wrapped run) |
+ // text node |
+ // flex box |
+ // display: paragraph |
+ // position: absolute |
+ // position: relative |
+ // z-order (missing, zero, positive and negative) |
+ assert.equal(document.elementFromPoint(50, 50).tagName, 'foo') |
+ assert.equal(document.elementFromPoint(50, 150).tagName, 'bar') |
+ assert.equal(document.elementFromPoint(50, 250).tagName, 'sky') |
+ }); |
+}); |
+</script> |
+</sky> |