HtmlIFrameElement
sealed class HtmlIFrameElement : HtmlFrameElementBase, IHtmlInlineFrameElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
Represents the HTML iframe element.
using AngleSharp.Dom.Collections;
using AngleSharp.Dom.Css;
using AngleSharp.Extensions;
using AngleSharp.Html;
namespace AngleSharp.Dom.Html
{
internal sealed class HtmlIFrameElement : HtmlFrameElementBase, IHtmlInlineFrameElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
{
private SettableTokenList _sandbox;
public Alignment Align {
get {
return this.GetOwnAttribute(AttributeNames.Align).ToEnum(Alignment.Bottom);
}
set {
this.SetOwnAttribute(AttributeNames.Align, value.ToString());
}
}
public string ContentHtml {
get {
return this.GetOwnAttribute(AttributeNames.SrcDoc);
}
set {
this.SetOwnAttribute(AttributeNames.SrcDoc, value);
}
}
public ISettableTokenList Sandbox {
get {
if (_sandbox == null) {
_sandbox = new SettableTokenList(this.GetOwnAttribute(AttributeNames.Sandbox));
CreateBindings(_sandbox, AttributeNames.Sandbox);
}
return _sandbox;
}
}
public bool IsSeamless {
get {
return this.HasOwnAttribute(AttributeNames.SrcDoc);
}
set {
this.SetOwnAttribute(AttributeNames.SrcDoc, value ? string.Empty : null);
}
}
public bool IsFullscreenAllowed {
get {
return this.HasOwnAttribute(AttributeNames.AllowFullscreen);
}
set {
this.SetOwnAttribute(AttributeNames.AllowFullscreen, value ? string.Empty : null);
}
}
public IWindow ContentWindow => base.NestedContext.Current;
public HtmlIFrameElement(Document owner, string prefix = null)
: base(owner, TagNames.Iframe, prefix, NodeFlags.LiteralText)
{
}
protected override string GetContentHtml()
{
return ContentHtml;
}
internal override void SetupElement()
{
base.SetupElement();
string ownAttribute = this.GetOwnAttribute(AttributeNames.SrcDoc);
RegisterAttributeObserver(AttributeNames.SrcDoc, base.UpdateSource);
if (ownAttribute != null)
UpdateSource(ownAttribute);
}
}
}