Esempio n. 1
0
        private void StackCheck(Token token)
        {
            DropStackToTag();

            switch (token.Type)
            {
            case HtmlNodeType.ClosedTag:
            case HtmlNodeType.Comment:
            case HtmlNodeType.Text:
            case HtmlNodeType.Whitespace:
            {
                if (HtmlNodeType.Tag == _nestedTokens.Top.Type)
                {
                    _nestedTokens.Push(token);
                }
                else
                {
                    _nestedTokens.Swap(token);
                }
                break;
            }

            case HtmlNodeType.Tag:
            {
                if (!Tag.IsAtomic(token.Name))
                {
                    _nestedTokens.Push(token);
                }
                else
                {
                    _nestedTokens.Swap(token);
                }
                break;
            }

            case HtmlNodeType.EndTag:
            {
                _nestedTokens.Push(token);
                break;
            }

            default:
                throw new HtmlException(RD.GetString("tagUnknown"));
            }
        }
Esempio n. 2
0
 public override void RemoveAt(int pos)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Esempio n. 3
0
 public override void Remove(HtmlNode x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Esempio n. 4
0
 public override void Insert(int pos, HtmlNode x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Esempio n. 5
0
 public override void Clear()
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Esempio n. 6
0
 public override int AddRange(HtmlNode[] x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Esempio n. 7
0
 public override int Add(HtmlAttribute x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }