Opened 13 years ago
Last modified 6 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)
Change History (6)
Changed 13 years ago by
Attachment: | measuringNode.patch added |
---|
comment:1 Changed 13 years ago by
little note: the measuring node in this function is for getting the dimensions of a text, not for determining the DPI.
comment:2 Changed 13 years ago by
Milestone: | tbd → future |
---|---|
Status: | new → assigned |
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 9 years ago by
Summary: | Charts within different documents throw an error → [patch] Charts within different documents throw an error |
---|
comment:4 Changed 6 years ago by
Milestone: | future → 1.12 |
---|---|
Owner: | changed from Eugene Lazutkin to dylan |
comment:5 Changed 6 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
patch for dojox/gfx/_base.js relative to 1.2.3 release