getSVGRenderBox method

RenderBoxModel getSVGRenderBox(
  1. String tagName
)

Implementation

RenderBoxModel getSVGRenderBox(String tagName) {
  final Constructor = svgElementsRegistry[tagName];
  if (Constructor != null) {
    final element = Constructor(null);
    if (tagName == TAG_SVG) {
      /// See [setAttribute]
      element.renderStyle.height = CSSLengthValue.auto;
      element.renderStyle.width = CSSLengthValue.auto;
    }
    element.tagName = tagName;
    element.namespaceURI = SVG_ELEMENT_URI;
    element.createRenderer();
    return element.renderBoxModel!;
  }
  print('Unknown SVG element $tagName');
  final element = SVGUnknownElement(null);
  element.tagName = tagName;
  element.namespaceURI = SVG_ELEMENT_URI;
  return element.renderBoxModel!;
}