Opened 11 years ago

Last modified 3 years ago

#8919 assigned defect

[patch] Charts within different documents throw an error

Reported by: bmilcke Owned by: dylan
Priority: high Milestone: 1.15
Component: DojoX GFX Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

When you have two dojox.charts each within its own iFrame, the second one throws an error, because the measuringNode in dojox.gfx._base._getTextBox is on the wrong document.

I tested this with Dojo 1.2.3, but the affected file _base.js is unchanged at the respective place in HEAD (as of today).

(also affected seems to be dojox/sketch/Annotation.js)

Solution: if the currently stored measuringNode (for finding out the DPI used) is on a different document than dojo.doc, throw it away and create a new one.

Throwing away the old node is necessary, as otherwise you would create additional measuringNodes on each document each time you switch back and forth between the documents. An alternative would be to set an id and retrieve the node back by id, or store the measuringNodes in an associative container where the document is the key.

Attachments (1)

measuringNode.patch (707 bytes) - added by bmilcke 11 years ago.
patch for dojox/gfx/_base.js relative to 1.2.3 release

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by bmilcke

Attachment: measuringNode.patch added

patch for dojox/gfx/_base.js relative to 1.2.3 release

comment:1 Changed 11 years ago by bmilcke

little note: the measuring node in this function is for getting the dimensions of a text, not for determining the DPI.

comment:2 Changed 11 years ago by Eugene Lazutkin

Milestone: tbdfuture
Status: newassigned

Keeping track of node's document looks like a better solution.

Additional note: we need to switch to dojox.html.metrics to measure text.

comment:3 Changed 7 years ago by Colin Snover

Summary: Charts within different documents throw an error[patch] Charts within different documents throw an error

comment:4 Changed 4 years ago by dylan

Milestone: future1.12
Owner: changed from Eugene Lazutkin to dylan

comment:5 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.