DmitryBaranovskiy/raphael — Issue #528: clip-rect attribute lost after moving an element in the hierarchy in IE
Author: alerizzo
Created: 2012-03-01 13:21:39+00:00
State: open

On paths and elements, if clip-rect attribute is set, moving the element in the hierarchy (aka, changing its z-index), makes the item to lose the clip-rect property in IE < 9 (i.e. in VML).

Here is a running example:
http://dl.dropbox.com/u/6700743/issues/raphael-clip-rect/index.html

Here is the source of the script:
```javascript

var paper = new Raphael('test', 600, 400);

var c1 = paper.circle( 100, 100, 50 ).attr({ fill: 'red', 'clip-rect': '75,75,100,100' });
var c2 = paper.circle( 150, 150, 70 ).attr({ fill: 'blue' });

c1.insertAfter(c2); // loses clip-rect

```

Looking at the code is visible that in VML a div with clipping is used to clip the element, but when the item is moved, it is not moved with its parent div (which is responsible for the clip-rect attribute of the element), but left behind as a div with no content.