Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4325 closed defect (fixed)

Safari/Webkit: Wrong dojo._abs behavior

Reported by: haysmark Owned by: sjmiles
Priority: high Milestone: 1.0.1
Component: HTML Version: 0.9
Keywords: 4dijit Cc:
Blocked By: Blocking:

Description (last modified by haysmark)

Refer to: http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_ComboBox.html

When you first load test_ComboBox and open a menu, it works fine. However, if you scroll the whole page down a little and open a menu, the menu appears too high and covers the ComboBox?. Specifically, the document's scroll position is not being added to the position the popup should appear. This only affects Safari.

There seems to be a logic problem in dojo._abs. According to a console.debug I added, in FireFox? and IE, hasScroll is false and everything displays correctly. In Safari, hasScroll becomes true, which seems to trigger the wrong math at this section:

var scroll = dojo._docScroll();
var m = hasScroll ? (!includeScroll ? -1 : 0) : 1;
ret.y += m*scroll.y;
ret.x += m*scroll.x;

The dojo.coords call is in place.js in dijit:

var aroundNodePos = dojo.coords(aroundNode, true);

Attachments (1)

dojo.coords.patch (567 bytes) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 12 years ago by haysmark

Status: newassigned

comment:2 Changed 12 years ago by haysmark

Description: modified (diff)
Keywords: 4dijit added
Owner: changed from haysmark to sjmiles
Status: assignednew
Summary: Safari/Webkit: Strange ComboBox popup positioningSafari/Webkit: Wrong dojo._abs behavior

comment:3 Changed 12 years ago by bill

Component: DijitHTML

comment:4 Changed 12 years ago by guest

Hi all

I'm gathering from the following comment in dojo.js.uncompressed.js that this could have something to do with a change in behaviour in Safari.

// FIXME: getting contrary results to the above in latest WebKit.

I'm attaching a patch that fixes the problem for me.

cheers

Hannes

Changed 12 years ago by guest

Attachment: dojo.coords.patch added

comment:5 Changed 12 years ago by alex

Resolution: fixed
Status: newclosed

(In [11115]) add spacing for Safari. Fixes #4325

comment:6 Changed 12 years ago by bill

Milestone: 1.01.0.1
Resolution: fixed
Status: closedreopened

I just tried the test case on safari (see bug description) and it isn't working. Same for webkit, btw.

comment:7 Changed 12 years ago by bill

Perhaps the problem is just that the above patch has the line dojo.isSafari >= 5, whereas actually safari's is version 3 (and indeed on Safari version 3, dojo.isSafari == 3)

comment:8 Changed 12 years ago by haysmark

Yeah let's try to keep this fixed for 1.0.1.

comment:9 Changed 12 years ago by bill

Resolution: fixed
Status: reopenedclosed

(In [11589]) Fixes #4325 on 1.0 branch: typo in safari version number about messing up dojo.abs() and thus drop down/popup placement

comment:10 Changed 12 years ago by bill

(In [11590]) Fixes #4325 on trunk: typo in safari version number about messing up dojo.abs() and thus drop down/popup placement

Note: See TracTickets for help on using tickets.