CssPerspectiveProperty
More information available at:
https://developer.mozilla.org/en-US/docs/Web/CSS/perspective
Gets the distance from the user to the z=0 plane. It is used to
apply a perspective transform to the element and its content. If it
0 or a negative value, no perspective transform is applied.
using AngleSharp.Css;
using AngleSharp.Css.Values;
using AngleSharp.Extensions;
namespace AngleSharp.Dom.Css
{
internal sealed class CssPerspectiveProperty : CssProperty
{
private static readonly IValueConverter<Length> Converter = Converters.LengthConverter.Or(Keywords.None, Length.Zero);
internal CssPerspectiveProperty(CssStyleDeclaration rule)
: base(PropertyNames.Perspective, rule, PropertyFlags.Animatable)
{
}
protected override object GetDefault(IElement element)
{
return Length.Zero;
}
protected override object Compute(IElement element)
{
return Converter.Convert(base.Value);
}
protected override bool IsValid(CssValue value)
{
return Converter.Validate(value);
}
}
}