code: private void fillInChainedGradientFields(GradientElement gradient, String href)
     {
        // Locate the referenced object
        SVG.SvgObject  ref = gradient.document.resolveIRI(href);
        if (ref == null) {
           // Non-existent
           warn("Gradient reference '%s' not found", href);
           return;
        }
        if (!(ref instanceof GradientElement)) {
           error("Gradient href attributes must point to other gradient elements");
           return;
        }
        if (ref == gradient) {
           error("Circular reference in gradient href attribute '%s'", href);
           return;
        }
  
        GradientElement  grRef = (GradientElement) ref;
  
        if (gradient.gradientUnitsAreUser == null)
           gradient.gradientUnitsAreUser = grRef.gradientUnitsAreUser;
        if (gradient.gradientTransform == null)
           gradient.gradientTransform = grRef.gradientTransform;
        if (gradient.spreadMethod == null)
           gradient.spreadMethod = grRef.spreadMethod;
        if (gradient.children.isEmpty())
           gradient.children = grRef.children;
  
        try
        {
           if (gradient instanceof SvgLinearGradient) {
              fillInChainedGradientFields((SvgLinearGradient) gradient, (SvgLinearGradient) ref);
           } else {
              fillInChainedGradientFields((SvgRadialGradient) gradient, (SvgRadialGradient) ref);
           }
        }
        catch (ClassCastException e) { /* expected - do nothing */ }
  
        if (grRef.href != null)
           fillInChainedGradientFields(gradient, grRef.href);
     }
docs: /*
  Any unspecified fields in this gradient can be 'borrowed' from another
  gradient specified by the href attribute.