Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9918 (closed defect: fixed)

Opened 7 months ago

Last modified 5 days ago

[PATCH] [TEST] Element#absolutize calculates dimensions incorrectly in IE 7

Reported by: pphilipp Assigned to: sam
Priority: normal Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords:
Cc:

Description

If you use the ghosting sortable feature of script.aculo.us you've may noticed that, if you use it with IE7, the active dragable disappears by the fist drag-action. If you release the dragable and try it again it will stay visible.

After a long search I've found out that in prototype.js the method Position.absolutize uses element.clientWidth / element.clientHeight to recognize the dimensions of the active dragable. But if the element is relative positioned and no height is specified, IE7 will detectd height 0. FF and IE 6 instead would get the "real" dimensions of the element. Now I've changed the this code [line 3221]:

    var width   = element.clientWidth;
    var height  = element.clientHeight;

to this:

    var dimensions 	= element.getDimensions();
    var width   	= dimensions.width;
    var height  	= dimensions.height;

During my own testing everything works fine with this change. But I don't now so much about prototype, maybe I've implementet with this change a real bug ;)

Attachments

absolutize.diff (0.9 kB) - added by kangax on 01/29/08 16:55:15.
absolutize_test.diff (0.7 kB) - added by kangax on 02/01/08 16:26:14.

Change History

10/30/07 18:31:38 changed by david

  • milestone changed from 2.0 to 2.x.

01/29/08 16:55:15 changed by kangax

  • attachment absolutize.diff added.

01/29/08 16:58:15 changed by kangax

I'm not sure why absolutize is using clientWidth/clientHeight. offsetWidth/offsetHeight seems to be more reliable (and is used internally in getDimensions)

02/01/08 16:26:14 changed by kangax

  • attachment absolutize_test.diff added.

02/04/08 16:56:20 changed by kangax

  • summary changed from Position.absolutize - IE 7 Bug (?) to [PATCH] [TEST] Element#absolutize calculates dimensions incorrectly in IE 7.

05/07/08 19:15:55 changed by jdalton

  • status changed from new to closed.
  • resolution set to fixed.