<commit_before>﻿namespace AngleSharp.DOM.Css
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// Provides string to CSSProperty instance creation mappings.
    /// </summary>
    static class CssPropertyFactory
    {
        static readonly Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>> properties = new Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>>(StringComparer.OrdinalIgnoreCase);

        static CssPropertyFactory()
        {
            properties.Add(PropertyNames.Animation, style => new CSSAnimationProperty(style));
            properties.Add(PropertyNames.AnimationDelay, style => new CSSAnimationDelayProperty(style));
            properties.Add(PropertyNames.AnimationDirection, style => new CSSAnimationDirectionProperty(style));
            properties.Add(PropertyNames.AnimationDuration, style => new CSSAnimationDurationProperty(style));
            properties.Add(PropertyNames.AnimationFillMode, style => new CSSAnimationFillModeProperty(style));
            properties.Add(PropertyNames.AnimationIterationCount, style => new CSSAnimationIterationCountProperty(style));
            properties.Add(PropertyNames.AnimationName, style => new CSSAnimationNameProperty(style));
            properties.Add(PropertyNames.AnimationPlayState, style => new CSSAnimationPlayStateProperty(style));
            properties.Add(PropertyNames.AnimationTimingFunction, style => new CSSAnimationTimingFunctionProperty(style));
            properties.Add(PropertyNames.BackgroundAttachment, style => new CSSBackgroundAttachmentProperty(style));
            properties.Add(PropertyNames.BackgroundColor, style => new CSSBackgroundColorProperty(style));
            properties.Add(PropertyNames.BackgroundClip, style => new CSSBackgroundClipProperty(style));
            properties.Add(PropertyNames.BackgroundOrigin, style => new CSSBackgroundOriginProperty(style));
            properties.Add(PropertyNames.BackgroundSize, style => new CSSBackgroundSizeProperty(style));
            properties.Add(PropertyNames.BackgroundImage, style => new CSSBackgroundImageProperty(style));
            properties.Add(PropertyNames.BackgroundPosition, style => new CSSBackgroundPositionProperty(style));
            properties.Add(PropertyNames.BackgroundRepeat, style => new CSSBackgroundRepeatProperty(style));
            properties.Add(PropertyNames.Background, style => new CSSBackgroundProperty(style));
            properties.Add(PropertyNames.BorderColor, style => new CSSBorderColorProperty(style));
            properties.Add(PropertyNames.BorderSpacing, style => new CSSBorderSpacingProperty(style));
            properties.Add(PropertyNames.BorderCollapse, style => new CSSBorderCollapseProperty(style));
            properties.Add(PropertyNames.BorderStyle, style => new CSSBorderStyleProperty(style));
            properties.Add(PropertyNames.BoxShadow, style => new CSSBoxShadowProperty(style));
            properties.Add(PropertyNames.BoxDecorationBreak, style => new CSSBoxDecorationBreak(style));
            properties.Add(PropertyNames.BreakAfter, style => new CSSBreakAfterProperty(style));
            properties.Add(PropertyNames.BreakBefore, style => new CSSBreakBeforeProperty(style));
            properties.Add(PropertyNames.BreakInside, style => new CSSBreakInsideProperty(style));
            properties.Add(PropertyNames.BackfaceVisibility, style => new CSSBackfaceVisibilityProperty(style));
            properties.Add(PropertyNames.BorderTopLeftRadius, style => new CSSBorderTopLeftRadiusProperty(style));
            properties.Add(PropertyNames.BorderTopRightRadius, style => new CSSBorderTopRightRadiusProperty(style));
            properties.Add(PropertyNames.BorderBottomLeftRadius, style => new CSSBorderBottomLeftRadiusProperty(style));
            properties.Add(PropertyNames.BorderBottomRightRadius, style => new CSSBorderBottomRightRadiusProperty(style));
            properties.Add(PropertyNames.BorderRadius, style => new CSSBorderRadiusProperty(style));
            properties.Add(PropertyNames.BorderImage, style => new CSSBorderImageProperty(style));
            properties.Add(PropertyNames.BorderImageOutset, style => new CSSBorderImageOutsetProperty(style));
            properties.Add(PropertyNames.BorderImageRepeat, style => new CSSBorderImageRepeatProperty(style));
            properties.Add(PropertyNames.BorderImageSource, style => new CSSBorderImageSourceProperty(style));
            properties.Add(PropertyNames.BorderImageSlice, style => new CSSBorderImageSliceProperty(style));
            properties.Add(PropertyNames.BorderImageWidth, style => new CSSBorderImageWidthProperty(style));
            properties.Add(PropertyNames.BorderTopColor, style => new CSSBorderTopColorProperty(style));
            properties.Add(PropertyNames.BorderLeftColor, style => new CSSBorderLeftColorProperty(style));
            properties.Add(PropertyNames.BorderRightColor, style => new CSSBorderRightColorProperty(style));
            properties.Add(PropertyNames.BorderBottomColor, style => new CSSBorderBottomColorProperty(style));
            properties.Add(PropertyNames.BorderTopStyle, style => new CSSBorderTopStyleProperty(style));
            properties.Add(PropertyNames.BorderLeftStyle, style => new CSSBorderLeftStyleProperty(style));
            properties.Add(PropertyNames.BorderRightStyle, style => new CSSBorderRightStyleProperty(style));
            properties.Add(PropertyNames.BorderBottomStyle, style => new CSSBorderBottomStyleProperty(style));
            properties.Add(PropertyNames.BorderTopWidth, style => new CSSBorderTopWidthProperty(style));
            properties.Add(PropertyNames.BorderLeftWidth, style => new CSSBorderLeftWidthProperty(style));
            properties.Add(PropertyNames.BorderRightWidth, style => new CSSBorderRightWidthProperty(style));
            properties.Add(PropertyNames.BorderBottomWidth, style => new CSSBorderBottomWidthProperty(style));
            properties.Add(PropertyNames.BorderWidth, style => new CSSBorderWidthProperty(style));
            properties.Add(PropertyNames.BorderTop, style => new CSSBorderTopProperty(style));
            properties.Add(PropertyNames.BorderRight, style => new CSSBorderRightProperty(style));
            properties.Add(PropertyNames.BorderBottom, style => new CSSBorderBottomProperty(style));
            properties.Add(PropertyNames.BorderLeft, style => new CSSBorderLeftProperty(style));
            properties.Add(PropertyNames.Border, style => new CSSBorderProperty(style));
            properties.Add(PropertyNames.Bottom, style => new CSSBottomProperty(style));
            properties.Add(PropertyNames.Columns, style => new CSSColumnsProperty(style));
            properties.Add(PropertyNames.ColumnCount, style => new CSSColumnCountProperty(style));
            properties.Add(PropertyNames.ColumnWidth, style => new CSSColumnWidthProperty(style));
            properties.Add(PropertyNames.ColumnFill, style => new CSSColumnFillProperty(style));
            properties.Add(PropertyNames.ColumnGap, style => new CSSColumnGapProperty(style));
            properties.Add(PropertyNames.ColumnSpan, style => new CSSColumnSpanProperty(style));
            properties.Add(PropertyNames.ColumnRule, style => new CSSColumnRuleProperty(style));
            properties.Add(PropertyNames.ColumnRuleColor, style => new CSSColumnRuleColorProperty(style));
            properties.Add(PropertyNames.ColumnRuleStyle, style => new CSSColumnRuleStyleProperty(style));
            properties.Add(PropertyNames.ColumnRuleWidth, style => new CSSColumnRuleWidthProperty(style));
            properties.Add(PropertyNames.CaptionSide, style => new CSSCaptionSideProperty(style));
            properties.Add(PropertyNames.Clear, style => new CSSClearProperty(style));
            properties.Add(PropertyNames.Clip, style => new CSSClipProperty(style));
            properties.Add(PropertyNames.Color, style => new CSSColorProperty(style));
            properties.Add(PropertyNames.Content, style => new CSSContentProperty(style));
            properties.Add(PropertyNames.CounterIncrement, style => new CSSCounterIncrementProperty(style));
            properties.Add(PropertyNames.CounterReset, style => new CSSCounterResetProperty(style));
            properties.Add(PropertyNames.Cursor, style => new CSSCursorProperty(style));
            properties.Add(PropertyNames.Direction, style => new CSSDirectionProperty(style));
            properties.Add(PropertyNames.Display, style => new CSSDisplayProperty(style));
            properties.Add(PropertyNames.EmptyCells, style => new CSSEmptyCellsProperty(style));
            properties.Add(PropertyNames.Float, style => new CSSFloatProperty(style));
            properties.Add(PropertyNames.FontFamily, style => new CSSFontFamilyProperty(style));
            properties.Add(PropertyNames.FontSize, style => new CSSFontSizeProperty(style));
            properties.Add(PropertyNames.FontSizeAdjust, style => new CSSFontSizeAdjustProperty(style));
            properties.Add(PropertyNames.FontStyle, style => new CSSFontStyleProperty(style));
            properties.Add(PropertyNames.FontVariant, style => new CSSFontVariantProperty(style));
            properties.Add(PropertyNames.FontWeight, style => new CSSFontWeightProperty(style));
            properties.Add(PropertyNames.FontStretch, style => new CSSFontStretchProperty(style));
            properties.Add(PropertyNames.Font, style => new CSSFontProperty(style));
            properties.Add(PropertyNames.Height, style => new CSSHeightProperty(style));
            properties.Add(PropertyNames.Left, style => new CSSLeftProperty(style));
            properties.Add(PropertyNames.LetterSpacing, style => new CSSLetterSpacingProperty(style));
            properties.Add(PropertyNames.LineHeight, style => new CSSLineHeightProperty(style));
            properties.Add(PropertyNames.ListStyleImage, style => new CSSListStyleImageProperty(style));
            properties.Add(PropertyNames.ListStylePosition, style => new CSSListStylePositionProperty(style));
            properties.Add(PropertyNames.ListStyleType, style => new CSSListStyleTypeProperty(style));
            properties.Add(PropertyNames.ListStyle, style => new CSSListStyleProperty(style));
            properties.Add(PropertyNames.MarginRight, style => new CSSMarginRightProperty(style));
            properties.Add(PropertyNames.MarginLeft, style => new CSSMarginLeftProperty(style));
            properties.Add(PropertyNames.MarginTop, style => new CSSMarginTopProperty(style));
            properties.Add(PropertyNames.MarginBottom, style => new CSSMarginBottomProperty(style));
            properties.Add(PropertyNames.Margin, style => new CSSMarginProperty(style));
            properties.Add(PropertyNames.MaxHeight, style => new CSSMaxHeightProperty(style));
            properties.Add(PropertyNames.MaxWidth, style => new CSSMaxWidthProperty(style));
            properties.Add(PropertyNames.MinHeight, style => new CSSMinHeightProperty(style));
            properties.Add(PropertyNames.MinWidth, style => new CSSMinWidthProperty(style));
            properties.Add(PropertyNames.Opacity, style => new CSSOpacityProperty(style));
            properties.Add(PropertyNames.Orphans, style => new CSSOrphansProperty(style));
            properties.Add(PropertyNames.OutlineColor, style => new CSSOutlineColorProperty(style));
            properties.Add(PropertyNames.OutlineStyle, style => new CSSOutlineStyleProperty(style));
            properties.Add(PropertyNames.OutlineWidth, style => new CSSOutlineWidthProperty(style));
            properties.Add(PropertyNames.Outline, style => new CSSOutlineProperty(style));
            properties.Add(PropertyNames.Overflow, style => new CSSOverflowProperty(style));
            properties.Add(PropertyNames.PaddingTop, style => new CSSPaddingTopProperty(style));
            properties.Add(PropertyNames.PaddingRight, style => new CSSPaddingRightProperty(style));
            properties.Add(PropertyNames.PaddingLeft, style => new CSSPaddingLeftProperty(style));
            properties.Add(PropertyNames.PaddingBottom, style => new CSSPaddingBottomProperty(style));
            properties.Add(PropertyNames.Padding, style => new CSSPaddingProperty(style));
            properties.Add(PropertyNames.PageBreakAfter, style => new CSSPageBreakAfterProperty(style));
            properties.Add(PropertyNames.PageBreakBefore, style => new CSSPageBreakBeforeProperty(style));
            properties.Add(PropertyNames.PageBreakInside, style => new CSSPageBreakInsideProperty(style));
            properties.Add(PropertyNames.Perspective, style => new CSSPerspectiveProperty(style));
            properties.Add(PropertyNames.PerspectiveOrigin, style => new CSSPerspectiveOriginProperty(style));
            properties.Add(PropertyNames.Position, style => new CSSPositionProperty(style));
            properties.Add(PropertyNames.Quotes, style => new CSSQuotesProperty(style));
            properties.Add(PropertyNames.Right, style => new CSSRightProperty(style));
            properties.Add(PropertyNames.TableLayout, style => new CSSTableLayoutProperty(style));
            properties.Add(PropertyNames.TextAlign, style => new CSSTextAlignProperty(style));
            properties.Add(PropertyNames.TextDecoration, style => new CSSTextDecorationProperty(style));
            properties.Add(PropertyNames.TextDecorationStyle, style => new CSSTextDecorationStyleProperty(style));
            properties.Add(PropertyNames.TextDecorationLine, style => new CSSTextDecorationLineProperty(style));
            properties.Add(PropertyNames.TextDecorationColor, style => new CSSTextDecorationColorProperty(style));
            properties.Add(PropertyNames.TextIndent, style => new CSSTextIndentProperty(style));
            properties.Add(PropertyNames.TextTransform, style => new CSSTextTransformProperty(style));
            properties.Add(PropertyNames.TextShadow, style => new CSSTextShadowProperty(style));
            properties.Add(PropertyNames.Transform, style => new CSSTransformProperty(style));
            properties.Add(PropertyNames.TransformOrigin, style => new CSSTransformOriginProperty(style));
            properties.Add(PropertyNames.TransformStyle, style => new CSSTransformStyleProperty(style));
            properties.Add(PropertyNames.Transition, style => new CSSTransitionProperty(style));
            properties.Add(PropertyNames.TransitionDelay, style => new CSSTransitionDelayProperty(style));
            properties.Add(PropertyNames.TransitionDuration, style => new CSSTransitionDurationProperty(style));
            properties.Add(PropertyNames.TransitionTimingFunction, style => new CSSTransitionTimingFunctionProperty(style));
            properties.Add(PropertyNames.TransitionProperty, style => new CSSTransitionPropertyProperty(style));
            properties.Add(PropertyNames.Top, style => new CSSTopProperty(style));
            properties.Add(PropertyNames.UnicodeBidi, style => new CSSUnicodeBidiProperty(style));
            properties.Add(PropertyNames.VerticalAlign, style => new CSSVerticalAlignProperty(style));
            properties.Add(PropertyNames.Visibility, style => new CSSVisibilityProperty(style));
            properties.Add(PropertyNames.WhiteSpace, style => new CSSWhiteSpaceProperty(style));
            properties.Add(PropertyNames.Widows, style => new CSSWidowsProperty(style));
            properties.Add(PropertyNames.Width, style => new CSSWidthProperty(style));
            properties.Add(PropertyNames.WordSpacing, style => new CSSWordSpacingProperty(style));
            properties.Add(PropertyNames.ZIndex, style => new CSSZIndexProperty(style));
        }

        /// <summary>
        /// Creates a new property.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        /// <param name="style">The given style set.</param>
        /// <returns>The created property</returns>
        public static CSSProperty Create(String name, CSSStyleDeclaration style)
        {
            Func<CSSStyleDeclaration, CSSProperty> propertyCreator;
            var property = style.GetProperty(name);

            if (property == null && properties.TryGetValue(name, out propertyCreator))
                property = propertyCreator(style);

            return property;
        }
    }
}
<commit_msg>Two dictionaries to separate longhand from shorthand<commit_after>﻿namespace AngleSharp.DOM.Css
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// Provides string to CSSProperty instance creation mappings.
    /// </summary>
    static class CssPropertyFactory
    {
        static readonly Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>> longhands = new Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>>(StringComparer.OrdinalIgnoreCase);
        static readonly Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>> shorthands = new Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>>(StringComparer.OrdinalIgnoreCase);

        static CssPropertyFactory()
        {
            shorthands.Add(PropertyNames.Animation, style => new CSSAnimationProperty(style));
            longhands.Add(PropertyNames.AnimationDelay, style => new CSSAnimationDelayProperty(style));
            longhands.Add(PropertyNames.AnimationDirection, style => new CSSAnimationDirectionProperty(style));
            longhands.Add(PropertyNames.AnimationDuration, style => new CSSAnimationDurationProperty(style));
            longhands.Add(PropertyNames.AnimationFillMode, style => new CSSAnimationFillModeProperty(style));
            longhands.Add(PropertyNames.AnimationIterationCount, style => new CSSAnimationIterationCountProperty(style));
            longhands.Add(PropertyNames.AnimationName, style => new CSSAnimationNameProperty(style));
            longhands.Add(PropertyNames.AnimationPlayState, style => new CSSAnimationPlayStateProperty(style));
            longhands.Add(PropertyNames.AnimationTimingFunction, style => new CSSAnimationTimingFunctionProperty(style));
            longhands.Add(PropertyNames.BackgroundAttachment, style => new CSSBackgroundAttachmentProperty(style));
            longhands.Add(PropertyNames.BackgroundColor, style => new CSSBackgroundColorProperty(style));
            longhands.Add(PropertyNames.BackgroundClip, style => new CSSBackgroundClipProperty(style));
            longhands.Add(PropertyNames.BackgroundOrigin, style => new CSSBackgroundOriginProperty(style));
            longhands.Add(PropertyNames.BackgroundSize, style => new CSSBackgroundSizeProperty(style));
            longhands.Add(PropertyNames.BackgroundImage, style => new CSSBackgroundImageProperty(style));
            longhands.Add(PropertyNames.BackgroundPosition, style => new CSSBackgroundPositionProperty(style));
            longhands.Add(PropertyNames.BackgroundRepeat, style => new CSSBackgroundRepeatProperty(style));
            shorthands.Add(PropertyNames.Background, style => new CSSBackgroundProperty(style));
            shorthands.Add(PropertyNames.BorderColor, style => new CSSBorderColorProperty(style));
            longhands.Add(PropertyNames.BorderSpacing, style => new CSSBorderSpacingProperty(style));
            longhands.Add(PropertyNames.BorderCollapse, style => new CSSBorderCollapseProperty(style));
            shorthands.Add(PropertyNames.BorderStyle, style => new CSSBorderStyleProperty(style));
            longhands.Add(PropertyNames.BoxShadow, style => new CSSBoxShadowProperty(style));
            longhands.Add(PropertyNames.BoxDecorationBreak, style => new CSSBoxDecorationBreak(style));
            longhands.Add(PropertyNames.BreakAfter, style => new CSSBreakAfterProperty(style));
            longhands.Add(PropertyNames.BreakBefore, style => new CSSBreakBeforeProperty(style));
            longhands.Add(PropertyNames.BreakInside, style => new CSSBreakInsideProperty(style));
            longhands.Add(PropertyNames.BackfaceVisibility, style => new CSSBackfaceVisibilityProperty(style));
            longhands.Add(PropertyNames.BorderTopLeftRadius, style => new CSSBorderTopLeftRadiusProperty(style));
            longhands.Add(PropertyNames.BorderTopRightRadius, style => new CSSBorderTopRightRadiusProperty(style));
            longhands.Add(PropertyNames.BorderBottomLeftRadius, style => new CSSBorderBottomLeftRadiusProperty(style));
            longhands.Add(PropertyNames.BorderBottomRightRadius, style => new CSSBorderBottomRightRadiusProperty(style));
            longhands.Add(PropertyNames.BorderRadius, style => new CSSBorderRadiusProperty(style));
            longhands.Add(PropertyNames.BorderImage, style => new CSSBorderImageProperty(style));
            longhands.Add(PropertyNames.BorderImageOutset, style => new CSSBorderImageOutsetProperty(style));
            longhands.Add(PropertyNames.BorderImageRepeat, style => new CSSBorderImageRepeatProperty(style));
            longhands.Add(PropertyNames.BorderImageSource, style => new CSSBorderImageSourceProperty(style));
            longhands.Add(PropertyNames.BorderImageSlice, style => new CSSBorderImageSliceProperty(style));
            longhands.Add(PropertyNames.BorderImageWidth, style => new CSSBorderImageWidthProperty(style));
            longhands.Add(PropertyNames.BorderTopColor, style => new CSSBorderTopColorProperty(style));
            longhands.Add(PropertyNames.BorderLeftColor, style => new CSSBorderLeftColorProperty(style));
            longhands.Add(PropertyNames.BorderRightColor, style => new CSSBorderRightColorProperty(style));
            longhands.Add(PropertyNames.BorderBottomColor, style => new CSSBorderBottomColorProperty(style));
            longhands.Add(PropertyNames.BorderTopStyle, style => new CSSBorderTopStyleProperty(style));
            longhands.Add(PropertyNames.BorderLeftStyle, style => new CSSBorderLeftStyleProperty(style));
            longhands.Add(PropertyNames.BorderRightStyle, style => new CSSBorderRightStyleProperty(style));
            longhands.Add(PropertyNames.BorderBottomStyle, style => new CSSBorderBottomStyleProperty(style));
            longhands.Add(PropertyNames.BorderTopWidth, style => new CSSBorderTopWidthProperty(style));
            longhands.Add(PropertyNames.BorderLeftWidth, style => new CSSBorderLeftWidthProperty(style));
            longhands.Add(PropertyNames.BorderRightWidth, style => new CSSBorderRightWidthProperty(style));
            longhands.Add(PropertyNames.BorderBottomWidth, style => new CSSBorderBottomWidthProperty(style));
            shorthands.Add(PropertyNames.BorderWidth, style => new CSSBorderWidthProperty(style));
            shorthands.Add(PropertyNames.BorderTop, style => new CSSBorderTopProperty(style));
            shorthands.Add(PropertyNames.BorderRight, style => new CSSBorderRightProperty(style));
            shorthands.Add(PropertyNames.BorderBottom, style => new CSSBorderBottomProperty(style));
            shorthands.Add(PropertyNames.BorderLeft, style => new CSSBorderLeftProperty(style));
            shorthands.Add(PropertyNames.Border, style => new CSSBorderProperty(style));
            longhands.Add(PropertyNames.Bottom, style => new CSSBottomProperty(style));
            shorthands.Add(PropertyNames.Columns, style => new CSSColumnsProperty(style));
            longhands.Add(PropertyNames.ColumnCount, style => new CSSColumnCountProperty(style));
            longhands.Add(PropertyNames.ColumnWidth, style => new CSSColumnWidthProperty(style));
            longhands.Add(PropertyNames.ColumnFill, style => new CSSColumnFillProperty(style));
            longhands.Add(PropertyNames.ColumnGap, style => new CSSColumnGapProperty(style));
            longhands.Add(PropertyNames.ColumnSpan, style => new CSSColumnSpanProperty(style));
            shorthands.Add(PropertyNames.ColumnRule, style => new CSSColumnRuleProperty(style));
            longhands.Add(PropertyNames.ColumnRuleColor, style => new CSSColumnRuleColorProperty(style));
            longhands.Add(PropertyNames.ColumnRuleStyle, style => new CSSColumnRuleStyleProperty(style));
            longhands.Add(PropertyNames.ColumnRuleWidth, style => new CSSColumnRuleWidthProperty(style));
            longhands.Add(PropertyNames.CaptionSide, style => new CSSCaptionSideProperty(style));
            longhands.Add(PropertyNames.Clear, style => new CSSClearProperty(style));
            longhands.Add(PropertyNames.Clip, style => new CSSClipProperty(style));
            longhands.Add(PropertyNames.Color, style => new CSSColorProperty(style));
            longhands.Add(PropertyNames.Content, style => new CSSContentProperty(style));
            longhands.Add(PropertyNames.CounterIncrement, style => new CSSCounterIncrementProperty(style));
            longhands.Add(PropertyNames.CounterReset, style => new CSSCounterResetProperty(style));
            longhands.Add(PropertyNames.Cursor, style => new CSSCursorProperty(style));
            longhands.Add(PropertyNames.Direction, style => new CSSDirectionProperty(style));
            longhands.Add(PropertyNames.Display, style => new CSSDisplayProperty(style));
            longhands.Add(PropertyNames.EmptyCells, style => new CSSEmptyCellsProperty(style));
            longhands.Add(PropertyNames.Float, style => new CSSFloatProperty(style));
            longhands.Add(PropertyNames.FontFamily, style => new CSSFontFamilyProperty(style));
            longhands.Add(PropertyNames.FontSize, style => new CSSFontSizeProperty(style));
            longhands.Add(PropertyNames.FontSizeAdjust, style => new CSSFontSizeAdjustProperty(style));
            longhands.Add(PropertyNames.FontStyle, style => new CSSFontStyleProperty(style));
            longhands.Add(PropertyNames.FontVariant, style => new CSSFontVariantProperty(style));
            longhands.Add(PropertyNames.FontWeight, style => new CSSFontWeightProperty(style));
            longhands.Add(PropertyNames.FontStretch, style => new CSSFontStretchProperty(style));
            shorthands.Add(PropertyNames.Font, style => new CSSFontProperty(style));
            longhands.Add(PropertyNames.Height, style => new CSSHeightProperty(style));
            longhands.Add(PropertyNames.Left, style => new CSSLeftProperty(style));
            longhands.Add(PropertyNames.LetterSpacing, style => new CSSLetterSpacingProperty(style));
            longhands.Add(PropertyNames.LineHeight, style => new CSSLineHeightProperty(style));
            longhands.Add(PropertyNames.ListStyleImage, style => new CSSListStyleImageProperty(style));
            longhands.Add(PropertyNames.ListStylePosition, style => new CSSListStylePositionProperty(style));
            longhands.Add(PropertyNames.ListStyleType, style => new CSSListStyleTypeProperty(style));
            shorthands.Add(PropertyNames.ListStyle, style => new CSSListStyleProperty(style));
            longhands.Add(PropertyNames.MarginRight, style => new CSSMarginRightProperty(style));
            longhands.Add(PropertyNames.MarginLeft, style => new CSSMarginLeftProperty(style));
            longhands.Add(PropertyNames.MarginTop, style => new CSSMarginTopProperty(style));
            longhands.Add(PropertyNames.MarginBottom, style => new CSSMarginBottomProperty(style));
            shorthands.Add(PropertyNames.Margin, style => new CSSMarginProperty(style));
            longhands.Add(PropertyNames.MaxHeight, style => new CSSMaxHeightProperty(style));
            longhands.Add(PropertyNames.MaxWidth, style => new CSSMaxWidthProperty(style));
            longhands.Add(PropertyNames.MinHeight, style => new CSSMinHeightProperty(style));
            longhands.Add(PropertyNames.MinWidth, style => new CSSMinWidthProperty(style));
            longhands.Add(PropertyNames.Opacity, style => new CSSOpacityProperty(style));
            longhands.Add(PropertyNames.Orphans, style => new CSSOrphansProperty(style));
            longhands.Add(PropertyNames.OutlineColor, style => new CSSOutlineColorProperty(style));
            longhands.Add(PropertyNames.OutlineStyle, style => new CSSOutlineStyleProperty(style));
            longhands.Add(PropertyNames.OutlineWidth, style => new CSSOutlineWidthProperty(style));
            shorthands.Add(PropertyNames.Outline, style => new CSSOutlineProperty(style));
            longhands.Add(PropertyNames.Overflow, style => new CSSOverflowProperty(style));
            longhands.Add(PropertyNames.PaddingTop, style => new CSSPaddingTopProperty(style));
            longhands.Add(PropertyNames.PaddingRight, style => new CSSPaddingRightProperty(style));
            longhands.Add(PropertyNames.PaddingLeft, style => new CSSPaddingLeftProperty(style));
            longhands.Add(PropertyNames.PaddingBottom, style => new CSSPaddingBottomProperty(style));
            shorthands.Add(PropertyNames.Padding, style => new CSSPaddingProperty(style));
            longhands.Add(PropertyNames.PageBreakAfter, style => new CSSPageBreakAfterProperty(style));
            longhands.Add(PropertyNames.PageBreakBefore, style => new CSSPageBreakBeforeProperty(style));
            longhands.Add(PropertyNames.PageBreakInside, style => new CSSPageBreakInsideProperty(style));
            longhands.Add(PropertyNames.Perspective, style => new CSSPerspectiveProperty(style));
            longhands.Add(PropertyNames.PerspectiveOrigin, style => new CSSPerspectiveOriginProperty(style));
            longhands.Add(PropertyNames.Position, style => new CSSPositionProperty(style));
            longhands.Add(PropertyNames.Quotes, style => new CSSQuotesProperty(style));
            longhands.Add(PropertyNames.Right, style => new CSSRightProperty(style));
            longhands.Add(PropertyNames.TableLayout, style => new CSSTableLayoutProperty(style));
            longhands.Add(PropertyNames.TextAlign, style => new CSSTextAlignProperty(style));
            shorthands.Add(PropertyNames.TextDecoration, style => new CSSTextDecorationProperty(style));
            longhands.Add(PropertyNames.TextDecorationStyle, style => new CSSTextDecorationStyleProperty(style));
            longhands.Add(PropertyNames.TextDecorationLine, style => new CSSTextDecorationLineProperty(style));
            longhands.Add(PropertyNames.TextDecorationColor, style => new CSSTextDecorationColorProperty(style));
            longhands.Add(PropertyNames.TextIndent, style => new CSSTextIndentProperty(style));
            longhands.Add(PropertyNames.TextTransform, style => new CSSTextTransformProperty(style));
            longhands.Add(PropertyNames.TextShadow, style => new CSSTextShadowProperty(style));
            longhands.Add(PropertyNames.Transform, style => new CSSTransformProperty(style));
            longhands.Add(PropertyNames.TransformOrigin, style => new CSSTransformOriginProperty(style));
            longhands.Add(PropertyNames.TransformStyle, style => new CSSTransformStyleProperty(style));
            shorthands.Add(PropertyNames.Transition, style => new CSSTransitionProperty(style));
            longhands.Add(PropertyNames.TransitionDelay, style => new CSSTransitionDelayProperty(style));
            longhands.Add(PropertyNames.TransitionDuration, style => new CSSTransitionDurationProperty(style));
            longhands.Add(PropertyNames.TransitionTimingFunction, style => new CSSTransitionTimingFunctionProperty(style));
            longhands.Add(PropertyNames.TransitionProperty, style => new CSSTransitionPropertyProperty(style));
            longhands.Add(PropertyNames.Top, style => new CSSTopProperty(style));
            longhands.Add(PropertyNames.UnicodeBidi, style => new CSSUnicodeBidiProperty(style));
            longhands.Add(PropertyNames.VerticalAlign, style => new CSSVerticalAlignProperty(style));
            longhands.Add(PropertyNames.Visibility, style => new CSSVisibilityProperty(style));
            longhands.Add(PropertyNames.WhiteSpace, style => new CSSWhiteSpaceProperty(style));
            longhands.Add(PropertyNames.Widows, style => new CSSWidowsProperty(style));
            longhands.Add(PropertyNames.Width, style => new CSSWidthProperty(style));
            longhands.Add(PropertyNames.WordSpacing, style => new CSSWordSpacingProperty(style));
            longhands.Add(PropertyNames.ZIndex, style => new CSSZIndexProperty(style));
        }

        /// <summary>
        /// Creates a new property.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        /// <param name="style">The given style set.</param>
        /// <returns>The created property</returns>
        public static CSSProperty Create(String name, CSSStyleDeclaration style)
        {
            Func<CSSStyleDeclaration, CSSProperty> propertyCreator;
            var property = style.GetProperty(name);

            if (property != null)
                return property;

            if (longhands.TryGetValue(name, out propertyCreator) || shorthands.TryGetValue(name, out propertyCreator))
                property = propertyCreator(style);

            return property;
        }

        /// <summary>
        /// Checks if the given property name is a shorthand property.
        /// </summary>
        /// <param name="name">The name of the property.</param>
        /// <returns>True if the property is a shorthand, otherwise false.</returns>
        public static Boolean IsShorthand(String name)
        {
            return shorthands.ContainsKey(name);
        }
    }
}

{'fraction_non_alphanumeric': 0.09961537314767882, 'fraction_numerical': 0.0, 'mean_word_length': 4.061113626075147, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 345, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6029533', 'n_tokens_mistral': 7994, 'n_tokens_neox': 7825, 'n_words': 1410}