HTMLFormControlElement
Represents the base class for all HTML form control elements.
using AngleSharp.DOM.Collections;
namespace AngleSharp.DOM.Html
{
public abstract class HTMLFormControlElement : HTMLElement, ILabelabelElement
{
private NodeList labels;
public bool SupportsLabels { get; set; }
public NodeList Labels => labels;
internal HTMLFormControlElement()
{
labels = new NodeList();
}
protected HTMLFormElement GetAssignedForm()
{
Node node = _parent;
while (!(node is HTMLFormElement) && node != null) {
node = node.ParentElement;
}
if (node == null && _owner == null)
return null;
if (node == null) {
string attribute = GetAttribute("form");
if (node != null || string.IsNullOrEmpty(attribute))
return null;
node = _owner.GetElementById(attribute);
}
return node as HTMLFormElement;
}
}
}