AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.9.8.1" />

.NET API 1,214,976 bytes

 HtmlObjectElement

Represents the HTML object element.
using AngleSharp.Dom.Css; using AngleSharp.Dom.Events; using AngleSharp.Extensions; using AngleSharp.Html; using AngleSharp.Network; using AngleSharp.Network.RequestProcessors; namespace AngleSharp.Dom.Html { internal sealed class HtmlObjectElement : HtmlFormControlElement, IHtmlObjectElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle, IGlobalEventHandlers, IValidation, ILoadableElement { private readonly ObjectRequestProcessor _request; public IDownload CurrentDownload => _request?.Download; public string Source { get { return this.GetUrlAttribute(AttributeNames.Data); } set { this.SetOwnAttribute(AttributeNames.Data, value, false); } } public string Type { get { return this.GetOwnAttribute(AttributeNames.Type); } set { this.SetOwnAttribute(AttributeNames.Type, value, false); } } public bool TypeMustMatch { get { return this.HasOwnAttribute(AttributeNames.TypeMustMatch); } set { this.SetOwnAttribute(AttributeNames.TypeMustMatch, value ? string.Empty : null, false); } } public string UseMap { get { return this.GetOwnAttribute(AttributeNames.UseMap); } set { this.SetOwnAttribute(AttributeNames.UseMap, value, false); } } public int DisplayWidth { get { return this.GetOwnAttribute(AttributeNames.Width).ToInteger(OriginalWidth); } set { this.SetOwnAttribute(AttributeNames.Width, value.ToString(), false); } } public int DisplayHeight { get { return this.GetOwnAttribute(AttributeNames.Height).ToInteger(OriginalHeight); } set { this.SetOwnAttribute(AttributeNames.Height, value.ToString(), false); } } public int OriginalWidth => _request?.Width ?? 0; public int OriginalHeight => _request?.Height ?? 0; public IDocument ContentDocument => null; public IWindow ContentWindow => null; static HtmlObjectElement() { Element.RegisterCallback(AttributeNames.Data, delegate(HtmlObjectElement element, string value) { element.UpdateSource(value); }); } public HtmlObjectElement(Document owner, string prefix = null) : base(owner, TagNames.Object, prefix, NodeFlags.Scoped) { _request = ObjectRequestProcessor.Create(this); } protected override bool CanBeValidated() { return false; } internal override void SetupElement() { base.SetupElement(); string ownAttribute = this.GetOwnAttribute(AttributeNames.Data); if (ownAttribute != null) UpdateSource(ownAttribute); } private void UpdateSource(string value) { Url url = new Url(Source); this.Process(_request, url); } } }