REH Wolfgang wrote:


When you say you change the 'use'ed element you are changing the 'style' attribute on the 'use' element and having it 'cascade' into the symbol content?


Yes, that's what I want. I want to change the colour of an element that is pulled in from another document via 'use'. The symbol itself doesn't have any colouring (no 'stroke:rgb(r,g,b)' in the 'style' attribute). The colour should be inherited from the 'style' attribute of the 'use' element. Isn't that what inheritance in SVG is about?

Yes, but it wasn't clear that you were changing the use element. I thought you were changing part of the tree the use element referenced.

If so then yes, this was turned off in 1.5.1, but it was pretty badly broken in 1.5. In particular when this happened the used content was updated using the 'host' document's CSS style sheets. If you really want the old behavior back the change is _very_ minor, in SVGUseElementBridge:197 replace 'isLocal' with 'true'.

I'll try that. Or is there another way to get what I described above?

Fix the fundamental bug in Batik so I can turn it back on for everyone :)

PS: All changes to the DOM-tree are made via calls to like

Canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new


SetElementAttribute(UseElement, MyConstants.StyleAttribute, Style));

This is a pretty heavy weight way to update attributes, I hope you don't do this a lot!

Well, I tried to change the attributes directly, but then the Canvas won't redraw the elements until the mouse is moved. That's why I queue the attribute updates to the UpdateManager. I didn't find a way without that overhead.

Well I was more suggesting that you 'batch' the attribute updates, or even run the code making all the updates in the update manager thread.

    Which actually makes me think that you might be 'looking at' the
DOM tree from outside the UpdateManager thread.  While this isn't as
bad as changing it from outside the UpdateManager thread it could
still cause problems (especially if you use things like
'getElementsByTagNameNS' or even just 'getElementById' as something in
the UpdateManager could be in the middle of adding an element and the
data structures could be temporarily 'broken'.



Regards, Wolfgang Reh

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to