Rectangle2D r = CSSUtilities.convertEnableBackground(e);
if (r != null) {
result.setBackgroundEnable(r);
}
SVGSVGElement svgElement = imgDocument.getRootElement();
CanvasGraphicsNode node;
node = (CanvasGraphicsNode)subCtx.getGVTBuilder().build
(subCtx, svgElement);
if (eng == null) // If we "created" this document then add listerns.
subCtx.addUIEventListeners(imgDocument);
// HACK: remove the clip set by the SVGSVGElement as the overflow
// and clip properties must be ignored. The clip will be set later
// using the overflow and clip of the <image> element.
node.setClip(null);
// HACK: remove the viewingTransform set by the SVGSVGElement
// as the viewBox must be ignored. The viewingTransform will
// be set later using the width/height of the image element.
node.setViewingTransform(new AffineTransform());
result.getChildren().add(node);
// create the implicit viewBox for the SVG image. The viewBox for a
// SVG image is the viewBox of the outermost SVG element of the SVG file
String viewBox =
svgElement.getAttributeNS(null, SVG_VIEW_BOX_ATTRIBUTE);
float [] vb = ViewBox.parseViewBoxAttribute(e, viewBox);
initializeViewport(ctx, e, result, vb, bounds);
// add a listener on the outermost svg element of the SVG image.