mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Auto merge of #6784 - glennw:offset-ext, r=pcwalton
Implement offsetParent/Top/Left/Width/Height. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6784) <!-- Reviewable:end -->
This commit is contained in:
commit
d66c59a152
25 changed files with 334 additions and 29 deletions
|
@ -0,0 +1,3 @@
|
|||
[first-letter-dynamic-003a.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
|||
[first-letter-dynamic-003b.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
|||
[run-in-basic-017.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,5 +0,0 @@
|
|||
[input-type-button.html]
|
||||
type: testharness
|
||||
[label value]
|
||||
expected: FAIL
|
||||
|
|
@ -473,6 +473,12 @@
|
|||
"url": "/_mozilla/mozilla/element_matches_empty.html"
|
||||
}
|
||||
],
|
||||
"mozilla/element_parentOffset.html": [
|
||||
{
|
||||
"path": "mozilla/element_parentOffset.html",
|
||||
"url": "/_mozilla/mozilla/element_parentOffset.html"
|
||||
}
|
||||
],
|
||||
"mozilla/empty_clientrect.html": [
|
||||
{
|
||||
"path": "mozilla/empty_clientrect.html",
|
||||
|
|
51
tests/wpt/mozilla/tests/mozilla/element_parentOffset.html
Normal file
51
tests/wpt/mozilla/tests/mozilla/element_parentOffset.html
Normal file
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style type="text/css">
|
||||
#outer {
|
||||
position: absolute;
|
||||
margin-left: 50px;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
background-color: red;
|
||||
}
|
||||
#inner {
|
||||
margin-left: 100px;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
background-color: green;
|
||||
}
|
||||
#div {
|
||||
margin: 25px;
|
||||
position: absolute;
|
||||
width: 80px;
|
||||
height: 130px;
|
||||
background-color: blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="outer">
|
||||
<div id="inner">
|
||||
<div id="div"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
var div = document.getElementById("div");
|
||||
var outer = document.getElementById("outer");
|
||||
|
||||
var parent = div.offsetParent;
|
||||
assert_equals(parent, outer);
|
||||
|
||||
assert_equals(div.offsetLeft, 125);
|
||||
assert_equals(div.offsetTop, 25);
|
||||
assert_equals(div.offsetWidth, 80);
|
||||
assert_equals(div.offsetHeight, 130);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue