Opened 7 years ago

Closed 4 years ago

#15291 closed defect (patchwelcome)

dojox.gfx Linear Gradient not painting in IE (vml) when parent node not present in document

Reported by: biancaj Owned by: Eugene Lazutkin
Priority: low Milestone: 1.13
Component: DojoX GFX Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Eugene Lazutkin)

We are running into this problem on IE with VML in two different scenarios:

  1. when creating the canvas, all parent nodes of the surface must be added to the document first. We are working around this by making sure things happen in that order.
  2. when moving the canvas from one parent (or any grand-parent) to another, it will not paint after adding to the new parent. -- harder to workaround.

Reproduce-able by the following code snippet:

var div = dojo.create("div");
divParent.appendChile(div); // surface won't paint if any parent node not present the document first.
var surface = dojox.gfx.createSurface(div, SURFACE_WIDTH, SURFACE_HEIGHT); 
var rectangle = surface.createRect({x: (BAR_ORIGIN_X-1), y: BAR_ORIGIN_Y, width: (BAR_WIDTH+2), height: BAR_HEIGHT });
rectangle.setFill({ type:"linear",
x1: 0, y1: 0,
x2: (BAR_WIDTH+2), y2: 0,
colors: [{
offset: 0,
color: BAR_COLOR_A
}, {
offset: 0.55,
color: BAR_COLOR_B
}, {
offset: 1,
color: BAR_COLOR_C
}]
});

Attachments (1)

test_15291.html (899 bytes) - added by Eric Durocher 6 years ago.
Test case for ticket #15291

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by biancaj

Any plans on fixing this?

comment:2 Changed 7 years ago by Eugene Lazutkin

Milestone: tbdfuture
Priority: undecidedlow

A parent node should be always present in the document for a VML renderer. In fact that the normal situation with dojox/gfx --- all shapes are created explicitly with a parent already preset. Otherwise bad things happen. Unfortunately it is a VML bug, and so far we were unsuccessful fighting it across the whole IE line (6-8).

If you want to move nodes between different canvases, or want to remove some stuff completely and insert it later, you best bet is to kill shapes and recreate then anew. Hint: take a look at dojox/gfx/utils.js with its serialize/deserialize facilities.

comment:3 Changed 7 years ago by Eugene Lazutkin

Description: modified (diff)

And I didn't get the example, which is supposed to to reproduce the problem. Does it work as is or not? What am I supposed to see?

Changed 6 years ago by Eric Durocher

Attachment: test_15291.html added

Test case for ticket #15291

comment:4 Changed 6 years ago by Eric Durocher

Attaching a test case that reproduces the problem. Works fine on SVG, fails on IE8.

As @elazutkin says, the problem occurs when shapes are manipulated (in particular, filled with a gradient) before all nodes are added to the DOM (here, the surface is not yet added to its parent div). This is clearly a VML limitation.

comment:5 Changed 4 years ago by dylan

Milestone: future1.12
Resolution: patchwelcome
Status: newclosed

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

Note: See TracTickets for help on using tickets.