Rüdiger Groß-Hardt created BATIK-1365:
-----------------------------------------
Summary: JSVGCanvas shows error, when displaying SVG with
javascript
Key: BATIK-1365
URL: https://issues.apache.org/jira/browse/BATIK-1365
Project: Batik
Issue Type: Bug
Components: Scripting
Affects Versions: 1.17
Environment: Windows 11, tested on Java 8 and Java 17 (temurin)
Reporter: Rüdiger Groß-Hardt
Attachments: TestClass.java, pom.xml, simple.svg
When using a JSVGCanvas to display a SVG, which has an <script
type="text/ecmascript"/> element, the following error is displayed in a message
box:
_"Function importClass must be called with a class; had "[JavaPackage
org.w3c.dom.DOMImplementationSource]"._
This problem broke our code, when we switched from batik 1.16 to 1.17.
The problem seems to be a mismatch between the classes imported from the
default ImportInfo.getImports() in RhinoInterpreter.init() and the new
RhinoClassShutter, which disables access to all java class, unless somebody
adds them to RhinoClassShutter.WHITELIST.
While it is simple to add the files from ImportInfo.getImports().getClasses()
to RhinoClassShutter.WHITELIST, it is difficult to know, whether these classes
are essential to the JavaScript scripting support or not.
Please find attached a simple program and SVG file, which reproduces the
problem.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]