You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by de...@apache.org on 2005/10/06 04:03:37 UTC

svn commit: r306497 - in /xmlgraphics/batik/trunk: samples/solitaire/script/ sources/org/apache/batik/bridge/

Author: deweese
Date: Wed Oct  5 19:03:27 2005
New Revision: 306497

URL: http://svn.apache.org/viewcvs?rev=306497&view=rev
Log:
1) Fixes problem resolving 'chained' attributes in documents
   that have a 'null' URL (loaded from a stream). PR 36924
2) Small optimization on card.js.

Modified:
    xmlgraphics/batik/trunk/samples/solitaire/script/card.js
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java

Modified: xmlgraphics/batik/trunk/samples/solitaire/script/card.js
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/samples/solitaire/script/card.js?rev=306497&r1=306496&r2=306497&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/samples/solitaire/script/card.js (original)
+++ xmlgraphics/batik/trunk/samples/solitaire/script/card.js Wed Oct  5 19:03:27 2005
@@ -126,6 +126,7 @@
 }
 
 Card.prototype.setPos = function(x, y) {
+  if ((this.x == x) && (this.y == y)) return;
   this.x = x;
   this.y = y;
   this.elem.setAttribute("transform", "translate("+x+","+y+")");

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java?rev=306497&r1=306496&r2=306497&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java Wed Oct  5 19:03:27 2005
@@ -191,12 +191,8 @@
                 return null; // no xlink:href found, exit
             }
             // check if there is circular dependencies
-            SVGOMDocument doc = (SVGOMDocument)paintElement.getOwnerDocument();
-            ParsedURL purl = new ParsedURL(doc.getURL(), uri);
-            if (!purl.complete())
-                throw new BridgeException(paintElement,
-                                          ERR_URI_MALFORMED,
-                                          new Object[] {uri});
+            String baseURI = paintElement.getBaseURI();
+            ParsedURL purl = new ParsedURL(baseURI, uri);
 
             if (contains(refs, purl)) {
                 throw new BridgeException(paintElement,

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java?rev=306497&r1=306496&r2=306497&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGColorProfileElementBridge.java Wed Oct  5 19:03:27 2005
@@ -98,17 +98,17 @@
         String href = XLinkSupport.getXLinkHref(profile);
         ICC_Profile p = null;
         if (href != null) {
-            String baseURI= ((SVGOMDocument)doc).getURL();
-            ParsedURL purl = new ParsedURL(baseURI, href);
+            String baseURI = profile.getBaseURI();
+            ParsedURL pDocURL = null;
+            if (baseURI != null) {
+                pDocURL = new ParsedURL(baseURI);
+            }
+
+            ParsedURL purl = new ParsedURL(pDocURL, href);
             if (!purl.complete()) 
                 throw new BridgeException(paintedElement, ERR_URI_MALFORMED,
                                           new Object[] {href});
             try{
-                ParsedURL pDocURL = null;
-                if (baseURI != null) {
-                    pDocURL = new ParsedURL(baseURI);
-                }
-
                ctx.getUserAgent().checkLoadExternalResource(purl, 
                                                             pDocURL);
 

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java?rev=306497&r1=306496&r2=306497&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java Wed Oct  5 19:03:27 2005
@@ -257,13 +257,8 @@
             if (uriStr.length() == 0) { // exit if no more xlink:href
                 return "";
             }
-            SVGDocument svgDoc = (SVGDocument)e.getOwnerDocument();
-            String baseURI = ((SVGOMDocument)svgDoc).getURL();
-
+            String baseURI = e.getBaseURI();
             ParsedURL purl = new ParsedURL(baseURI, uriStr);
-            if (!purl.complete()) 
-                throw new BridgeException(e, ERR_URI_MALFORMED,
-                                          new Object[] {uriStr});
 
             Iterator iter = refs.iterator();
             while (iter.hasNext()) {
@@ -274,6 +269,7 @@
             }
 
             try {
+                SVGDocument svgDoc = (SVGDocument)e.getOwnerDocument();
                 URIResolver resolver = ctx.createURIResolver(svgDoc, loader);
                 e = resolver.getElement(purl.toString(), e);
                 refs.add(purl);