Opened 11 years ago

Closed 6 years ago

#11752 closed defect (patchwelcome)

dojo._base.html dojo._getMarginBox problem with FireFox

Reported by: j105rob Owned by: Eugene Lazutkin
Priority: high Milestone: 1.13
Component: HTML Version: 1.4.3
Keywords: Cc: Eugene Lazutkin, Douglas Hays
Blocked By: Blocking:


The computed style attributes top and left are incorrect for any position:relative element. The IRC #firefox folks stated that they have no provision in their specification for the top and left attributes and stated that the only "real" way to determine top and left would be to crawl up the hierarchy adding up the offsets.

However, it appears that modifying the "If" statement on line 790 to "if(!isNaN(sl) && !isNaN(st) && sl > 0 && st > 0)" will preserve the initial values of the top left, as defined by line 781 ("var l = node.offsetLeft - me.l, t = node.offsetTop - me.t"), since the top and left in the compute style will always be zero in this case.

I am using version 1.4.3, however, wuhi on the irc channel has determined that the issue still exists in version 1.5.

Attachments (1)

xd_FloatingPane.html (4.7 KB) - added by j105rob 11 years ago.
Demo of issue using xd dojo v 1.5

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by j105rob

Attachment: xd_FloatingPane.html added

Demo of issue using xd dojo v 1.5

comment:1 Changed 11 years ago by Eugene Lazutkin

Cc: Eugene Lazutkin added

comment:2 Changed 11 years ago by bill

Cc: Douglas Hays added

The documentation for dojo.marginBox() etc. left/top value is vague, so it's unclear what it's supposed to return. IIRC we tell people to use dojo.position() instead. Doug can comment more. Does dojo.position() have the same issue?

comment:3 Changed 11 years ago by j105rob

I changed my test to utilize dojo.position vs. dojo.marginBox. My results were what I expected and it appears that the implementation of dojo.position is working correctly.

Since it appears in my case that x/y can be utilized for top/left, assuming that x/y and top/left operate on the same coordinates, I will switch my code.

However I would suggest that if the implementation for dojo.position is more in line with what is needed for marginBox, that either you deprecate marginBox or just call dojo.position from marginBox (setting includeScroll = true).

comment:4 Changed 11 years ago by Chris Mitchell

Owner: anonymous deleted

comment:5 Changed 10 years ago by bill

Component: CoreHTML
Owner: set to Eugene Lazutkin
Status: newassigned

comment:6 Changed 6 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: assignedclosed

Given that no one has shown interest in creating a patch in the past 5+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.