Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#16310 closed defect (fixed)

dijit/place can't anchor to SVG elements in Firefox

Reported by: parente Owned by: bill
Priority: undecided Milestone: 1.8.7
Component: Dijit Version: 1.8.1
Keywords: Cc: James Thomas
Blocked By: Blocking:

Description

Bug is in place.js:

var aroundNodePos = (typeof anchor == "string" || "offsetWidth" in anchor)
				? domGeometry.position(anchor, true)
				: anchor;

The anchor element in this case is an SVG descendent element (e.g., svg:circle). In Firefox, SVG elements do not have property offsetWidth. A simple fix that appears to work in FF 15+ is:

			var aroundNodePos = (typeof anchor == "string" || "offsetWidth" in anchor || "ownerSVGElement" in anchor)
				? domGeometry.position(anchor, true)
				: anchor;

The addition of the ownerSVGElement check is enough to get the geometry computed for the anchor SVG element instead of using the element itself (which causes lots of NaNs? downstream). Surprisingly, the lack of offsetWidth doesn't seem to impact the actual tooltip placement in all the tests I ran, but YMMV.

Attachments (1)

16310.html (1.8 KB) - added by bill 6 years ago.
test case, works on chrome but fails on FF

Download all attachments as: .zip

Change History (12)

comment:1 Changed 7 years ago by James Thomas

Cc: James Thomas added

comment:2 Changed 7 years ago by bill

Owner: changed from bill to parente
Status: newpending
Summary: dijit Tooltip broken anchored to SVG elements in Firefoxdijit/place can't anchor to SVG elements in Firefox

Hmm, that expression is getting complicated. I think we could do the reverse check with something like "x" in anchor, or if not that, then some expression that will catch any element (SVG or HTML), like (typeof anchor == "string" || "nodeName" in anchor). Do either of those work?

comment:3 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:4 Changed 7 years ago by bill

I was hoping for a response on this, or at least a test case. If you are still interested in the ticket getting fixed, give a response with at least one of those.

comment:5 Changed 7 years ago by acurtiss

I am having the same problem in a mapping application I am working on using the ESRI Javascript API. Attaching a tooltip to a 'path' element works on Chrome, but not on Firefox. Has any fix / workaround been provided for this issue?

Thanks for your help, Aaron

comment:6 Changed 7 years ago by bill

If you have a test case feel free to attach it and then write a comment, and we'll reopen the ticket.

Changed 6 years ago by bill

Attachment: 16310.html added

test case, works on chrome but fails on FF

comment:7 Changed 6 years ago by bill

Resolution: invalid
Status: closedreopened

Note the test case above has commented out workaround code.

comment:8 Changed 6 years ago by bill

Milestone: tbd1.8.7
Owner: changed from parente to bill
Status: reopenedassigned

comment:9 Changed 6 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In cc6155e589a1c2d523b50497febf2b3550cb1431/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:10 Changed 6 years ago by Bill Keese <bill@…>

In a696ceb7e4fd6c793327df992ec5d972e08781aa/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:11 Changed 6 years ago by Bill Keese <bill@…>

In 939575add4055bc3fa009638c817d806e583c2ee/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.