servo/tests/wpt/css-tests/cssom-view-1_dev/xhtml1/CaretPosition-001.xht

44 lines
No EOL
1.3 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>CSSOM View Module test:CaretPosition</title>
<link href="mailto:tidelgl@gmail.com" rel="author" title="unbug" />
<link href="https://drafts.csswg.org/cssom-view-1/#dom-document-elementfrompoint" rel="help" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style type="text/css">
.box{
position: absolute;
top : 100px;
left : 400px;
width: 100px;
height: 100px;
background-color: #000;
}
</style>
</head>
<body>
<div class="box" id="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box" id="box2"></div>
<div style="left: 405px;background:red;" class="box" id="box3"></div>
<div id="log"></div>
<script>
test(function(){
assert_equals(document.elementFromPoint(400, 100),
document.getElementById('box2'),
"Expected value for element id is 'box2'");
}, 'Element at (400, 100)');
test(function(){
assert_equals(document.elementFromPoint(400, 900),
null,
"Expected value for element id is 'box2'");
}, 'Element at (400, 900)');
</script>
</body></html>