HtmlIFrameElement
sealed class HtmlIFrameElement : HtmlFrameElementBase, IHtmlInlineFrameElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle, IGlobalEventHandlers, ILoadableElement
Represents the HTML iframe element.
using AngleSharp.Dom.Collections;
using AngleSharp.Dom.Css;
using AngleSharp.Dom.Events;
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, IGlobalEventHandlers, ILoadableElement
{
private SettableTokenList _sandbox;
public Alignment Align {
get {
return this.GetOwnAttribute(AttributeNames.Align).ToEnum(Alignment.Bottom);
}
set {
this.SetOwnAttribute(AttributeNames.Align, value.ToString(), false);
}
}
public string ContentHtml {
get {
return this.GetOwnAttribute(AttributeNames.SrcDoc);
}
set {
this.SetOwnAttribute(AttributeNames.SrcDoc, value, false);
}
}
public ISettableTokenList Sandbox {
get {
if (_sandbox == null) {
_sandbox = new SettableTokenList(this.GetOwnAttribute(AttributeNames.Sandbox));
_sandbox.Changed += delegate(string value) {
UpdateAttribute(AttributeNames.Sandbox, value);
};
}
return _sandbox;
}
}
public bool IsSeamless {
get {
return this.GetBoolAttribute(AttributeNames.SrcDoc);
}
set {
this.SetBoolAttribute(AttributeNames.SrcDoc, value);
}
}
public bool IsFullscreenAllowed {
get {
return this.GetBoolAttribute(AttributeNames.AllowFullscreen);
}
set {
this.SetBoolAttribute(AttributeNames.AllowFullscreen, value);
}
}
public IWindow ContentWindow => base.NestedContext.Current;
public HtmlIFrameElement(Document owner, string prefix = null)
: base(owner, TagNames.Iframe, prefix, NodeFlags.LiteralText)
{
}
internal override string GetContentHtml()
{
return ContentHtml;
}
internal override void SetupElement()
{
base.SetupElement();
if (this.GetOwnAttribute(AttributeNames.SrcDoc) != null)
UpdateSource();
}
internal void UpdateSandbox(string value)
{
_sandbox?.Update(value);
}
}
}