mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 717819 - Remove the special casing of getting the offset parent for children of tables now that bug 10209 has been fixed; r=bzbarsky
This commit is contained in:
parent
74f49bd9e3
commit
c2e2c79b82
@ -503,7 +503,8 @@ nsGenericHTMLElement::GetOffsetRect(nsRect& aRect, nsIContent** aOffsetParent)
|
||||
nsIFrame* parent = frame->GetParent();
|
||||
nsPoint origin(0, 0);
|
||||
|
||||
if (parent && parent->GetType() == nsGkAtoms::tableOuterFrame) {
|
||||
if (parent && parent->GetType() == nsGkAtoms::tableOuterFrame &&
|
||||
frame->GetType() == nsGkAtoms::tableFrame) {
|
||||
origin = parent->GetPositionIgnoringScrolling();
|
||||
parent = parent->GetParent();
|
||||
}
|
||||
|
@ -282,6 +282,7 @@ _TEST_FILES = \
|
||||
test_bug677658.html \
|
||||
test_bug677463.html \
|
||||
test_bug682886.html \
|
||||
test_bug717819.html \
|
||||
file_fullscreen-api.html \
|
||||
file_fullscreen-api-keys.html \
|
||||
test_fullscreen-api.html \
|
||||
|
@ -76,8 +76,7 @@ function run_test() {
|
||||
t3('span9' ,[0,0,20,20],[1,1,20,20],[0,0,20,20],'td9');
|
||||
t3('td9' ,[1,1,22,22],[15,15,24,24],[0,0,24,24],'table9');
|
||||
t3('tr9' ,[0,0,24,24],[15,15,24,24],[0,0,24,22],'table9');
|
||||
// t3('span10' ,[0,0,20,20],[3,30,20,20],[0,0,20,20],'table9');
|
||||
t3('span10' ,[0,0,20,20],[27,450,20,20],[0,0,20,20],'body'); // bug: 'body' should be 'table9'
|
||||
t3('span10' ,[0,0,20,20],[17,43,20,20],[0,0,20,20],'table9');
|
||||
t3('table9',[13,13,28,34],[10,407,54,60],[0,0,54,50],'body');
|
||||
t3('div9',[10,10,-1,0],[0,397,-1,20],[0,0,-1,70],'body');
|
||||
|
||||
|
37
content/html/content/test/test_bug717819.html
Normal file
37
content/html/content/test/test_bug717819.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=717819
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 717819</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=717819">Mozilla Bug 717819</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
<table style="position: relative; top: 100px;">
|
||||
<tr>
|
||||
<td>
|
||||
<div id="test" style="position: absolute; top: 50px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 717819 **/
|
||||
var div = document.getElementById("test");
|
||||
is(div.offsetTop, 50, "The offsetTop must be calculated correctly");
|
||||
is(div.offsetParent, document.querySelector("table"),
|
||||
"The offset should be calculated off of the correct parent");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user