зеркало из https://github.com/mozilla/gecko-dev.git
36 строки
616 B
HTML
36 строки
616 B
HTML
<html>
|
|
<head>
|
|
<script src="harness.js"></script>
|
|
<script>
|
|
is_function(DOMRect, "DOMRect");
|
|
|
|
var elems = document.getElementsByTagName('div');
|
|
var rect = elems[0].getBoundingClientRect();
|
|
is_a(rect, DOMRect);
|
|
|
|
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>
|