if (bridge == null || !(bridge instanceof MaskBridge)) {
throw new IllegalAttributeValueException(
Messages.formatMessage("mask.reference.illegal",
new Object[] {maskElement.getLocalName()}));
}
MaskBridge maskBridge = (MaskBridge)bridge;
SVGOMDocument doc = (SVGOMDocument)maskElement.getOwnerDocument();
ViewCSS v = ctx.getViewCSS();
ctx.setViewCSS((ViewCSS)doc.getDefaultView());
Mask mask = maskBridge.createMask(gn,
ctx,
maskElement,
maskedElement);
ctx.setViewCSS(v);
return mask;