HTMLAnchorElement
Represents an anchor element.
using AngleSharp.DOM.Collections;
using System;
namespace AngleSharp.DOM.Html
{
[DOM("HTMLAnchorElement")]
public sealed class HTMLAnchorElement : HTMLElement, IFormatting
{
private DOMTokenList _relList;
[DOM("accessKey")]
public string AccessKey {
get {
return GetAttribute("accesskey");
}
set {
SetAttribute("accesskey", value);
}
}
[DOM("charset")]
public string Charset {
get {
return GetAttribute("charset");
}
set {
SetAttribute("charset", value);
}
}
[DOM("download")]
public string Download {
get {
return GetAttribute("download");
}
set {
SetAttribute("download", value);
}
}
[DOM("href")]
public string Href {
get {
return HyperRef(GetAttribute("href"));
}
set {
SetAttribute("href", value);
}
}
[DOM("hreflang")]
public string Hreflang {
get {
return GetAttribute("hreflang");
}
set {
SetAttribute("hreflang", value);
}
}
[DOM("media")]
public string Media {
get {
return GetAttribute("media");
}
set {
SetAttribute("media", value);
}
}
[DOM("name")]
public string Name {
get {
return GetAttribute("name");
}
set {
SetAttribute("name", value);
}
}
[DOM("rel")]
public string Rel {
get {
return GetAttribute("rel");
}
set {
SetAttribute("rel", value);
}
}
[DOM("hash")]
public string Hash {
get {
return new Location(Href).Hash;
}
set {
Location location = new Location(Href);
location.Hash = value;
Href = location.Href;
}
}
[DOM("host")]
public string Host {
get {
return new Location(Href).Host;
}
set {
Location location = new Location(Href);
location.Host = value;
Href = location.Href;
}
}
[DOM("hostname")]
public string HostName {
get {
return new Location(Href).HostName;
}
set {
Location location = new Location(Href);
location.HostName = value;
Href = location.Href;
}
}
[DOM("pathname")]
public string PathName {
get {
return new Location(Href).PathName;
}
set {
Location location = new Location(Href);
location.PathName = value;
Href = location.Href;
}
}
[DOM("port")]
public string Port {
get {
return new Location(Href).Port;
}
set {
Location location = new Location(Href);
location.Port = value;
Href = location.Href;
}
}
[DOM("protocol")]
public string Protocol {
get {
return new Location(Href).Protocol;
}
set {
Location location = new Location(Href);
location.Protocol = value;
Href = location.Href;
}
}
[DOM("search")]
public string Search {
get {
return new Location(Href).Search;
}
set {
Location location = new Location(Href);
location.Search = value;
Href = location.Href;
}
}
[DOM("relList")]
public DOMTokenList RelList {
get {
return _relList ?? (_relList = new DOMTokenList(this, "rel"));
}
}
[DOM("target")]
public string Target {
get {
return GetAttribute("target");
}
set {
SetAttribute("target", value);
}
}
[DOM("text")]
public string Text {
get {
return TextContent;
}
set {
TextContent = value;
}
}
[DOM("type")]
public string Type {
get {
return GetAttribute("type");
}
set {
SetAttribute("type", value);
}
}
internal bool IsVisited { get; set; }
internal bool IsActive { get; set; }
internal HTMLAnchorElement()
{
_name = "a";
}
internal override void OnAttributeChanged(string name)
{
if (name.Equals("rel", StringComparison.Ordinal))
RelList.Update(Rel);
else
base.OnAttributeChanged(name);
}
}
}