SvgElement
class SvgElement : Element, ISvgElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
Represents an element of the SVG DOM.
using AngleSharp.Dom.Css;
using AngleSharp.Extensions;
using AngleSharp.Html;
using AngleSharp.Services;
namespace AngleSharp.Dom.Svg
{
internal class SvgElement : Element, ISvgElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
{
static SvgElement()
{
Element.RegisterCallback(AttributeNames.Style, delegate(SvgElement element, string value) {
element.UpdateStyle(value);
});
}
public SvgElement(Document owner, string name, string prefix = null, NodeFlags flags = NodeFlags.None)
: base(owner, name, prefix, NamespaceNames.SvgUri, flags | NodeFlags.SvgMember)
{
}
public override INode Clone(bool deep = true)
{
SvgElement svgElement = base.Owner.Options.GetFactory<ISvgElementFactory>().Create(base.Owner, base.LocalName, base.Prefix);
CloneElement(svgElement, deep);
return svgElement;
}
internal override void SetupElement()
{
base.SetupElement();
string ownAttribute = this.GetOwnAttribute(AttributeNames.Style);
if (ownAttribute != null)
UpdateStyle(ownAttribute);
}
}
}