Microsoft.Html.Core.Tree.Builder.DefaultHtmlClosureProvider.DefaultHtmlClosureProvider C# (CSharp) Method

DefaultHtmlClosureProvider() public method

public DefaultHtmlClosureProvider ( ) : System
return System
        public DefaultHtmlClosureProvider() {
            if (_voidElementNameIndex != null)
                return;

            _voidElementNameIndex = new string[(int)'z' - (int)'A' + 1][];
            _implicitlyClosingElementNameIndex = new string[(int)'z' - (int)'A' + 1][];

            // If you update the table, make sure you update min/max length as well
            for (int i = 0; i < _implicitlyClosingElementNameIndex.Length; i++)
                _implicitlyClosingElementNameIndex[i] = null;

            AddElements(_implicitlyClosingElementNameIndex, new string[] { "frame" });
            AddElements(_implicitlyClosingElementNameIndex, new string[] { "dd", "dt" });
            AddElements(_implicitlyClosingElementNameIndex, new string[] { "li" });
            AddElements(_implicitlyClosingElementNameIndex, new string[] { "option" });
            AddElements(_implicitlyClosingElementNameIndex, new string[] { "p" });
            AddElements(_implicitlyClosingElementNameIndex, new string[] { "tbody", "td", "tfoot", "th", "thead", "tr" });

            for (int i = 0; i < _voidElementNameIndex.Length; i++)
                _voidElementNameIndex[i] = null;

            // http://dev.w3.org/html5/markup/syntax.html#void-element
            AddElements(_voidElementNameIndex, new string[] { "area" });
            AddElements(_voidElementNameIndex, new string[] { "base", "basefont", "br" });
            AddElements(_voidElementNameIndex, new string[] { "col", "command" });
            AddElements(_voidElementNameIndex, new string[] { "embed" });
            AddElements(_voidElementNameIndex, new string[] { "hr" });
            AddElements(_voidElementNameIndex, new string[] { "img", "input", "isindex" });
            AddElements(_voidElementNameIndex, new string[] { "keygen" });
            AddElements(_voidElementNameIndex, new string[] { "link" });
            AddElements(_voidElementNameIndex, new string[] { "meta" });
            AddElements(_voidElementNameIndex, new string[] { "param" });
            AddElements(_voidElementNameIndex, new string[] { "source" });
            AddElements(_voidElementNameIndex, new string[] { "track" });
            AddElements(_voidElementNameIndex, new string[] { "wbr" });
        }
        #endregion