// Copyright 2017-2022 The MathJax Consortium
// SPDX-License-Identifier: Apache-2.0
// This file is a Go translation and modification of MathJax 3.2.2.

package svg

import 

func ( *wrapper) ( *layout.BBox) {
	if len(.children) == 0 {
		return
	}
	 := .children[0].getBBox()
	.W, .H, .D = .W, .H, .D
}

func ( *wrapper) ( *Element) {
	 := .standardSVG()
	if len(.children) != 0 {
		.children[0].toSVG()
	}
}

// SVGannotation has two intentional FIXMEs upstream: it produces its generic
// child SVG but leaves the bounding box at zero.  Semantics never selects an
// annotation for visual output, so this behavior is observable only when a
// source-shaped annotation is rendered directly.
func ( *wrapper) ( *layout.BBox) {
	.W, .H, .D = 0, 0, 0
}

func ( *wrapper) ( *Element) {
	 := .standardSVG()
	.addChildren()
}

func ( *wrapper) ( *layout.BBox) {
	.computeChildrenBBox()
}

func ( *wrapper) ( *Element) {
	 := .standardSVG()
	 := 0.0
	for ,  := range .children {
		if .node.Kind == "XML" || .node.Kind == "xml" {
			.xmlToSVG()
		} else {
			.toSVG()
		}
		 := .outerBBox()
		.place(+.L*.RScale, 0)
		 += (.L + .W + .R) * .RScale
	}
}

// D2's LiteAdaptor reports an all-zero DOM bbox for embedded XML.  The shared
// Go MML node deliberately has no opaque browser-DOM payload, so the exact
// reachable compatibility behavior is a zero-size foreignObject container.
func ( *wrapper) ( *layout.BBox) {
	.W, .H, .D = 0, 0, 0
}

func ( *wrapper) ( *Element) {
	 := .getBBox()
	 := .renderer.options.Em
	 := NewElement("foreignObject").
		SetAttr("data-mjx-xml", "true").
		SetAttr("y", jsFixed(-.H*, 1)+"px").
		SetAttr("width", jsFixed(.W*, 1)+"px").
		SetAttr("height", jsFixed((.H+.D)*, 1)+"px").
		SetAttr("transform", "scale("+fixed(1/)+") matrix(1 0 0 -1 0 0)")
	.element = 
	.Append()
}