HtmlMapElement
sealed class HtmlMapElement : HtmlElement, IHtmlMapElement, IHtmlElement, IElement, INode, IEventTarget, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
Represents the HTML map element.
using AngleSharp.Dom.Collections;
using AngleSharp.Dom.Css;
using AngleSharp.Html;
namespace AngleSharp.Dom.Html
{
internal sealed class HtmlMapElement : HtmlElement, IHtmlMapElement, IHtmlElement, IElement, INode, IEventTarget, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
{
public string Name {
get {
return GetAttribute(AttributeNames.Name);
}
set {
SetAttribute(AttributeNames.Name, value);
}
}
public IHtmlCollection Areas => new HtmlCollection<IHtmlAreaElement>(this, false, null);
public IHtmlCollection Images => new HtmlCollection<IHtmlImageElement>(base.Owner.DocumentElement, true, IsAssociatedImage);
public HtmlMapElement(Document owner)
: base(owner, Tags.Map, NodeFlags.None)
{
}
private bool IsAssociatedImage(IHtmlImageElement image)
{
string useMap = image.UseMap;
if (!string.IsNullOrEmpty(useMap)) {
string b = (useMap[0] == '#') ? ('#' + Name) : Name;
return useMap == b;
}
return false;
}
}
}