Opened 12 years ago

Closed 12 years ago

#3676 closed defect (fixed)

coords returning incorrect x/y in IE 6

Reported by: guest Owned by: sjmiles
Priority: high Milestone: 1.1
Component: HTML Version: 0.9
Keywords: coords, IE Cc:
Blocked By: Blocking:

Description

Check out the rendering difference between IE 6 and FireFox?:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style>
#parent
{
	border:10px solid red;
	height:100px;
}

#point
{
	position:absolute;
	width:5px;
	height:5px;
	background:#AAA;
}
</style>
<script type="text/javascript">
var djConfig = {isDebug: true, debugAtAllCosts: true};
</script>
<script type="text/javascript" src="lib/dojo/dojo.js"></script>
<script type="text/javascript">
dojo.addOnLoad(function()
{
	var c = dojo.coords("parent");
	console.debug(c);
	dojo.marginBox("point", {l:c.x, t:c.y});
});
</script>

</head>

<body>
<div id="point"></div><div id="parent"></div>
</body>
</html>

From testing with different border sizes, it looks like FF takes the border into account, yet IE assumes it is 2px all the time. weird.

Change History (4)

comment:1 Changed 12 years ago by Adam Peller

Owner: changed from Bryan Forbes to sjmiles

comment:2 Changed 12 years ago by sjmiles

Version: 0.91.0

'coords' and 'abs' need overhaul.

comment:3 Changed 12 years ago by sjmiles

Milestone: 0.91.0
Version: 1.00.9

comment:4 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [12079]) Fix dojo.coords() on FF to account for borders (rather than returning the content box). Fixes #3222, #3676, #5541. !strict

Note: See TracTickets for help on using tickets.