CssCaptionSideProperty
Information can be found on MDN:
https://developer.mozilla.org/en-US/docs/Web/CSS/caption-side
using AngleSharp.Css;
namespace AngleSharp.Dom.Css
{
internal sealed class CssCaptionSideProperty : CssProperty, ICssCaptionSideProperty, ICssProperty
{
internal static readonly IValueConverter<bool> Converter = Converters.Toggle(Keywords.Top, Keywords.Bottom);
internal static readonly bool Default = true;
private bool _top;
public bool IsOnTop => _top;
internal CssCaptionSideProperty(CssStyleDeclaration rule)
: base(PropertyNames.CaptionSide, rule, PropertyFlags.None)
{
Reset();
}
public void SetMode(bool onTop)
{
_top = onTop;
}
internal override void Reset()
{
_top = Default;
}
protected override bool IsValid(ICssValue value)
{
return Converter.TryConvert(value, SetMode);
}
}
}