cjolif 01/10/10 08:30:59 Modified: sources/org/apache/batik/bridge GVTBuilder.java BridgeEventSupport.java Log: When an SVG files was references through an 'image' elements, the scripts in that referenced file were not called. Fix it. Revision Changes Path 1.13 +8 -2 xml-batik/sources/org/apache/batik/bridge/GVTBuilder.java Index: GVTBuilder.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/GVTBuilder.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- GVTBuilder.java 2001/10/08 15:49:37 1.12 +++ GVTBuilder.java 2001/10/10 15:30:59 1.13 @@ -30,7 +30,7 @@ * This class is responsible for creating a GVT tree using an SVG DOM tree. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: GVTBuilder.java,v 1.12 2001/10/08 15:49:37 hillion Exp $ + * @version $Id: GVTBuilder.java,v 1.13 2001/10/10 15:30:59 cjolif Exp $ */ public class GVTBuilder implements SVGConstants { @@ -88,7 +88,7 @@ } // <!> FIXME: TO BE REMOVED if (ctx.isDynamic()) { - BridgeEventSupport.loadScripts(ctx, document); + BridgeEventSupport.loadScripts(ctx, svgElement); BridgeEventSupport.addGVTListener(ctx, svgElement); } return rootNode; @@ -120,6 +120,12 @@ buildComposite(ctx, e, (CompositeGraphicsNode)gn); } gnBridge.buildGraphicsNode(ctx, e, gn); + } + // <!> FIXME: see build(BridgeContext, Element) + // + may load the script twice (for example + // outside 'use' is ok versus local 'use' maybe wrong). + if (ctx.isDynamic()) { + BridgeEventSupport.loadScripts(ctx, e); } return gn; } 1.16 +5 -4 xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java Index: BridgeEventSupport.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- BridgeEventSupport.java 2001/10/08 15:07:51 1.15 +++ BridgeEventSupport.java 2001/10/10 15:30:59 1.16 @@ -53,7 +53,7 @@ * on the GVT root to propagate GVT events to the DOM. * @author <a href="mailto:[EMAIL PROTECTED]>Christophe Jolif</a> * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: BridgeEventSupport.java,v 1.15 2001/10/08 15:07:51 cjolif Exp $ + * @version $Id: BridgeEventSupport.java,v 1.16 2001/10/10 15:30:59 cjolif Exp $ */ class BridgeEventSupport implements SVGConstants { private static final String[] EVENT_ATTRIBUTES_GRAPHICS = { @@ -326,9 +326,10 @@ } } - public static void loadScripts(BridgeContext ctx, Document doc) { - NodeList list = doc.getElementsByTagNameNS(SVG_NAMESPACE_URI, - SVG_SCRIPT_TAG); + public static void loadScripts(BridgeContext ctx, Element element) { + Document doc = element.getOwnerDocument(); + NodeList list = element.getElementsByTagNameNS(SVG_NAMESPACE_URI, + SVG_SCRIPT_TAG); final UserAgent ua = ctx.getUserAgent(); String language = null; Element selement = null;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]