Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8247 closed defect (fixed)

[cla][patch] dojo._abs returns wrong x, y in FF3 and Safari when there is an html border

Reported by: nic Owned by: bill
Priority: high Milestone: 1.3
Component: HTML Version: 1.2.1
Keywords: coords, _abs, position Cc:
Blocked By: Blocking:

Description

There is a bug even in IE when body and html have a border (eg in quirks mode html has a "medium" border-width in IE); I have to investigate in depth this problem. The patch fixes the FF3 bug, removes a unused var, a var redeclaration and adds an extreme optimization (...) using << 1 instead of *2...

Attachments (3)

testCoords.html (1009 bytes) - added by nic 11 years ago.
html.js.diff (2.0 KB) - added by nic 11 years ago.
html.js.2.diff (618 bytes) - added by nic 11 years ago.
fix for IE, quirksmode

Download all attachments as: .zip

Change History (14)

Changed 11 years ago by nic

Attachment: testCoords.html added

Changed 11 years ago by nic

Attachment: html.js.diff added

comment:1 Changed 11 years ago by Adam Peller

Component: GeneralHTML
Owner: changed from anonymous to sjmiles

comment:2 Changed 11 years ago by bill

Milestone: tbd1.3
Owner: changed from sjmiles to bill
Status: newassigned

I'll take a look at this, although I'm confused as to why tests/_base/abs.html didn't find any problems... it specifically puts border on <html> and <body>

comment:3 Changed 11 years ago by bill

Ah, the border on <body> and <html> in abs.html wasn't working because I hadn't specified style and color.

OK, thanks for the patch and test case, definitely appreciated! I will check the patch in.

comment:4 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [16031]) Fixes #8247: dojo._abs returns wrong x, y in FF 3 when there is an html border. Thanks Nic (CLA on file) for the patch! !strict

comment:5 Changed 11 years ago by bill

Summary: [cla][patch] dojo._abs returns wrong x, y in FF 3 when there is an html border (see test).[cla][patch] dojo._abs returns wrong x, y in FF3 and Safari when there is an html border

comment:6 Changed 11 years ago by bill

Safari had the same problem (due to a different bug in the code). Fixed in [16032].

comment:7 Changed 11 years ago by Jared Jurkiewicz

I'm seeing an issue on IE where the ABS returned isn't right on IE, even after this patch. Here is my setup:

table with two cells, right cell contains a widget. I call dojo.coords on the widget DOM node. I use those values to put an overlay div ontop of the widget in certain circumstances. The overlay is offset from the widget by two pixels in x and y direction. It's ALMOST right, but not quite.

comment:8 Changed 11 years ago by James Burke

Jared, is it in IE 8 or other IE version? Is the document in quirks mode?

I believe there are still some issues with IE8, being tracked in #8047 and #8095.

comment:9 in reply to:  7 Changed 11 years ago by nic

My patch was for FF3 only, I haven't fixed the IE case yet. IIRC IE has a problem even if body borderWidth is != 0px

nic

Replying to jaredj:

I'm seeing an issue on IE where the ABS returned isn't right on IE, even after this patch. Here is my setup:

table with two cells, right cell contains a widget. I call dojo.coords on the widget DOM node. I use those values to put an overlay div ontop of the widget in certain circumstances. The overlay is offset from the widget by two pixels in x and y direction. It's ALMOST right, but not quite.

Changed 11 years ago by nic

Attachment: html.js.2.diff added

fix for IE, quirksmode

comment:10 Changed 11 years ago by nic

The last patch is a workaround for IE (quirks mode): a "medium" border-width (default value) property on body or html is 4px when set by the user, 2px when set implicitly by the browser

comment:11 Changed 11 years ago by bill

(In [16052]) Fix dojo.coords() on IE in quirksmode. Patch from Nic (CLA on file), thanks Nic! Fixes #8047, refs #8247 !strict.

Note: See TracTickets for help on using tickets.