-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BridgeException: Cannot find the referenced element #80
Comments
carlosame
added a commit
that referenced
this issue
Jun 14, 2023
Instead of throwing an exception (and stop processing) on a missing reference, just report the error via the user agent and keep processing. This is what a conformant user agent is supposed to do. There are other circumstances (like other I/O errors) where it would make sense to behave in the same way, but this is deferred to future updates. The `slideshow` and `extension` modules are also affected.
Filed a PR that closes this. |
carlosame
added a commit
that referenced
this issue
Jun 15, 2023
Instead of throwing an exception (and stop processing) on a missing reference, just report the error via the user agent and keep processing. This is what a conformant user agent is supposed to do. There are other circumstances (like other I/O errors) where it would make sense to behave in the same way, but this is deferred to future updates. The `slideshow` and `extension` modules are also affected.
carlosame
added a commit
that referenced
this issue
Jun 15, 2023
carlosame
added a commit
that referenced
this issue
Jun 15, 2023
Instead of throwing an exception (and stop processing) on a missing reference, just report the error via the user agent and keep processing. This is what a conformant user agent is supposed to do. There are other circumstances (like other I/O errors) where it would make sense to behave in the same way, but this is deferred to future updates. The `slideshow` and `extension` modules are also affected.
carlosame
added a commit
that referenced
this issue
Jun 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replicate
Create an SVG file with an unused reference. This can happen by editing an SVG created in Adobe Illustrator with Inkscape and removing objects. See e.svg.txt. Essentially:
Rasterize the file using EchoSVG.
Expected
The unused reference is ignored and rasterizing continues. This is the behaviour that Inkscape takes, which permits it to load the image:
Actual
Exception is thrown and the image is not rasterized.
The root cause is
BridgeContext.java
, line 752, where it is assumed incorrectly that all suchElement
instances have a validNode
reference:This exception is caught by
SVGAbstractTransformer
at line 261 and wrapped into a new exception:By the time it is wrapped and re-thrown as a
TranscoderException
, it's too late to intervene. Perhaps instead of creating aBridgeException
, there needs to be anUndefinedReferenceException
subclass ofBridgeException
? That way the exception can still be caught bySVGAbstractTransformer
yet passed along to theErrorHandler
instead of being wrapped and re-thrown?Another idea would be to create an "Empty" node/element to represent a missing reference, but that would needlessly clutter the DOM or have any number of unintended side-effects, I imagine, because
getReferencedNode
is used in many places.The text was updated successfully, but these errors were encountered: