Opened 9 years ago

Closed 8 years ago

#11515 closed defect (worksforme)

Error in IE7 in dojo.coords when passed hidden image

Reported by: grimmy102 Owned by: anonymous
Priority: high Milestone: tbd
Component: Core Version: 1.4.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

In dojo._getMarginExtents, "s" in the following code is being returned as null. gcs is NOT null, so it is the method which is executed. "n" is an image tag for an image which exists, but is currently inside a hidden DIV (display:none). Since "s" is null, the first call to px throws an exception.

I have opened this bug as "blocker" as it is preventing me from moving forward on IE7.

var 
	s = computedStyle||gcs(n),
	l = px(n, s.marginLeft),
	t = px(n, s.marginTop),
	r = px(n, s.marginRight),
	b = px(n, s.marginBottom);
if(d.isWebKit && (s.position != "absolute")){
	// FIXME: Safari's version of the computed right margin
	// is the space between our right edge and the right edge 
	// of our offsetParent.
	// What we are looking for is the actual margin value as 
	// determined by CSS.
	// Hack solution is to assume left/right margins are the same.
	r = l;
}
return {
	l: l,
	t: t,
	w: l+r,
	h: t+b
};

Attachments (1)

hi.html (430 bytes) - added by bill 8 years ago.
working test case, run from dijit/tests (or dojo/tests)

Download all attachments as: .zip

Change History (3)

comment:1 Changed 8 years ago by bill

Description: modified (diff)
Priority: highnormal

I'm not sure what return value you are expecting/hoping for. A hidden image (or hidden anything) doesn't have a position and arguably doesn't have a size.

But anyway, I tried to test this on IE7 and it's working fine for me, in 1.3, 1.4, 1.5, and trunk. I'll attach my test case. If you have a test case that fails please attach it.

Changed 8 years ago by bill

Attachment: hi.html added

working test case, run from dijit/tests (or dojo/tests)

comment:2 Changed 8 years ago by bill

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.