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

    /// <summary>
    /// More information available at
    /// https://developer.mozilla.org/en-US/docs/Web/CSS/list-style
    /// </summary>
    public sealed class CSSListStyleProperty : CSSProperty
    {
        #region Fields

        ListStyle _type;
        CSSImageValue _image;
        ListPosition _position;

        #endregion

        #region ctor

        internal CSSListStyleProperty()
            : base(PropertyNames.ListStyle)
        {
            _inherited = true;
            _type = ListStyle.Disc;
            _image = null;
            _position = ListPosition.Outside;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the selected list-style type.
        /// </summary>
        public ListStyle Type
        {
            get { return _type; }
        }

        /// <summary>
        /// Gets the selected image for the list.
        /// </summary>
        public CSSImageValue Image
        {
            get { return _image; }
        }

        /// <summary>
        /// Gets the selected position for the list-style.
        /// </summary>
        public ListPosition Position
        {
            get { return _position; }
        }

        #endregion

        #region Methods

        /// <summary>
        /// Determines if the given value represents a valid state of this property.
        /// </summary>
        /// <param name="value">The state that should be used.</param>
        /// <returns>True if the state is valid, otherwise false.</returns>
        protected override Boolean IsValid(CSSValue value)
        {
            if (value == CSSValue.Inherit)
                return true;

            var list = value as CSSValueList ?? new CSSValueList(value);
            ListStyle? type = null;
            CSSImageValue image = null;
            ListPosition? position = null;

            if (list.Length > 3)
                return false;

            for (int i = 0; i < list.Length; i++)
            {
                if (!type.HasValue && (type = list[i].ToListStyle()).HasValue)
                    continue;
                else if (image == null && (image = list[i].AsImage()) != null)
                    continue;
                else if (!position.HasValue && (position = list[i].ToListPosition()).HasValue)
                    continue;

                return false;
            }

            _type = type.Value;
            _image = image;
            _position = position.Value;
            return true;
        }

        #endregion
    }
}<commit_msg>Reset to default if not used<commit_after>﻿namespace AngleSharp.DOM.Css.Properties
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// More information available at
    /// https://developer.mozilla.org/en-US/docs/Web/CSS/list-style
    /// </summary>
    public sealed class CSSListStyleProperty : CSSProperty
    {
        #region Fields

        ListStyle _type;
        CSSImageValue _image;
        ListPosition _position;

        #endregion

        #region ctor

        internal CSSListStyleProperty()
            : base(PropertyNames.ListStyle)
        {
            _inherited = true;
            _type = ListStyle.Disc;
            _image = null;
            _position = ListPosition.Outside;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the selected list-style type.
        /// </summary>
        public ListStyle Type
        {
            get { return _type; }
        }

        /// <summary>
        /// Gets the selected image for the list.
        /// </summary>
        public CSSImageValue Image
        {
            get { return _image; }
        }

        /// <summary>
        /// Gets the selected position for the list-style.
        /// </summary>
        public ListPosition Position
        {
            get { return _position; }
        }

        #endregion

        #region Methods

        /// <summary>
        /// Determines if the given value represents a valid state of this property.
        /// </summary>
        /// <param name="value">The state that should be used.</param>
        /// <returns>True if the state is valid, otherwise false.</returns>
        protected override Boolean IsValid(CSSValue value)
        {
            if (value == CSSValue.Inherit)
                return true;

            var list = value as CSSValueList ?? new CSSValueList(value);
            ListStyle? type = null;
            CSSImageValue image = null;
            ListPosition? position = null;

            if (list.Length > 3)
                return false;

            for (int i = 0; i < list.Length; i++)
            {
                if (!type.HasValue && (type = list[i].ToListStyle()).HasValue)
                    continue;
                else if (image == null && (image = list[i].AsImage()) != null)
                    continue;
                else if (!position.HasValue && (position = list[i].ToListPosition()).HasValue)
                    continue;

                return false;
            }

            _type = type.HasValue ? type.Value : ListStyle.Disc;
            _image = image;
            _position = position.HasValue ? position.Value : ListPosition.Outside;
            return true;
        }

        #endregion
    }
}
{'fraction_non_alphanumeric': 0.10122868145974692, 'fraction_numerical': 0.0007335411699981661, 'mean_word_length': 1.3858267716535433, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 2, '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': '1459851', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1338, 'n_words': 381}