CssMarginLeftProperty
Information can be found on MDN:
https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left
Gets the margin relative to the width of the containing block or a
fixed width, if any.
Gets if the margin is automatically determined.
using AngleSharp.Css;
using AngleSharp.Extensions;
namespace AngleSharp.Dom.Css
{
internal sealed class CssMarginLeftProperty : CssProperty
{
internal CssMarginLeftProperty(CssStyleDeclaration rule)
: base(PropertyNames.MarginLeft, rule, PropertyFlags.Unitless | PropertyFlags.Animatable)
{
}
protected override object GetDefault(IElement element)
{
return Length.Zero;
}
protected override object Compute(IElement element)
{
return Converters.AutoLengthOrPercentConverter.Convert(base.Value);
}
protected override bool IsValid(ICssValue value)
{
return Converters.AutoLengthOrPercentConverter.Validate(value);
}
}
}