Opened 4 years ago

Last modified 2 years ago

#11752 assigned defect

dojo._base.html dojo._getMarginBox problem with FireFox

Reported by: j105rob Owned by: elazutkin
Priority: high Milestone: tbd
Component: HTML Version: 1.4.3
Keywords: Cc: elazutkin, doughays
Blocked by: Blocking:

Description

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 4 years ago.
Demo of issue using xd dojo v 1.5

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by j105rob

Demo of issue using xd dojo v 1.5

comment:1 Changed 4 years ago by elazutkin

  • Cc elazutkin added

comment:2 Changed 4 years ago by bill

  • Cc doughays 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 4 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 3 years ago by chrism

  • Owner anonymous deleted

comment:5 Changed 2 years ago by bill

  • Component changed from Core to HTML
  • Owner set to elazutkin
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.