You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/03/18 21:08:15 UTC

[GitHub] [netbeans] sdedic opened a new pull request #2817: [NETBEANS-5458] Update Batik SVG to version 1.14

sdedic opened a new pull request #2817:
URL: https://github.com/apache/netbeans/pull/2817


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2817: [NETBEANS-5458] Update Batik SVG to version 1.14

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2817:
URL: https://github.com/apache/netbeans/pull/2817#issuecomment-802704110


   @eirikbakke Applied ... plus added tests to ensure the xlink:href is really detected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic merged pull request #2817: [NETBEANS-5458] Update Batik SVG to version 1.14

Posted by GitBox <gi...@apache.org>.
sdedic merged pull request #2817:
URL: https://github.com/apache/netbeans/pull/2817


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] eirikbakke commented on pull request #2817: [NETBEANS-5458] Update Batik SVG to version 1.14

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on pull request #2817:
URL: https://github.com/apache/netbeans/pull/2817#issuecomment-802465844


   Looks fine. I had a look at BATIK-1276, which was the main change you mentioned in the JIRA issue: https://github.com/apache/xmlgraphics-batik/commit/bc6078ca949039e2076cd08b4cb169c84c1179b1
   
   NetBeans' own SVGIcon class does not use the classes in question. But it would be nice and to do something analogous there, i.e.:
   
   ```
   diff --git a/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java b/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java
   index f6e0347..4bdc7d9 100644
   --- a/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java
   +++ b/platform/openide.util.ui.svg/src/org/openide/util/svg/SVGIcon.java
   @@ -38,11 +38,14 @@ import javax.swing.Icon;
    import org.apache.batik.anim.dom.SAXSVGDocumentFactory;
    import org.apache.batik.bridge.BridgeContext;
    import org.apache.batik.bridge.DocumentLoader;
   +import org.apache.batik.bridge.ExternalResourceSecurity;
    import org.apache.batik.bridge.GVTBuilder;
   +import org.apache.batik.bridge.NoLoadExternalResourceSecurity;
    import org.apache.batik.bridge.UserAgent;
    import org.apache.batik.bridge.UserAgentAdapter;
    import org.apache.batik.ext.awt.image.GraphicsUtil;
    import org.apache.batik.gvt.GraphicsNode;
   +import org.apache.batik.util.ParsedURL;
    import org.apache.batik.util.XMLResourceDescriptor;
    import org.openide.util.CachedHiDPIIcon;
    import org.openide.util.Parameters;
   @@ -137,7 +140,14 @@ final class SVGIcon extends CachedHiDPIIcon {
                /* Don't provide an URI here; we shouldn't commit to supporting relative links from
                loaded SVG documents. */
                doc = factory.createDocument(null, is);
   -            UserAgent userAgent = new UserAgentAdapter();
   +            UserAgent userAgent = new UserAgentAdapter() {
   +              @Override
   +              public ExternalResourceSecurity getExternalResourceSecurity(
   +                  ParsedURL resourceURL, ParsedURL docURL)
   +              {
   +                return new NoLoadExternalResourceSecurity();
   +              }
   +            };
                DocumentLoader loader = new DocumentLoader(userAgent);
                BridgeContext bctx = new BridgeContext(userAgent, loader);
                try {
   ```
   
   Since SVGIcon is only currently used on icon files we provide ourselves, this won't currently make a difference. But it would be nice to do if we ever start using SVGIcon to load arbitrary external SVG files. I can add this the next time I'm working on NetBeans.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] eirikbakke commented on a change in pull request #2817: [NETBEANS-5458] Update Batik SVG to version 1.14

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on a change in pull request #2817:
URL: https://github.com/apache/netbeans/pull/2817#discussion_r597746443



##########
File path: platform/openide.util.ui.svg/test/unit/src/org/openide/util/svg/SVGLoaderImplTest.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.openide.util.svg;
+
+import java.awt.Image;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+import org.netbeans.junit.NbTestCase;
+import org.openide.util.ImageUtilities;
+
+/**
+ *
+ * @author sdedic
+ */
+public class SVGLoaderImplTest extends NbTestCase {

Review comment:
       Oh, you did a lot of work to test this--thank you!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] eirikbakke commented on pull request #2817: [NETBEANS-5458] Update Batik SVG to version 1.14

Posted by GitBox <gi...@apache.org>.
eirikbakke commented on pull request #2817:
URL: https://github.com/apache/netbeans/pull/2817#issuecomment-802892870


   Ah, thank you! Would have done it myself, except building NetBeans takes an hour on my WSL/Windows setup... must get one of those Apple Silicon MacBooks soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists